capistrano-multiconfig 3.0.0 → 3.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2444c019b2164fb48b8c2b07ad2b92f43852cfb7
4
- data.tar.gz: 22c2d78e1dfeaf94989f2f4a0f0d6f7478db8852
3
+ metadata.gz: 7a4a01eddf6db929483491f1ab6e8f1bee0c1de0
4
+ data.tar.gz: 37b27ad85cb0cdfb72562e666e3886c90a09256d
5
5
  SHA512:
6
- metadata.gz: cd67f960281c7c3e633c1c9cdd9562ebf4c9b4f9ee848a93b8d1229b6e53c446f0ef01dfa2facbd2ff7c8bb5348e99da003b19c0314c9f4af307dafee4124302
7
- data.tar.gz: 2e2f10fc4c5f9e4ad3257d1feac61495a50bdd0d3a68c92537e3f204d7ed4b3027771a1b4ec14208b24e2702c745afc0bedae1b5731b15586ec221f2aeb6f955
6
+ metadata.gz: 4125540d382803fa4f317d7452eeb83229bae15457aaefab91de85b1f5d2c3331d492b6e3dc9441c48c23d63ecd5e3818875f1141aaacc2f71c5811c7442d7a6
7
+ data.tar.gz: a1e9b7b9dbad421babef44a1704180a9a8d90156a87ca8e0b76d8f8048ead068cad6b234f80d08df0b335cc1d216d74142f76fbaff4d4256e2d1cc4e71f4be18
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "capistrano-multiconfig"
6
- s.version = "3.0.0"
6
+ s.version = "3.0.1"
7
7
  s.authors = ["Andriy Yanko"]
8
8
  s.email = ["andriy.yanko@gmail.com"]
9
9
  s.homepage = "https://github.com/railsware/multiconfig"
@@ -0,0 +1 @@
1
+ set :message, "hello from root"
@@ -0,0 +1 @@
1
+ set :message, "#{fetch(:message)} world"
@@ -9,11 +9,20 @@ config_names = Capistrano::Multiconfig::Configurations.find_names(config_root_pa
9
9
  config_names.each do |config_name|
10
10
  Rake::Task.define_task(config_name) do
11
11
  set(:config_name, config_name)
12
- segments = config_name.split(":")
13
- segments.size.times do |i|
14
- path = File.join([config_root_path] + segments[0..i]) + '.rb'
15
- load(path) if File.exists?(path)
12
+
13
+ load "capistrano/defaults.rb"
14
+
15
+ paths = [ config_root_path + '.rb' ]
16
+
17
+ (segments = config_name.split(":")).size.times do |i|
18
+ paths << File.join([config_root_path] + segments[0..i]) + '.rb'
16
19
  end
20
+
21
+ paths.each { |path| load(path) if File.exists?(path) }
22
+
23
+ load "capistrano/#{fetch(:scm)}.rb"
24
+ I18n.locale = fetch(:locale, :en)
25
+ configure_backend
17
26
  end.add_description("Load #{config_name} configuration")
18
27
  end
19
28
 
@@ -87,6 +87,14 @@ TEXT
87
87
  subject.should == "hello from level0 level1 world\n"
88
88
  end
89
89
  end
90
+
91
+ context "configuration with root and nested" do
92
+ let(:config_root) { 'config/root_with_nested' }
93
+ subject { run_cap("app:config hello_world") }
94
+ it "should display nested message from root" do
95
+ subject.should == "hello from root world\n"
96
+ end
97
+ end
90
98
  end
91
99
 
92
100
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-multiconfig
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andriy Yanko
@@ -58,6 +58,8 @@ files:
58
58
  - fixtures/config/nested_with_shared_file/app.rb
59
59
  - fixtures/config/nested_with_shared_file/app/production.rb
60
60
  - fixtures/config/nested_with_shared_file/app/staging.rb
61
+ - fixtures/config/root_with_nested.rb
62
+ - fixtures/config/root_with_nested/app/config.rb
61
63
  - fixtures/config/sample/apps/world1.rb
62
64
  - fixtures/config/sample/apps/world2.rb
63
65
  - fixtures/config/third_level_nested/app/blog/production.rb