localdev 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/localdev.rb +9 -4
  2. metadata +4 -4
@@ -20,7 +20,7 @@
20
20
  require 'digest/md5'
21
21
 
22
22
  class Localdev
23
- VERSION = '0.3.0'
23
+ VERSION = '0.3.1'
24
24
 
25
25
  def initialize
26
26
  @debug = false
@@ -28,7 +28,7 @@ class Localdev
28
28
  @hosts = '/etc/hosts'
29
29
  @start = '#==LOCALDEV==#'
30
30
  @end = '#/==LOCALDEV==#'
31
- if !ARGV.first.nil? && [:on, :off, :add, :remove].include?( ARGV.first.to_sym )
31
+ if !ARGV.first.nil? && [:on, :off, :add, :remove, :list].include?( ARGV.first.to_sym )
32
32
  require_sudo
33
33
  ensure_localdev_exists
34
34
  end
@@ -38,7 +38,7 @@ class Localdev
38
38
  case command
39
39
  when :"--v", :"--version"
40
40
  info
41
- when :on, :off, :status
41
+ when :on, :off, :status, :list
42
42
  send command
43
43
  when :add, :remove
44
44
  require_sudo
@@ -159,7 +159,6 @@ class Localdev
159
159
  end
160
160
 
161
161
  def get_status
162
- # do magic
163
162
  status = :off
164
163
  return status unless File.readable? @hosts
165
164
  File.open( @hosts, 'r' ) do |file|
@@ -173,6 +172,12 @@ class Localdev
173
172
  return status
174
173
  end
175
174
 
175
+ def list
176
+ File.open( @localdev, 'r' ) do |file|
177
+ puts file.read
178
+ end
179
+ end
180
+
176
181
  def status
177
182
  puts "Localdev is #{get_status}"
178
183
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: localdev
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
9
+ - 1
10
+ version: 0.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mark Jaquith
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-29 00:00:00 Z
18
+ date: 2011-07-03 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: Localdev manages part of your hosts file and lets you specify domains to host locally. You can quickly enable or disable local hosting of those domains.