capistrano-multiconfig 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/capistrano-multiconfig.gemspec +1 -1
- data/lib/capistrano/multiconfig/configurations.rb +33 -6
- metadata +33 -56
@@ -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 = "0.0.
|
6
|
+
s.version = "0.0.2"
|
7
7
|
s.authors = ["Andriy Yanko"]
|
8
8
|
s.email = ["andriy.yanko@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/railsware/multiconfig"
|
@@ -32,8 +32,10 @@ Capistrano::Configuration.instance.load do
|
|
32
32
|
namespace_names = segments[0, segments.size - 1]
|
33
33
|
task_name = segments.last
|
34
34
|
|
35
|
-
# create configuration task block
|
36
|
-
|
35
|
+
# create configuration task block.
|
36
|
+
# NOTE: Capistrano 'namespace' DSL invokes instance_eval that
|
37
|
+
# that pass evaluable object as argument to block.
|
38
|
+
block = lambda do |parent|
|
37
39
|
desc "Load #{config_name} configuration"
|
38
40
|
task(task_name) do
|
39
41
|
# set configuration name as :config_name variable
|
@@ -48,14 +50,39 @@ Capistrano::Configuration.instance.load do
|
|
48
50
|
end
|
49
51
|
|
50
52
|
# wrap task block into namespace blocks
|
53
|
+
#
|
54
|
+
# namespace_names = [nsN, ..., ns2, ns1]
|
55
|
+
#
|
56
|
+
# block = block0 = lambda do |parent|
|
57
|
+
# desc "DESC"
|
58
|
+
# task(:task_name) { TASK }
|
59
|
+
# end
|
60
|
+
# block = block1 = lambda { |parent| parent.namespace(:ns1, &block0) }
|
61
|
+
# block = block2 = lambda { |parent| parent.namespace(:ns2, &block1) }
|
62
|
+
# ...
|
63
|
+
# block = blockN = lambda { |parent| parent.namespace(:nsN, &blockN-1) }
|
64
|
+
#
|
51
65
|
block = namespace_names.reverse.inject(block) do |child, name|
|
52
|
-
lambda do
|
53
|
-
namespace(name, &child)
|
66
|
+
lambda do |parent|
|
67
|
+
parent.namespace(name, &child)
|
54
68
|
end
|
55
69
|
end
|
56
70
|
|
57
|
-
# create configuration task
|
58
|
-
|
71
|
+
# create namespaced configuration task
|
72
|
+
#
|
73
|
+
# block = lambda do
|
74
|
+
# namespace :nsN do
|
75
|
+
# ...
|
76
|
+
# namespace :ns2 do
|
77
|
+
# namespace :ns1 do
|
78
|
+
# desc "DESC"
|
79
|
+
# task(:task_name) { TASK }
|
80
|
+
# end
|
81
|
+
# end
|
82
|
+
# ...
|
83
|
+
# end
|
84
|
+
# end
|
85
|
+
block.call(top)
|
59
86
|
end
|
60
87
|
|
61
88
|
# set configuration names list
|
metadata
CHANGED
@@ -1,52 +1,38 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-multiconfig
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 1
|
10
|
-
version: 0.0.1
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Andriy Yanko
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-12-26 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: capistrano
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &10692900 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 17
|
29
|
-
segments:
|
30
|
-
- 2
|
31
|
-
- 5
|
32
|
-
- 5
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
33
21
|
version: 2.5.5
|
34
22
|
type: :runtime
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *10692900
|
25
|
+
description: ! "\nMulticonfig extension is similar to [multistage](https://github.com/capistrano/capistrano-ext)
|
26
|
+
extenstion.\nBut it's not only about 'stage' configurations. It's about any configuration
|
27
|
+
that you may need.\nExtension recursively builds configuration list from configuration
|
28
|
+
root directory.\nEach configuration loads recursively configuration from namespace
|
29
|
+
files and own configuration file.\n "
|
30
|
+
email:
|
42
31
|
- andriy.yanko@gmail.com
|
43
32
|
executables: []
|
44
|
-
|
45
33
|
extensions: []
|
46
|
-
|
47
34
|
extra_rdoc_files: []
|
48
|
-
|
49
|
-
files:
|
35
|
+
files:
|
50
36
|
- .gitignore
|
51
37
|
- Gemfile
|
52
38
|
- README.md
|
@@ -57,36 +43,27 @@ files:
|
|
57
43
|
- lib/capistrano/multiconfig/ensure.rb
|
58
44
|
homepage: https://github.com/railsware/multiconfig
|
59
45
|
licenses: []
|
60
|
-
|
61
46
|
post_install_message:
|
62
47
|
rdoc_options: []
|
63
|
-
|
64
|
-
require_paths:
|
48
|
+
require_paths:
|
65
49
|
- lib
|
66
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
51
|
none: false
|
68
|
-
requirements:
|
69
|
-
- -
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
|
72
|
-
|
73
|
-
- 0
|
74
|
-
version: "0"
|
75
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
57
|
none: false
|
77
|
-
requirements:
|
78
|
-
- -
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
|
81
|
-
segments:
|
82
|
-
- 0
|
83
|
-
version: "0"
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
84
62
|
requirements: []
|
85
|
-
|
86
63
|
rubyforge_project: capistrano-multiconfig
|
87
|
-
rubygems_version: 1.8.
|
64
|
+
rubygems_version: 1.8.10
|
88
65
|
signing_key:
|
89
66
|
specification_version: 3
|
90
67
|
summary: Capistrano extension that allows to use multiple configurations
|
91
68
|
test_files: []
|
92
|
-
|
69
|
+
has_rdoc:
|