dnapi 1.1.82.ruby19 → 1.1.83.php

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'
@@ -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.3'.freeze
11
+ PATCH_LEVEL = '9'.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
@@ -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
@@ -96,7 +97,11 @@ module DNApi
96
97
  end
97
98
 
98
99
  def db_host
99
- host = (db_master || solo) and host.public_hostname
100
+ if db_master
101
+ db_master.public_hostname
102
+ else
103
+ solo.public_hostname
104
+ end
100
105
  end
101
106
 
102
107
  def solo?
@@ -136,7 +141,7 @@ module DNApi
136
141
  end
137
142
 
138
143
  def environment_hash
139
- {:name => name, :framework_env => framework_env, :stack => (stack and stack.name)}
144
+ {:name => name, :framework_env => framework_env, :stack => stack.name}
140
145
  end
141
146
 
142
147
  def haproxy_hash
@@ -215,7 +220,7 @@ module DNApi
215
220
  end
216
221
 
217
222
  def to_legacy_hash
218
- shared = %w(alert_email aws_secret_key aws_secret_id
223
+ shared = %w( alert_email aws_secret_key aws_secret_id
219
224
  backup_interval backup_window
220
225
  admin_ssh_key mailserver
221
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
@@ -16,6 +16,7 @@ module DNApi
16
16
  Trinidad = new(:name => 'trinidad')
17
17
  Thin = new(:name => 'thin')
18
18
  Puma = new(:name => 'puma')
19
+ PHP = new(:name => 'php')
19
20
 
20
21
  def self.defaults
21
22
  [Memcached, Monit]
@@ -24,7 +25,7 @@ module DNApi
24
25
  def self.all
25
26
  [Monit, Memcached, Nginx, NginxPassenger, ApachePassenger,
26
27
  Mongrel, Unicorn, Mysql51, Mysql55, Nginxtcp, Node,
27
- Trinidad,Thin,Puma]
28
+ Trinidad, Thin, Puma, PHP]
28
29
  end
29
30
  end
30
31
  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 => 'nginx_fpm',
85
+ :label => 'PHP-FPM',
86
+ :web_server => :nginx,
87
+ :rack_server => :fpm,
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
- 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.82.ruby19'
2
+ VERSION = '1.1.83.php'
3
3
  end
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,67 +1,76 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: dnapi
3
- version: !ruby/object:Gem::Version
4
- version: 1.1.82.ruby19
5
- prerelease: 7
3
+ version: !ruby/object:Gem::Version
4
+ hash: 961239185
5
+ prerelease: true
6
+ segments:
7
+ - 1
8
+ - 1
9
+ - 83
10
+ - php
11
+ version: 1.1.83.php
6
12
  platform: ruby
7
- authors:
13
+ authors:
8
14
  - Engine Yard
9
15
  autorequire:
10
16
  bindir: bin
11
17
  cert_chain: []
12
- date: 2011-07-26 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
18
+
19
+ date: 2011-07-26 00:00:00 -07:00
20
+ default_executable:
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
15
23
  name: json
16
- requirement: &2165535080 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
23
24
  prerelease: false
24
- version_requirements: *2165535080
25
- - !ruby/object:Gem::Dependency
26
- name: extlib
27
- requirement: &2165534600 !ruby/object:Gem::Requirement
25
+ requirement: &id001 !ruby/object:Gem::Requirement
28
26
  none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ hash: 3
31
+ segments:
32
+ - 0
33
+ version: "0"
33
34
  type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: extlib
34
38
  prerelease: false
35
- version_requirements: *2165534600
36
- - !ruby/object:Gem::Dependency
37
- name: sexp_processor
38
- requirement: &2165534120 !ruby/object:Gem::Requirement
39
+ requirement: &id002 !ruby/object:Gem::Requirement
39
40
  none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
43
- version: '0'
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 3
45
+ segments:
46
+ - 0
47
+ version: "0"
44
48
  type: :runtime
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: sexp_processor
45
52
  prerelease: false
46
- version_requirements: *2165534120
47
- - !ruby/object:Gem::Dependency
48
- name: jexp
49
- requirement: &2165533640 !ruby/object:Gem::Requirement
53
+ requirement: &id003 !ruby/object:Gem::Requirement
50
54
  none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: 0.1.1
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ hash: 3
59
+ segments:
60
+ - 0
61
+ version: "0"
55
62
  type: :runtime
56
- prerelease: false
57
- version_requirements: *2165533640
63
+ version_requirements: *id003
58
64
  description: API for chef DNA.
59
- email:
65
+ email:
60
66
  - gems@engineyard.com
61
67
  executables: []
68
+
62
69
  extensions: []
70
+
63
71
  extra_rdoc_files: []
64
- files:
72
+
73
+ files:
65
74
  - lib/dnapi/app.rb
66
75
  - lib/dnapi/component.rb
67
76
  - lib/dnapi/component_possessor.rb
@@ -75,6 +84,7 @@ files:
75
84
  - lib/dnapi/components/newrelic.rb
76
85
  - lib/dnapi/components/nodejs.rb
77
86
  - lib/dnapi/components/passenger3.rb
87
+ - lib/dnapi/components/php.rb
78
88
  - lib/dnapi/components/ruby.rb
79
89
  - lib/dnapi/components/ssmtp.rb
80
90
  - lib/dnapi/components/stunneled.rb
@@ -85,6 +95,7 @@ files:
85
95
  - lib/dnapi/db_stack.rb
86
96
  - lib/dnapi/ebuild_dep.rb
87
97
  - lib/dnapi/environment.rb
98
+ - lib/dnapi/extensions.rb
88
99
  - lib/dnapi/gem_dep.rb
89
100
  - lib/dnapi/instance.rb
90
101
  - lib/dnapi/monitoring.rb
@@ -116,31 +127,43 @@ files:
116
127
  - spec/spec_helper.rb
117
128
  - spec/stack_spec.rb
118
129
  - spec/struct_spec.rb
130
+ has_rdoc: true
119
131
  homepage: http://github.com/engineyard/dnapi
120
132
  licenses: []
133
+
121
134
  post_install_message:
122
135
  rdoc_options: []
123
- require_paths:
136
+
137
+ require_paths:
124
138
  - lib
125
- required_ruby_version: !ruby/object:Gem::Requirement
139
+ required_ruby_version: !ruby/object:Gem::Requirement
126
140
  none: false
127
- requirements:
128
- - - ! '>='
129
- - !ruby/object:Gem::Version
130
- version: '0'
131
- required_rubygems_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ hash: 3
145
+ segments:
146
+ - 0
147
+ version: "0"
148
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
149
  none: false
133
- requirements:
134
- - - ! '>'
135
- - !ruby/object:Gem::Version
150
+ requirements:
151
+ - - ">"
152
+ - !ruby/object:Gem::Version
153
+ hash: 25
154
+ segments:
155
+ - 1
156
+ - 3
157
+ - 1
136
158
  version: 1.3.1
137
159
  requirements: []
160
+
138
161
  rubyforge_project:
139
- rubygems_version: 1.8.10
162
+ rubygems_version: 1.3.7
140
163
  signing_key:
141
164
  specification_version: 3
142
165
  summary: API for chef DNA.
143
- test_files:
166
+ test_files:
144
167
  - spec/app_spec.rb
145
168
  - spec/component_spec.rb
146
169
  - spec/components/addons_spec.rb
@@ -159,4 +182,3 @@ test_files:
159
182
  - spec/spec_helper.rb
160
183
  - spec/stack_spec.rb
161
184
  - spec/struct_spec.rb
162
- has_rdoc: