dnapi 1.1.79.ruby19.p1 → 1.1.81.passenger

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'
@@ -57,7 +57,7 @@ module DNApi
57
57
  belongs_to Environment
58
58
 
59
59
  VERSION = '1.8.6'.freeze
60
- PATCH_LEVEL = '420'.freeze
60
+ PATCH_LEVEL = '420-r2'.freeze
61
61
  RUBYGEMS_VERSION = '1.4.2'.freeze
62
62
  end
63
63
 
@@ -71,7 +71,7 @@ module DNApi
71
71
  belongs_to Environment
72
72
 
73
73
  VERSION = '1.8.7'.freeze
74
- PATCH_LEVEL = '352'.freeze
74
+ PATCH_LEVEL = '357'.freeze
75
75
  end
76
76
 
77
77
  class REE < RubyVersion
@@ -85,7 +85,7 @@ module DNApi
85
85
 
86
86
  NAME = 'REE'.freeze
87
87
  VERSION = '1.8.7'.freeze
88
- PATCH_LEVEL = '2011.03'.freeze
88
+ PATCH_LEVEL = '2011.12'.freeze
89
89
 
90
90
  def self.label
91
91
  "#{self::NAME} #{self::PATCH_LEVEL}"
@@ -153,7 +153,7 @@ module DNApi
153
153
 
154
154
  class JRuby < RubyVersion
155
155
  NAME = 'JRuby'.freeze
156
- VERSION = '1.6.5'.freeze
156
+ VERSION = '1.6.5.1'.freeze
157
157
  PATCH_LEVEL = nil
158
158
  RUBYGEMS_VERSION = '1.5.1'.freeze
159
159
 
@@ -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
 
@@ -219,7 +219,7 @@ module DNApi
219
219
  end
220
220
 
221
221
  def to_legacy_hash
222
- shared = %w(run_list alert_email aws_secret_key aws_secret_id
222
+ shared = %w( alert_email aws_secret_key aws_secret_id
223
223
  backup_interval backup_window
224
224
  admin_ssh_key mailserver
225
225
  internal_ssh_public_key
@@ -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
@@ -3,7 +3,7 @@ module DNApi
3
3
  Monit = new(:name => 'monit')
4
4
  Memcached = new(:name => 'memcached')
5
5
  Nginx = new(:name => 'nginx')
6
- NginxPassenger = new(:name => 'nginx-passenger')
6
+ NginxPassenger = new(:name => 'passenger::nginx')
7
7
  Passenger = new(:name => 'passenger')
8
8
  ApachePassenger = new(:name => 'passenger::apache')
9
9
  Mongrel = new(:name => 'mongrel')
data/lib/dnapi/stack.rb CHANGED
@@ -25,7 +25,7 @@ module DNApi
25
25
  DNApi::Components::JRuby192,
26
26
  DNApi::Components::Rubinius,
27
27
  DNApi::Components::Rubinius19]),
28
- :recipes => [Recipe::Nginx, Recipe::NginxPassenger])
28
+ :recipes => [Recipe::Nginx, Recipe::Passenger])
29
29
 
30
30
  NginxPassenger3 = new(:name => 'nginx_passenger3',
31
31
  :label => 'Passenger 3',
@@ -34,7 +34,7 @@ module DNApi
34
34
  :ruby_versions => (DNApi::Components::RubyVersion.all - [DNApi::Components::JRuby187,
35
35
  DNApi::Components::JRuby192,
36
36
  DNApi::Components::Ruby186]),
37
- :recipes => [Recipe::Nginx, Recipe::NginxPassenger])
37
+ :recipes => [Recipe::Nginx, Recipe::Passenger3])
38
38
 
39
39
  #FIXME: Remove
40
40
  ApachePassenger = new(:name => 'apache_passenger',
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.79.ruby19.p1'
2
+ VERSION = '1.1.81.passenger'
3
3
  end
@@ -27,7 +27,7 @@ describe DNApi::Components::Ruby186 do
27
27
 
28
28
  describe "#patch_level" do
29
29
  it 'is 420' do
30
- @ruby.patch_level.should == '420'
30
+ @ruby.patch_level.should == '420-r2'
31
31
  end
32
32
  end
33
33
 
@@ -64,8 +64,8 @@ describe DNApi::Components::Ruby187 do
64
64
  end
65
65
 
66
66
  describe "#patch_level" do
67
- it 'is 352' do
68
- @ruby.patch_level.should == '352'
67
+ it 'is 357' do
68
+ @ruby.patch_level.should == '357'
69
69
  end
70
70
  end
71
71
 
@@ -84,8 +84,8 @@ describe DNApi::Components::REE do
84
84
 
85
85
  describe "#label" do
86
86
  it "should have the right label" do
87
- described_class.label.should == 'REE 2011.03'
88
- @ruby.label.should == 'REE 2011.03'
87
+ described_class.label.should == 'REE 2011.12'
88
+ @ruby.label.should == 'REE 2011.12'
89
89
  end
90
90
  end
91
91
 
@@ -103,7 +103,7 @@ describe DNApi::Components::REE do
103
103
 
104
104
  describe "#patch_level" do
105
105
  it 'is 2011.03' do
106
- @ruby.patch_level.should == '2011.03'
106
+ @ruby.patch_level.should == '2011.12'
107
107
  end
108
108
  end
109
109
 
@@ -281,8 +281,8 @@ describe 'JRuby' do
281
281
 
282
282
  describe "#label" do
283
283
  it "should have the right label" do
284
- described_class.label.should == "JRuby 1.6.5 #{jruby.compat_version}"
285
- @ruby.label.should == "JRuby 1.6.5 #{jruby.compat_version}"
284
+ described_class.label.should == "JRuby 1.6.5.1 #{jruby.compat_version}"
285
+ @ruby.label.should == "JRuby 1.6.5.1 #{jruby.compat_version}"
286
286
  end
287
287
  end
288
288
 
@@ -293,8 +293,8 @@ describe 'JRuby' do
293
293
  end
294
294
 
295
295
  describe "#version" do
296
- it 'is 1.6.5' do
297
- @ruby.version.should == '1.6.5'
296
+ it 'is 1.6.5.1' do
297
+ @ruby.version.should == '1.6.5.1'
298
298
  end
299
299
  end
300
300
 
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
@@ -75,7 +75,6 @@ describe DNApi::Stack do
75
75
  end
76
76
 
77
77
  context "responds to legacy helper methods" do
78
- subject { DNApi::Stack.all.first }
79
78
  it { should respond_to(:apache?)}
80
79
  it { should respond_to(:nginx?)}
81
80
  it { should respond_to(:passenger?)}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dnapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.79.ruby19.p1
4
+ version: 1.1.81.passenger
5
5
  prerelease: 7
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-07-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
- requirement: &2157286640 !ruby/object:Gem::Requirement
16
+ requirement: &2154918340 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2157286640
24
+ version_requirements: *2154918340
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: extlib
27
- requirement: &2157300900 !ruby/object:Gem::Requirement
27
+ requirement: &2154917860 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2157300900
35
+ version_requirements: *2154917860
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sexp_processor
38
- requirement: &2157299640 !ruby/object:Gem::Requirement
38
+ requirement: &2154917380 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,18 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2157299640
47
- - !ruby/object:Gem::Dependency
48
- name: jexp
49
- requirement: &2157298060 !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: 0.1.1
55
- type: :runtime
56
- prerelease: false
57
- version_requirements: *2157298060
46
+ version_requirements: *2154917380
58
47
  description: API for chef DNA.
59
48
  email:
60
49
  - gems@engineyard.com
@@ -85,6 +74,7 @@ files:
85
74
  - lib/dnapi/db_stack.rb
86
75
  - lib/dnapi/ebuild_dep.rb
87
76
  - lib/dnapi/environment.rb
77
+ - lib/dnapi/extensions.rb
88
78
  - lib/dnapi/gem_dep.rb
89
79
  - lib/dnapi/instance.rb
90
80
  - lib/dnapi/monitoring.rb