figaro 0.5.2 → 0.5.3
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.
- data/figaro.gemspec +2 -2
- data/lib/figaro/tasks.rb +2 -2
- data/spec/figaro/tasks_spec.rb +11 -11
- metadata +12 -4
data/figaro.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = "figaro"
|
5
|
-
gem.version = "0.5.
|
5
|
+
gem.version = "0.5.3"
|
6
6
|
|
7
7
|
gem.authors = ["Steve Richert"]
|
8
8
|
gem.email = ["steve.richert@gmail.com"]
|
@@ -19,6 +19,6 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.add_development_dependency "rspec", "~> 2.0"
|
20
20
|
|
21
21
|
gem.files = `git ls-files`.split($\)
|
22
|
-
gem.test_files = gem.files.grep(/^features
|
22
|
+
gem.test_files = gem.files.grep(/^(features|gemfiles|spec)/)
|
23
23
|
gem.require_paths = ["lib"]
|
24
24
|
end
|
data/lib/figaro/tasks.rb
CHANGED
@@ -5,10 +5,10 @@ module Figaro
|
|
5
5
|
def self.heroku(app = nil)
|
6
6
|
with_app = app ? " --app #{app}" : ""
|
7
7
|
|
8
|
-
rails_env =
|
8
|
+
rails_env = `heroku config:get RAILS_ENV#{with_app}`.chomp
|
9
9
|
vars = Figaro.vars(rails_env.presence)
|
10
10
|
|
11
|
-
|
11
|
+
`heroku config:add #{vars}#{with_app}`
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
data/spec/figaro/tasks_spec.rb
CHANGED
@@ -5,9 +5,9 @@ describe Figaro::Tasks do
|
|
5
5
|
it "configures Heroku" do
|
6
6
|
Figaro.stub(:vars => "FOO=bar")
|
7
7
|
|
8
|
-
|
9
|
-
and_return("development")
|
10
|
-
|
8
|
+
Figaro::Tasks.should_receive(:`).once.with("heroku config:get RAILS_ENV").
|
9
|
+
and_return("development\n")
|
10
|
+
Figaro::Tasks.should_receive(:`).once.with("heroku config:add FOO=bar")
|
11
11
|
|
12
12
|
Figaro::Tasks.heroku
|
13
13
|
end
|
@@ -15,31 +15,31 @@ describe Figaro::Tasks do
|
|
15
15
|
it "configures a specific Heroku app" do
|
16
16
|
Figaro.stub(:vars => "FOO=bar")
|
17
17
|
|
18
|
-
|
18
|
+
Figaro::Tasks.should_receive(:`).once.
|
19
19
|
with("heroku config:get RAILS_ENV --app my-app").
|
20
|
-
and_return("development")
|
21
|
-
|
20
|
+
and_return("development\n")
|
21
|
+
Figaro::Tasks.should_receive(:`).once.
|
22
22
|
with("heroku config:add FOO=bar --app my-app")
|
23
23
|
|
24
24
|
Figaro::Tasks.heroku("my-app")
|
25
25
|
end
|
26
26
|
|
27
27
|
it "respects the Heroku's remote Rails environment" do
|
28
|
-
|
29
|
-
and_return("production")
|
28
|
+
Figaro::Tasks.stub(:`).with("heroku config:get RAILS_ENV").
|
29
|
+
and_return("production\n")
|
30
30
|
|
31
31
|
Figaro.should_receive(:vars).once.with("production").and_return("FOO=bar")
|
32
|
-
|
32
|
+
Figaro::Tasks.should_receive(:`).once.with("heroku config:add FOO=bar")
|
33
33
|
|
34
34
|
Figaro::Tasks.heroku
|
35
35
|
end
|
36
36
|
|
37
37
|
it "defaults to the local Rails environment if not set remotely" do
|
38
|
-
|
38
|
+
Figaro::Tasks.stub(:`).with("heroku config:get RAILS_ENV").
|
39
39
|
and_return("\n")
|
40
40
|
|
41
41
|
Figaro.should_receive(:vars).once.with(nil).and_return("FOO=bar")
|
42
|
-
|
42
|
+
Figaro::Tasks.should_receive(:`).once.with("heroku config:add FOO=bar")
|
43
43
|
|
44
44
|
Figaro::Tasks.heroku
|
45
45
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: figaro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
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: 2013-01-
|
12
|
+
date: 2013-01-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -158,7 +158,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
158
158
|
version: '0'
|
159
159
|
segments:
|
160
160
|
- 0
|
161
|
-
hash:
|
161
|
+
hash: 2716496267294423407
|
162
162
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
163
|
none: false
|
164
164
|
requirements:
|
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
version: '0'
|
168
168
|
segments:
|
169
169
|
- 0
|
170
|
-
hash:
|
170
|
+
hash: 2716496267294423407
|
171
171
|
requirements: []
|
172
172
|
rubyforge_project:
|
173
173
|
rubygems_version: 1.8.24
|
@@ -181,3 +181,11 @@ test_files:
|
|
181
181
|
- features/step_definitions/rails_steps.rb
|
182
182
|
- features/support/aruba.rb
|
183
183
|
- features/support/env.rb
|
184
|
+
- gemfiles/rails30.gemfile
|
185
|
+
- gemfiles/rails31.gemfile
|
186
|
+
- gemfiles/rails32.gemfile
|
187
|
+
- spec/figaro/env_spec.rb
|
188
|
+
- spec/figaro/tasks_spec.rb
|
189
|
+
- spec/figaro_spec.rb
|
190
|
+
- spec/spec_helper.rb
|
191
|
+
- spec/support/rake.rb
|