exportr 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -28,8 +28,8 @@ 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 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`.
31
+ There are four simple options for use with the command line tool: **add**, **remove**, **clear** and **list**.
32
+ You can use flags longform `--add, --remove, --clear, --list` or shorhand `-a, -r, -c, -l`.
33
33
 
34
34
  $ exportr --add KEY=VALUE
35
35
 
@@ -37,6 +37,8 @@ You can use flags longform `--add, --remove, --clear` or shorhand `-a, -r, -c`.
37
37
 
38
38
  $ exportr --clear
39
39
 
40
+ $ exportr --list
41
+
40
42
  ### FYI
41
43
 
42
44
  You'll need to restart your webserver for the changes to take effect.
@@ -47,18 +47,14 @@ module Exportr
47
47
  log "Exportr Environment Variables"
48
48
  log "--------------------------------------------------"
49
49
  vars = load_config.to_a
50
- vars.each do |var|
51
- log "#{var[0]}=#{var[1]}"
52
- end
50
+ vars.each { |var| log "#{var[0]}=#{var[1]}" }
53
51
  log("none.") unless vars.any?
54
52
  end
55
53
 
56
54
  def self.parser
57
55
  OptionParser.new do |parser|
58
56
  global_options.each do |opt|
59
- parser.on *opt[:args] do |val|
60
- send opt[:name], hashify(val)
61
- end
57
+ parser.on *opt[:args] { |val| send opt[:name], hashify(val) }
62
58
  end
63
59
  end
64
60
  end
@@ -1,3 +1,3 @@
1
1
  module Exportr
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
@@ -4,7 +4,16 @@ class ExportrGenerator < Rails::Generators::Base
4
4
 
5
5
  def generate_initializer
6
6
  copy_file 'exportr.yml', 'config/exportr.yml'
7
- copy_file 'exportr.rb', 'config/initializers/exportr.rb'
7
+ # copy_file 'exportr.rb', 'config/initializers/exportr.rb'
8
+ application '
9
+ # Loads export.yml and sets key=value to the local environment
10
+ config.before_initialize do
11
+ require "exportr/config"
12
+ if File.exists? "#{Rails.root}/#{Exportr::Config::CONFIG_FILE}"
13
+ config = YAML.load(File.open("#{Rails.root}/#{Exportr::Config::CONFIG_FILE}"))
14
+ config.each_pair { |key,value| ENV[key] = value } if config
15
+ end
16
+ end'
8
17
  end
9
18
 
10
19
  def mod_gitignore
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.8
4
+ version: 0.1.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-30 00:00:00.000000000 Z
12
+ date: 2012-04-09 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Helps manage rails application specific environment variables for multiple
15
15
  apps in development.
@@ -33,7 +33,6 @@ files:
33
33
  - lib/exportr/helpers.rb
34
34
  - lib/exportr/version.rb
35
35
  - lib/generators/exportr/exportr_generator.rb
36
- - lib/generators/exportr/templates/exportr.rb
37
36
  - lib/generators/exportr/templates/exportr.yml
38
37
  homepage: ''
39
38
  licenses: []
@@ -1,7 +0,0 @@
1
- require 'exportr/config'
2
-
3
- # Loads export.yml and sets key=value to the local environment
4
- if File.exists? "#{Rails.root}/#{Exportr::Config::CONFIG_FILE}"
5
- config = YAML.load(File.open("#{Rails.root}/#{Exportr::Config::CONFIG_FILE}"))
6
- config.each_pair { |key,value| ENV[key] = value } if config
7
- end