https://github.com/markjaquith/localdev
Simple Ruby command line utility to point domains to your localhost
https://github.com/markjaquith/localdev
Last synced: about 1 year ago
JSON representation
Simple Ruby command line utility to point domains to your localhost
- Host: GitHub
- URL: https://github.com/markjaquith/localdev
- Owner: markjaquith
- License: gpl-2.0
- Created: 2011-06-28T12:07:55.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2015-04-26T05:08:11.000Z (about 11 years ago)
- Last Synced: 2025-04-05T01:03:10.583Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 106 KB
- Stars: 33
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# Localdev
Localdev is a Ruby command line script to register domains that you sometimes use for local development, and to quickly enable or disable local development for those domains. Only expected to work on OS X. Requires sudo access, as it is manipulating your hosts file.
Available commands:
* `localdev list` — lists the localdev domains
* `localdev add {domain}` — adds the specified domain (pointing to 127.0.0.1)
* `localdev add {domain} {ip}` — adds the specified domain (pointing to the IP you specified)
* `localdev remove {domain}` — removes the specified domain
* `localdev on` — enables local development
* `localdev off` — disables local development
* `localdev status` — shows the current status
Note: if local development is on, `add` and `remove` commands will immediately update the hosts file and trigger a DNS flush.
Tip: To avoid being prompted by `sudo` for your password, you can add a line like this to your `/etc/sudoers` file (replace `markjaquith` with your user name):
```
markjaquith ALL = NOPASSWD: /usr/bin/localdev
```
## Installation
To install Localdev, use RubyGems:
```bash
sudo gem install localdev
```
## Notes
Your list of local development domains is kept in `/etc/hosts-localdev` as a YAML file.
## License & Copyright
Localdev is Copyright Mark Jaquith 2011–2015, and is offered under the terms of the GNU General Public License, version 2, or any later version.