rna 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/rna/dsl.rb CHANGED
@@ -144,6 +144,15 @@ module Rna
144
144
  def name
145
145
  @role
146
146
  end
147
+
148
+ def role_list(list)
149
+ list = list.collect {|i| "role[#{i}]"}
150
+ set('run_list', list)
151
+ end
152
+
153
+ def run_list(list)
154
+ set('run_list', list)
155
+ end
147
156
  end
148
157
 
149
158
  class Global < Builder
data/lib/rna/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rna
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
data/spec/lib/rna_spec.rb CHANGED
@@ -48,7 +48,7 @@ describe Rna do
48
48
  @dsl.run
49
49
  json = JSON.load(IO.read("#{@project_root}/output/prod-api-redis.json"))
50
50
  json['role'].should == 'prod-api-redis'
51
- json['run_list'].should == ["role[base]"]
51
+ json['run_list'].should == ["role[base]", "role[api_redis]"]
52
52
  json['framework_env'].should == 'production'
53
53
  json['deploy_code'].should == false
54
54
  end
@@ -57,7 +57,7 @@ describe Rna do
57
57
  @dsl.run
58
58
  json = JSON.load(IO.read("#{@project_root}/output/stag-api-redis.json"))
59
59
  json['role'].should == 'stag-api-redis'
60
- json['run_list'].should == ["role[base]"]
60
+ json['run_list'].should == ["role[base]", "role[api_redis]"]
61
61
  json['deploy_code'].should == false
62
62
  json['framework_env'].should == 'staging' # this is tests the rule
63
63
  end
@@ -58,4 +58,11 @@ post_rule do
58
58
  set 'post_rule', 2
59
59
  set 'framework_env', 'production' if role =~ /^prod/
60
60
  set 'framework_env', 'staging' if role =~ /^stag/
61
+
62
+ list = role.split('-')
63
+ if list.size == 3
64
+ env, repo, role = list
65
+ role_list ['base', "#{repo}_#{role}"]
66
+ set 'application', repo
67
+ end
61
68
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rna
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -205,7 +205,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
205
205
  version: '0'
206
206
  segments:
207
207
  - 0
208
- hash: 4553005362745989703
208
+ hash: -1648500370233161792
209
209
  required_rubygems_version: !ruby/object:Gem::Requirement
210
210
  none: false
211
211
  requirements:
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  version: '0'
215
215
  segments:
216
216
  - 0
217
- hash: 4553005362745989703
217
+ hash: -1648500370233161792
218
218
  requirements: []
219
219
  rubyforge_project:
220
220
  rubygems_version: 1.8.24