dnapi 1.1.75.ruby193.b → 1.1.78

Sign up to get free protection for your applications and to get access to all the features.
data/lib/dnapi.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require 'forwardable'
2
2
  require 'extlib'
3
3
  require 'json'
4
- require 'jexp'
5
4
 
6
5
  module DNApi
7
6
  def self.build(attributes = {})
@@ -33,6 +32,7 @@ module DNApi
33
32
  end
34
33
 
35
34
  require 'dnapi/component'
35
+ require 'dnapi/extensions'
36
36
  require 'dnapi/struct'
37
37
  require 'dnapi/component_possessor'
38
38
  require 'dnapi/recipe'
@@ -8,12 +8,13 @@ module DNApi
8
8
  DNApi::Components::JRuby187,
9
9
  DNApi::Components::JRuby192,
10
10
  DNApi::Components::Rubinius,
11
+ DNApi::Components::Rubinius19,
11
12
  DNApi::Components::Ruby193,
12
13
  DNApi::Components::Ruby192 ]
13
14
  end
14
15
 
15
16
  def self.encoding_aware
16
- [DNApi::Components::Ruby192, DNApi::Components::Ruby193, DNApi::Components::Rubinius]
17
+ [DNApi::Components::Ruby192, DNApi::Components::Ruby193, DNApi::Components::Rubinius, DNApi::Components::Rubinius19]
17
18
  end
18
19
 
19
20
  NAME = 'Ruby'.freeze
@@ -211,9 +212,14 @@ module DNApi
211
212
  belongs_to Environment
212
213
 
213
214
  NAME = 'Rubinius'.freeze
214
- VERSION = '1.2.4'.freeze
215
+ VERSION = '2.0.0-r2'.freeze
216
+ VM_VERSION = '1.8'.freeze
215
217
  PATCH_LEVEL = nil
216
218
 
219
+ def self.label
220
+ "#{self::NAME} 2.0 (ruby-1.8.7-p352)"
221
+ end
222
+
217
223
  def ruby_version
218
224
  version
219
225
  end
@@ -223,7 +229,46 @@ module DNApi
223
229
  end
224
230
 
225
231
  def ruby_module
226
- 'rubyrbx12'
232
+ 'rubyrbx-2.0'
233
+ end
234
+
235
+ def mysql_adapter
236
+ 'mysql2'
237
+ end
238
+ end
239
+
240
+ class Rubinius19 < RubyVersion
241
+ include Component
242
+
243
+ desc "A Ruby runtime written mostly in Ruby"
244
+
245
+ key :rubinius19
246
+
247
+ belongs_to Environment
248
+
249
+ NAME = 'Rubinius'.freeze
250
+ VERSION = '2.0.0'.freeze
251
+ VM_VERSION = '1.9'.freeze
252
+ PATCH_LEVEL = nil
253
+
254
+ def self.label
255
+ "#{self::NAME} 2.0 (ruby-1.9.2-p136)"
256
+ end
257
+
258
+ def self.compat_version
259
+ '(ruby-1.9.2)'
260
+ end
261
+
262
+ def ruby_version
263
+ version
264
+ end
265
+
266
+ def ruby_flavor
267
+ 'dev-lang/rubinius19'
268
+ end
269
+
270
+ def ruby_module
271
+ 'rubyrbx-2.0'
227
272
  end
228
273
 
229
274
  def mysql_adapter
@@ -16,7 +16,7 @@ module DNApi
16
16
  )
17
17
  Mysql5_5 = new(
18
18
  :name => 'mysql5_5',
19
- :label => 'MySQL 5.5.x',
19
+ :label => 'MySQL 5.5.x (Beta)',
20
20
  :supports_replication => true,
21
21
  :backup_command => 'eybackup -e mysql --quiet',
22
22
  :adapter => 'mysql'
@@ -39,10 +39,10 @@ module DNApi
39
39
 
40
40
  Postgres91 = new(
41
41
  :name => 'postgres9_1',
42
- :label => 'PostgreSQL 9.1.x',
42
+ :label => 'PostgreSQL 9.1.x (Beta)',
43
43
  :supports_replication => true,
44
44
  :backup_command => 'eybackup -e postgresql --quiet',
45
- :adapter => 'postgersql'
45
+ :adapter => 'postgresql'
46
46
  )
47
47
 
48
48
  def self.all
@@ -10,7 +10,7 @@ module DNApi
10
10
  :stack_name, :name, :framework_env,
11
11
  :stats_password, :ssh_username, :ssh_password,
12
12
  :ssh_keys, :db_stack_name,
13
- :monitoring, :region, :backup_bucket, :run_list)
13
+ :monitoring, :region, :backup_bucket)
14
14
 
15
15
  include ComponentPossessor
16
16
 
@@ -41,7 +41,7 @@ module DNApi
41
41
  component(:ree) || component(:ruby_192) ||
42
42
  component(:jruby_187) || component(:jruby_192) ||
43
43
  component(:rubinius) || component(:ruby_193) ||
44
- component(:nodejs)
44
+ component(:nodejs) || component(:rubinius19)
45
45
  end
46
46
 
47
47
  def stack
@@ -0,0 +1,32 @@
1
+ class Array
2
+ def to_jexp
3
+ map {|v| JSON.jexp(v) }
4
+ end
5
+ end
6
+
7
+ class Hash
8
+ def to_jexp
9
+ inject(self::class.new) do |h, (key, value)|
10
+ h.update key.to_s => JSON.jexp(value)
11
+ end
12
+ end
13
+ end
14
+
15
+ class Integer
16
+ def to_jexp() self end
17
+ end
18
+
19
+ module JSON
20
+ def self.jexp(*a)
21
+ if a.size == 1 && RUBY_VERSION >= "1.9.0"
22
+ o = a.first
23
+ o.respond_to?(:to_jexp) ? o.to_jexp : JSON.parse(JSON.dump([o])).first
24
+ else
25
+ return *a.map{|o| o.respond_to?(:to_jexp) ? o.to_jexp : JSON.parse(JSON.dump([o])).first}
26
+ end
27
+ end
28
+ end
29
+
30
+ class String
31
+ def to_jexp() self end
32
+ end
data/lib/dnapi/recipe.rb CHANGED
@@ -14,6 +14,7 @@ module DNApi
14
14
  Node = new(:name => 'node::component')
15
15
  Trinidad = new(:name => 'trinidad')
16
16
  Thin = new(:name => 'thin')
17
+ Puma = new(:name => 'puma')
17
18
 
18
19
  def self.defaults
19
20
  [Memcached, Monit]
@@ -21,7 +22,8 @@ module DNApi
21
22
 
22
23
  def self.all
23
24
  [Monit, Memcached, Nginx, NginxPassenger, ApachePassenger,
24
- Mongrel, Unicorn, Mysql51, Mysql55, Nginxtcp, Node, Trinidad,Thin]
25
+ Mongrel, Unicorn, Mysql51, Mysql55, Nginxtcp, Node,
26
+ Trinidad,Thin,Puma]
25
27
  end
26
28
  end
27
29
  end
data/lib/dnapi/stack.rb CHANGED
@@ -13,7 +13,8 @@ module DNApi
13
13
  DNApi::Components::Ruby192,
14
14
  DNApi::Components::JRuby187,
15
15
  DNApi::Components::JRuby192,
16
- DNApi::Components::Rubinius]),
16
+ DNApi::Components::Rubinius,
17
+ DNApi::Components::Rubinius19]),
17
18
  :recipes => [Recipe::Nginx, Recipe::Mongrel])
18
19
 
19
20
  NginxPassenger = new(:name => 'nginx_passenger',
@@ -22,7 +23,8 @@ module DNApi
22
23
  :rack_server => :passenger,
23
24
  :ruby_versions => (DNApi::Components::RubyVersion.all - [DNApi::Components::JRuby187,
24
25
  DNApi::Components::JRuby192,
25
- DNApi::Components::Rubinius]),
26
+ DNApi::Components::Rubinius,
27
+ DNApi::Components::Rubinius19]),
26
28
  :recipes => [Recipe::Nginx, Recipe::NginxPassenger])
27
29
 
28
30
  NginxPassenger3 = new(:name => 'nginx_passenger3',
@@ -47,8 +49,7 @@ module DNApi
47
49
  :web_server => :nginx,
48
50
  :rack_server => :unicorn,
49
51
  :ruby_versions => (DNApi::Components::RubyVersion.all - [DNApi::Components::JRuby187,
50
- DNApi::Components::JRuby192,
51
- DNApi::Components::Rubinius]),
52
+ DNApi::Components::JRuby192]),
52
53
  :recipes => [Recipe::Nginx, Recipe::Unicorn])
53
54
 
54
55
  Trinidad = new(:name => 'trinidad',
@@ -70,12 +71,19 @@ module DNApi
70
71
  :web_server => :nginx,
71
72
  :rack_server => :thin,
72
73
  :ruby_versions => (DNApi::Components::RubyVersion.all - [DNApi::Components::JRuby187,
73
- DNApi::Components::JRuby192,
74
- DNApi::Components::Rubinius]),
74
+ DNApi::Components::JRuby192]),
75
75
  :recipes => [Recipe::Nginx, Recipe::Thin])
76
76
 
77
+ NginxPuma = new(:name => 'puma',
78
+ :label => 'Puma',
79
+ :web_server => :nginx,
80
+ :rack_server => :puma,
81
+ :ruby_versions => DNApi::Components::RubyVersion.all,
82
+ :recipes => [Recipe::Nginx, Recipe::Puma])
83
+
84
+
77
85
  def self.all
78
- [NginxMongrel, NginxPassenger, NginxPassenger3, ApachePassenger, NginxUnicorn, Trinidad, Nginxtcp,NginxThin]
86
+ [NginxMongrel, NginxPassenger, NginxPassenger3, ApachePassenger, NginxUnicorn, Trinidad, Nginxtcp,NginxThin,NginxPuma]
79
87
  end
80
88
 
81
89
  def self.get(name)
@@ -102,7 +110,7 @@ module DNApi
102
110
  end
103
111
  end
104
112
 
105
- [:passenger, :mongrel, :unicorn, :trinidad, :thin].each do |as|
113
+ [:passenger, :mongrel, :unicorn, :trinidad, :thin, :puma].each do |as|
106
114
  define_method :"#{as}?" do
107
115
  self.rack_server == as
108
116
  end
data/lib/dnapi/struct.rb CHANGED
@@ -129,10 +129,7 @@ module DNApi
129
129
  def to_hash
130
130
  data = members.zip(values)
131
131
  association_data = _many.zip(_many_values) + _ones.zip(_ones_values)
132
- hash = (data + association_data).inject({}) do |h,(k,v)|
133
- h.update(k => v)
134
- end #.reject {|k,v| v.nil? }
135
- hash
132
+ (data + association_data).inject({}) {|h,(k,v)| h.update(k => v) } #.reject {|k,v| v.nil? }
136
133
  end
137
134
 
138
135
  def ==(other)
data/lib/dnapi/test.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'dnapi'
2
2
 
3
- %w( randexp ).each do |dep|
3
+ %w( randexp ey_slater ).each do |dep|
4
4
  begin
5
5
  require dep
6
6
  rescue LoadError => e
data/lib/dnapi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module DNApi
2
- VERSION = '1.1.75.ruby193.b'
2
+ VERSION = '1.1.78'
3
3
  end
@@ -190,7 +190,7 @@ describe DNApi::Components::Ruby193 do
190
190
  end
191
191
 
192
192
  describe "#ruby_version" do
193
- it "is 1.9.3_rc1" do
193
+ it "is 1.9.3_p0" do
194
194
  @ruby.ruby_version.should == '1.9.3_p0'
195
195
  end
196
196
  end
@@ -204,8 +204,8 @@ describe DNApi::Components::Rubinius do
204
204
 
205
205
  describe "#label" do
206
206
  it "should have the right label" do
207
- described_class.label.should == 'Rubinius 1.2.4'
208
- @ruby.label.should == 'Rubinius 1.2.4'
207
+ described_class.label.should == 'Rubinius 2.0 (ruby-1.8.7-p352)'
208
+ @ruby.label.should == 'Rubinius 2.0 (ruby-1.8.7-p352)'
209
209
  end
210
210
  end
211
211
 
@@ -216,8 +216,45 @@ describe DNApi::Components::Rubinius do
216
216
  end
217
217
 
218
218
  describe "#version" do
219
- it 'is 1.2.3' do
220
- @ruby.version.should == '1.2.4'
219
+ it 'is 2.0' do
220
+ @ruby.version.should == '2.0.0-r2'
221
+ end
222
+ end
223
+
224
+ describe "#patch_level" do
225
+ it 'is nil' do
226
+ @ruby.patch_level.should be_nil
227
+ end
228
+ end
229
+
230
+ describe "#rubygems_version" do
231
+ it 'is 1.5.2' do
232
+ @ruby.rubygems_version.should == '1.5.2'
233
+ end
234
+ end
235
+ end
236
+ describe DNApi::Components::Rubinius19 do
237
+ before do
238
+ @environment = DNApi::Environment.new
239
+ @ruby = @environment.add_component(:rubinius19)
240
+ end
241
+
242
+ describe "#label" do
243
+ it "should have the right label" do
244
+ described_class.label.should == 'Rubinius 2.0 (ruby-1.9.2-p136)'
245
+ @ruby.label.should == 'Rubinius 2.0 (ruby-1.9.2-p136)'
246
+ end
247
+ end
248
+
249
+ describe "#name" do
250
+ it 'is Rubinius' do
251
+ @ruby.name.should == 'Rubinius'
252
+ end
253
+ end
254
+
255
+ describe "#version" do
256
+ it 'is 2.0.0' do
257
+ @ruby.version.should == '2.0.0'
221
258
  end
222
259
  end
223
260
 
@@ -276,6 +313,7 @@ describe 'JRuby' do
276
313
  end
277
314
  end
278
315
 
316
+
279
317
  describe DNApi::Components::RubyVersion do
280
318
  describe ".all" do
281
319
  it "should return all ruby versions" do
@@ -285,6 +323,7 @@ describe DNApi::Components::RubyVersion do
285
323
  DNApi::Components::JRuby187,
286
324
  DNApi::Components::JRuby192,
287
325
  DNApi::Components::Rubinius,
326
+ DNApi::Components::Rubinius19,
288
327
  DNApi::Components::Ruby192,
289
328
  DNApi::Components::Ruby193 ].each do |ruby_version|
290
329
  DNApi::Components::RubyVersion.all.should include(ruby_version)
@@ -76,10 +76,10 @@ describe "DNApi::DbStack" do
76
76
  it "has a meaningful label" do
77
77
  DNApi::DbStack::Mysql.label.should == 'MySQL 5.0.x'
78
78
  DNApi::DbStack::Mysql5_1.label.should == 'MySQL 5.1.x'
79
- DNApi::DbStack::Mysql5_5.label.should == 'MySQL 5.5.x'
79
+ DNApi::DbStack::Mysql5_5.label.should == 'MySQL 5.5.x (Beta)'
80
80
  DNApi::DbStack::Postgres.label.should == 'PostgreSQL 8.3.x'
81
81
  DNApi::DbStack::Postgres9.label.should == 'PostgreSQL 9.0.x'
82
- DNApi::DbStack::Postgres91.label.should == 'PostgreSQL 9.1.x'
82
+ DNApi::DbStack::Postgres91.label.should == 'PostgreSQL 9.1.x (Beta)'
83
83
  end
84
84
 
85
85
  context "selects the adapter for each component" do
data/spec/proxies_spec.rb CHANGED
@@ -1,4 +1,4 @@
1
- require File.expand_path('proxies', File.dirname(__FILE__))
1
+ require File.dirname(__FILE__) + '/proxies'
2
2
  require 'pp'
3
3
  require 'sexp_processor' #defines Object#deep_copy
4
4
 
data/spec/stack_spec.rb CHANGED
@@ -48,10 +48,6 @@ describe DNApi::Stack do
48
48
  end
49
49
 
50
50
  describe "NginxPassenger3" do
51
- it "is the ONLY stack that supports Rubinius" do
52
- DNApi::Stack.all.select {|stack| stack.ruby_versions.include?(DNApi::Components::Rubinius) }.should == [DNApi::Stack::NginxPassenger3]
53
- end
54
-
55
51
  it 'does not support Ruby 1.8.6' do
56
52
  DNApi::Stack::NginxPassenger3.ruby_versions.should_not include(DNApi::Components::Ruby186)
57
53
  end
@@ -76,14 +72,9 @@ describe DNApi::Stack do
76
72
  DNApi::Stack::NginxMongrel.ruby_versions.should_not include(DNApi::Components::JRuby187)
77
73
  DNApi::Stack::NginxMongrel.ruby_versions.should_not include(DNApi::Components::JRuby192)
78
74
  end
79
-
80
- it "does not support Rubinius" do
81
- DNApi::Stack::NginxUnicorn.ruby_versions.should_not include(DNApi::Components::Rubinius)
82
- end
83
75
  end
84
76
 
85
77
  context "responds to legacy helper methods" do
86
- subject { DNApi::Stack.all.first }
87
78
  it { should respond_to(:apache?)}
88
79
  it { should respond_to(:nginx?)}
89
80
  it { should respond_to(:passenger?)}
metadata CHANGED
@@ -1,67 +1,74 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: dnapi
3
- version: !ruby/object:Gem::Version
4
- version: 1.1.75.ruby193.b
5
- prerelease: 7
3
+ version: !ruby/object:Gem::Version
4
+ hash: 143
5
+ prerelease:
6
+ segments:
7
+ - 1
8
+ - 1
9
+ - 78
10
+ version: 1.1.78
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Engine Yard
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2011-07-26 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2011-07-26 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: json
16
- requirement: &2156963500 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
23
22
  prerelease: false
24
- version_requirements: *2156963500
25
- - !ruby/object:Gem::Dependency
26
- name: extlib
27
- requirement: &2156962660 !ruby/object:Gem::Requirement
23
+ requirement: &id001 !ruby/object:Gem::Requirement
28
24
  none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
33
32
  type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: extlib
34
36
  prerelease: false
35
- version_requirements: *2156962660
36
- - !ruby/object:Gem::Dependency
37
- name: sexp_processor
38
- requirement: &2156962000 !ruby/object:Gem::Requirement
37
+ requirement: &id002 !ruby/object:Gem::Requirement
39
38
  none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
43
- version: '0'
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ hash: 3
43
+ segments:
44
+ - 0
45
+ version: "0"
44
46
  type: :runtime
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: sexp_processor
45
50
  prerelease: false
46
- version_requirements: *2156962000
47
- - !ruby/object:Gem::Dependency
48
- name: jexp
49
- requirement: &2156961180 !ruby/object:Gem::Requirement
51
+ requirement: &id003 !ruby/object:Gem::Requirement
50
52
  none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: 0.1.1
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ hash: 3
57
+ segments:
58
+ - 0
59
+ version: "0"
55
60
  type: :runtime
56
- prerelease: false
57
- version_requirements: *2156961180
61
+ version_requirements: *id003
58
62
  description: API for chef DNA.
59
- email:
63
+ email:
60
64
  - gems@engineyard.com
61
65
  executables: []
66
+
62
67
  extensions: []
68
+
63
69
  extra_rdoc_files: []
64
- files:
70
+
71
+ files:
65
72
  - lib/dnapi/app.rb
66
73
  - lib/dnapi/component.rb
67
74
  - lib/dnapi/component_possessor.rb
@@ -85,6 +92,7 @@ files:
85
92
  - lib/dnapi/db_stack.rb
86
93
  - lib/dnapi/ebuild_dep.rb
87
94
  - lib/dnapi/environment.rb
95
+ - lib/dnapi/extensions.rb
88
96
  - lib/dnapi/gem_dep.rb
89
97
  - lib/dnapi/instance.rb
90
98
  - lib/dnapi/monitoring.rb
@@ -118,29 +126,40 @@ files:
118
126
  - spec/struct_spec.rb
119
127
  homepage: http://github.com/engineyard/dnapi
120
128
  licenses: []
129
+
121
130
  post_install_message:
122
131
  rdoc_options: []
123
- require_paths:
132
+
133
+ require_paths:
124
134
  - lib
125
- required_ruby_version: !ruby/object:Gem::Requirement
135
+ required_ruby_version: !ruby/object:Gem::Requirement
126
136
  none: false
127
- requirements:
128
- - - ! '>='
129
- - !ruby/object:Gem::Version
130
- version: '0'
131
- required_rubygems_version: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ hash: 3
141
+ segments:
142
+ - 0
143
+ version: "0"
144
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
145
  none: false
133
- requirements:
134
- - - ! '>'
135
- - !ruby/object:Gem::Version
146
+ requirements:
147
+ - - ">"
148
+ - !ruby/object:Gem::Version
149
+ hash: 25
150
+ segments:
151
+ - 1
152
+ - 3
153
+ - 1
136
154
  version: 1.3.1
137
155
  requirements: []
156
+
138
157
  rubyforge_project:
139
158
  rubygems_version: 1.8.10
140
159
  signing_key:
141
160
  specification_version: 3
142
161
  summary: API for chef DNA.
143
- test_files:
162
+ test_files:
144
163
  - spec/app_spec.rb
145
164
  - spec/component_spec.rb
146
165
  - spec/components/addons_spec.rb
@@ -159,4 +178,3 @@ test_files:
159
178
  - spec/spec_helper.rb
160
179
  - spec/stack_spec.rb
161
180
  - spec/struct_spec.rb
162
- has_rdoc: