dnapi 1.1.79.ruby19.p1 → 1.1.81.php
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dnapi.rb +1 -1
- data/lib/dnapi/components/php.rb +26 -0
- data/lib/dnapi/components/ruby.rb +4 -4
- data/lib/dnapi/environment.rb +4 -3
- data/lib/dnapi/extensions.rb +32 -0
- data/lib/dnapi/recipe.rb +2 -1
- data/lib/dnapi/stack.rb +7 -1
- data/lib/dnapi/struct.rb +1 -4
- data/lib/dnapi/test.rb +1 -1
- data/lib/dnapi/version.rb +1 -1
- data/spec/components/ruby_spec.rb +10 -10
- data/spec/proxies_spec.rb +1 -1
- data/spec/stack_spec.rb +0 -1
- metadata +10 -20
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'
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module DNApi
|
2
|
+
module Components
|
3
|
+
class PHP < VersionedComponent.new(:key)
|
4
|
+
include Component
|
5
|
+
desc "Hypertext Preprocessor scripting language"
|
6
|
+
key :php
|
7
|
+
belongs_to Environment
|
8
|
+
|
9
|
+
NAME = 'PHP'.freeze
|
10
|
+
VERSION = '5.2'.freeze
|
11
|
+
PATCH_LEVEL = '8'.freeze
|
12
|
+
|
13
|
+
def self.label
|
14
|
+
"#{NAME} - #{version}"
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.version
|
18
|
+
"#{VERSION}.#{PATCH_LEVEL}"
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.package
|
22
|
+
'dev-lang/php'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -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 = '
|
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.
|
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
|
|
data/lib/dnapi/environment.rb
CHANGED
@@ -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
|
13
|
+
:monitoring, :region, :backup_bucket)
|
14
14
|
|
15
15
|
include ComponentPossessor
|
16
16
|
|
@@ -41,7 +41,8 @@ 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) || component(:rubinius19)
|
44
|
+
component(:nodejs) || component(:rubinius19) ||
|
45
|
+
component(:php)
|
45
46
|
end
|
46
47
|
|
47
48
|
def stack
|
@@ -219,7 +220,7 @@ module DNApi
|
|
219
220
|
end
|
220
221
|
|
221
222
|
def to_legacy_hash
|
222
|
-
shared = %w(
|
223
|
+
shared = %w( alert_email aws_secret_key aws_secret_id
|
223
224
|
backup_interval backup_window
|
224
225
|
admin_ssh_key mailserver
|
225
226
|
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
@@ -15,6 +15,7 @@ module DNApi
|
|
15
15
|
Trinidad = new(:name => 'trinidad')
|
16
16
|
Thin = new(:name => 'thin')
|
17
17
|
Puma = new(:name => 'puma')
|
18
|
+
PHP = new(:name => 'php')
|
18
19
|
|
19
20
|
def self.defaults
|
20
21
|
[Memcached, Monit]
|
@@ -23,7 +24,7 @@ module DNApi
|
|
23
24
|
def self.all
|
24
25
|
[Monit, Memcached, Nginx, NginxPassenger, ApachePassenger,
|
25
26
|
Mongrel, Unicorn, Mysql51, Mysql55, Nginxtcp, Node,
|
26
|
-
Trinidad,Thin,Puma]
|
27
|
+
Trinidad, Thin, Puma, PHP]
|
27
28
|
end
|
28
29
|
end
|
29
30
|
end
|
data/lib/dnapi/stack.rb
CHANGED
@@ -81,9 +81,15 @@ module DNApi
|
|
81
81
|
:ruby_versions => DNApi::Components::RubyVersion.all,
|
82
82
|
:recipes => [Recipe::Nginx, Recipe::Puma])
|
83
83
|
|
84
|
+
NginxPHP = new(:name => 'php_fcgi',
|
85
|
+
:label => 'PHP + FastCGI',
|
86
|
+
:web_server => :nginx,
|
87
|
+
:rack_server => :fastcgi,
|
88
|
+
:ruby_versions => DNApi::Components::PHP,
|
89
|
+
:recipes => [Recipe::Nginx, Recipe::PHP])
|
84
90
|
|
85
91
|
def self.all
|
86
|
-
[NginxMongrel, NginxPassenger, NginxPassenger3, ApachePassenger, NginxUnicorn, Trinidad, Nginxtcp,NginxThin,NginxPuma]
|
92
|
+
[NginxMongrel, NginxPassenger, NginxPassenger3, ApachePassenger, NginxUnicorn, Trinidad, Nginxtcp, NginxThin, NginxPuma, NginxPHP]
|
87
93
|
end
|
88
94
|
|
89
95
|
def self.get(name)
|
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
|
-
|
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
data/lib/dnapi/version.rb
CHANGED
@@ -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
|
68
|
-
@ruby.patch_level.should == '
|
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.
|
88
|
-
@ruby.label.should == 'REE 2011.
|
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.
|
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
data/spec/stack_spec.rb
CHANGED
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.
|
4
|
+
version: 1.1.81.php
|
5
5
|
prerelease: 7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-07-26 00:00:00.
|
12
|
+
date: 2011-07-26 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
16
|
-
requirement: &
|
16
|
+
requirement: &70243759137500 !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: *
|
24
|
+
version_requirements: *70243759137500
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: extlib
|
27
|
-
requirement: &
|
27
|
+
requirement: &70243759136880 !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: *
|
35
|
+
version_requirements: *70243759136880
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: sexp_processor
|
38
|
-
requirement: &
|
38
|
+
requirement: &70243759136340 !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: *
|
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: *70243759136340
|
58
47
|
description: API for chef DNA.
|
59
48
|
email:
|
60
49
|
- gems@engineyard.com
|
@@ -75,6 +64,7 @@ files:
|
|
75
64
|
- lib/dnapi/components/newrelic.rb
|
76
65
|
- lib/dnapi/components/nodejs.rb
|
77
66
|
- lib/dnapi/components/passenger3.rb
|
67
|
+
- lib/dnapi/components/php.rb
|
78
68
|
- lib/dnapi/components/ruby.rb
|
79
69
|
- lib/dnapi/components/ssmtp.rb
|
80
70
|
- lib/dnapi/components/stunneled.rb
|
@@ -85,6 +75,7 @@ files:
|
|
85
75
|
- lib/dnapi/db_stack.rb
|
86
76
|
- lib/dnapi/ebuild_dep.rb
|
87
77
|
- lib/dnapi/environment.rb
|
78
|
+
- lib/dnapi/extensions.rb
|
88
79
|
- lib/dnapi/gem_dep.rb
|
89
80
|
- lib/dnapi/instance.rb
|
90
81
|
- lib/dnapi/monitoring.rb
|
@@ -159,4 +150,3 @@ test_files:
|
|
159
150
|
- spec/spec_helper.rb
|
160
151
|
- spec/stack_spec.rb
|
161
152
|
- spec/struct_spec.rb
|
162
|
-
has_rdoc:
|