exportr 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -3
- data/lib/exportr/command.rb +12 -1
- data/lib/exportr/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -28,14 +28,15 @@ The generator creates a yaml file in your config directory. It will store key:va
|
|
28
28
|
|
29
29
|
### CLI
|
30
30
|
|
31
|
-
There are
|
32
|
-
You can use flags longform `--add, --remove` or shorhand `-a, -r`.
|
31
|
+
There are three simple options for use with the command line tool: **add**, **remove** and **clear**.
|
32
|
+
You can use flags longform `--add, --remove, --clear` or shorhand `-a, -r, -c`.
|
33
33
|
|
34
34
|
$ exportr --add KEY=VALUE
|
35
|
-
or
|
36
35
|
|
37
36
|
$ exportr --remove KEY
|
38
37
|
|
38
|
+
$ exportr --clear
|
39
|
+
|
39
40
|
### FYI
|
40
41
|
|
41
42
|
You'll need to restart your webserver for the changes to take effect.
|
data/lib/exportr/command.rb
CHANGED
@@ -21,6 +21,7 @@ module Exportr
|
|
21
21
|
global_option :add, '-a', '--add VAR', 'Add environment variable'
|
22
22
|
global_option :remove, '-r', '--remove VAR', 'Remove environment variable'
|
23
23
|
global_option :clear, '-c', '--clear', 'Clear out all environment variables'
|
24
|
+
global_option :list, '-l', '--list', 'List all environment variables'
|
24
25
|
|
25
26
|
def self.run *argv
|
26
27
|
error NOT_ROOT unless at_root?
|
@@ -37,11 +38,21 @@ module Exportr
|
|
37
38
|
write_config load_config.reject { |k,v| k == val.to_a[0][0] }
|
38
39
|
end
|
39
40
|
|
40
|
-
def self.clear val
|
41
|
+
def self.clear val=nil
|
41
42
|
log "Clearing environment variables..."
|
42
43
|
write_config Hash.new
|
43
44
|
end
|
44
45
|
|
46
|
+
def self.list val=nil
|
47
|
+
log "Exportr Environment Variables"
|
48
|
+
log "--------------------------------------------------"
|
49
|
+
vars = load_config.to_a
|
50
|
+
vars.each do |var|
|
51
|
+
log "#{var[0]}=#{var[1]}"
|
52
|
+
end
|
53
|
+
log("none.") unless vars.any?
|
54
|
+
end
|
55
|
+
|
45
56
|
def self.parser
|
46
57
|
OptionParser.new do |parser|
|
47
58
|
global_options.each do |opt|
|
data/lib/exportr/version.rb
CHANGED