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 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 two simple options for use with the command line tool: **add** and **remove**.
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.
@@ -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|
@@ -1,3 +1,3 @@
1
1
  module Exportr
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exportr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: