dnapi 1.1.82.php → 1.1.82.ruby19

Sign up to get free protection for your applications and to get access to all the features.
data/lib/dnapi.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'forwardable'
2
2
  require 'extlib'
3
3
  require 'json'
4
+ require 'jexp'
4
5
 
5
6
  module DNApi
6
7
  def self.build(attributes = {})
@@ -32,7 +33,6 @@ module DNApi
32
33
  end
33
34
 
34
35
  require 'dnapi/component'
35
- require 'dnapi/extensions'
36
36
  require 'dnapi/struct'
37
37
  require 'dnapi/component_possessor'
38
38
  require 'dnapi/recipe'
@@ -41,8 +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) || component(:rubinius19) ||
45
- component(:php)
44
+ component(:nodejs) || component(:rubinius19)
46
45
  end
47
46
 
48
47
  def stack
@@ -97,11 +96,7 @@ module DNApi
97
96
  end
98
97
 
99
98
  def db_host
100
- if db_master
101
- db_master.public_hostname
102
- else
103
- solo.public_hostname
104
- end
99
+ host = (db_master || solo) and host.public_hostname
105
100
  end
106
101
 
107
102
  def solo?
@@ -141,7 +136,7 @@ module DNApi
141
136
  end
142
137
 
143
138
  def environment_hash
144
- {:name => name, :framework_env => framework_env, :stack => stack.name}
139
+ {:name => name, :framework_env => framework_env, :stack => (stack and stack.name)}
145
140
  end
146
141
 
147
142
  def haproxy_hash
@@ -220,7 +215,7 @@ module DNApi
220
215
  end
221
216
 
222
217
  def to_legacy_hash
223
- shared = %w( alert_email aws_secret_key aws_secret_id
218
+ shared = %w(alert_email aws_secret_key aws_secret_id
224
219
  backup_interval backup_window
225
220
  admin_ssh_key mailserver
226
221
  internal_ssh_public_key
data/lib/dnapi/recipe.rb CHANGED
@@ -3,8 +3,9 @@ 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
+ Passenger3 = new(:name => 'passenger3')
8
9
  ApachePassenger = new(:name => 'passenger::apache')
9
10
  Mongrel = new(:name => 'mongrel')
10
11
  Unicorn = new(:name => 'unicorn')
@@ -15,7 +16,6 @@ module DNApi
15
16
  Trinidad = new(:name => 'trinidad')
16
17
  Thin = new(:name => 'thin')
17
18
  Puma = new(:name => 'puma')
18
- PHP = new(:name => 'php')
19
19
 
20
20
  def self.defaults
21
21
  [Memcached, Monit]
@@ -24,7 +24,7 @@ module DNApi
24
24
  def self.all
25
25
  [Monit, Memcached, Nginx, NginxPassenger, ApachePassenger,
26
26
  Mongrel, Unicorn, Mysql51, Mysql55, Nginxtcp, Node,
27
- Trinidad, Thin, Puma, PHP]
27
+ Trinidad,Thin,Puma]
28
28
  end
29
29
  end
30
30
  end
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, Recipe::NginxPassenger])
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',
@@ -81,15 +81,9 @@ 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])
90
84
 
91
85
  def self.all
92
- [NginxMongrel, NginxPassenger, NginxPassenger3, ApachePassenger, NginxUnicorn, Trinidad, Nginxtcp, NginxThin, NginxPuma, NginxPHP]
86
+ [NginxMongrel, NginxPassenger, NginxPassenger3, ApachePassenger, NginxUnicorn, Trinidad, Nginxtcp,NginxThin,NginxPuma]
93
87
  end
94
88
 
95
89
  def self.get(name)
data/lib/dnapi/struct.rb CHANGED
@@ -129,7 +129,10 @@ 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
- (data + association_data).inject({}) {|h,(k,v)| h.update(k => v) } #.reject {|k,v| v.nil? }
132
+ hash = (data + association_data).inject({}) do |h,(k,v)|
133
+ h.update(k => v)
134
+ end #.reject {|k,v| v.nil? }
135
+ hash
133
136
  end
134
137
 
135
138
  def ==(other)
data/lib/dnapi/test.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'dnapi'
2
2
 
3
- %w( randexp ey_slater ).each do |dep|
3
+ %w( randexp ).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.php'
2
+ VERSION = '1.1.82.ruby19'
3
3
  end
data/spec/proxies_spec.rb CHANGED
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/proxies'
1
+ require File.expand_path('proxies', File.dirname(__FILE__))
2
2
  require 'pp'
3
3
  require 'sexp_processor' #defines Object#deep_copy
4
4
 
data/spec/stack_spec.rb CHANGED
@@ -38,7 +38,7 @@ describe DNApi::Stack do
38
38
 
39
39
  describe "NginxPassenger" do
40
40
  it 'has nginx & nginx-passenger for recipes' do
41
- DNApi::Stack::NginxPassenger.recipes.should == [DNApi::Recipe::Nginx, DNApi::Recipe::NginxPassenger]
41
+ DNApi::Stack::NginxPassenger.recipes.should == [DNApi::Recipe::Nginx, DNApi::Recipe::Passenger, DNApi::Recipe::NginxPassenger]
42
42
  end
43
43
 
44
44
  it 'does not support JRuby' do
@@ -53,7 +53,7 @@ describe DNApi::Stack do
53
53
  end
54
54
 
55
55
  it 'has nginx & nginx-passenger for recipes' do
56
- DNApi::Stack::NginxPassenger.recipes.should == [DNApi::Recipe::Nginx, DNApi::Recipe::NginxPassenger]
56
+ DNApi::Stack::NginxPassenger3.recipes.should == [DNApi::Recipe::Nginx, DNApi::Recipe::Passenger3]
57
57
  end
58
58
  end
59
59
 
@@ -75,6 +75,7 @@ describe DNApi::Stack do
75
75
  end
76
76
 
77
77
  context "responds to legacy helper methods" do
78
+ subject { DNApi::Stack.all.first }
78
79
  it { should respond_to(:apache?)}
79
80
  it { should respond_to(:nginx?)}
80
81
  it { should respond_to(:passenger?)}
metadata CHANGED
@@ -1,76 +1,67 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: dnapi
3
- version: !ruby/object:Gem::Version
4
- hash: 961239189
5
- prerelease: true
6
- segments:
7
- - 1
8
- - 1
9
- - 82
10
- - php
11
- version: 1.1.82.php
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.82.ruby19
5
+ prerelease: 7
12
6
  platform: ruby
13
- authors:
7
+ authors:
14
8
  - Engine Yard
15
9
  autorequire:
16
10
  bindir: bin
17
11
  cert_chain: []
18
-
19
- date: 2011-07-26 00:00:00 -07:00
20
- default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
12
+ date: 2011-07-26 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
23
15
  name: json
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &2165535080 !ruby/object:Gem::Requirement
26
17
  none: false
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- hash: 3
31
- segments:
32
- - 0
33
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
34
22
  type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: extlib
38
23
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *2165535080
25
+ - !ruby/object:Gem::Dependency
26
+ name: extlib
27
+ requirement: &2165534600 !ruby/object:Gem::Requirement
40
28
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 3
45
- segments:
46
- - 0
47
- version: "0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
48
33
  type: :runtime
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
34
+ prerelease: false
35
+ version_requirements: *2165534600
36
+ - !ruby/object:Gem::Dependency
51
37
  name: sexp_processor
38
+ requirement: &2165534120 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
52
45
  prerelease: false
53
- requirement: &id003 !ruby/object:Gem::Requirement
46
+ version_requirements: *2165534120
47
+ - !ruby/object:Gem::Dependency
48
+ name: jexp
49
+ requirement: &2165533640 !ruby/object:Gem::Requirement
54
50
  none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- hash: 3
59
- segments:
60
- - 0
61
- version: "0"
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: 0.1.1
62
55
  type: :runtime
63
- version_requirements: *id003
56
+ prerelease: false
57
+ version_requirements: *2165533640
64
58
  description: API for chef DNA.
65
- email:
59
+ email:
66
60
  - gems@engineyard.com
67
61
  executables: []
68
-
69
62
  extensions: []
70
-
71
63
  extra_rdoc_files: []
72
-
73
- files:
64
+ files:
74
65
  - lib/dnapi/app.rb
75
66
  - lib/dnapi/component.rb
76
67
  - lib/dnapi/component_possessor.rb
@@ -84,7 +75,6 @@ files:
84
75
  - lib/dnapi/components/newrelic.rb
85
76
  - lib/dnapi/components/nodejs.rb
86
77
  - lib/dnapi/components/passenger3.rb
87
- - lib/dnapi/components/php.rb
88
78
  - lib/dnapi/components/ruby.rb
89
79
  - lib/dnapi/components/ssmtp.rb
90
80
  - lib/dnapi/components/stunneled.rb
@@ -95,7 +85,6 @@ files:
95
85
  - lib/dnapi/db_stack.rb
96
86
  - lib/dnapi/ebuild_dep.rb
97
87
  - lib/dnapi/environment.rb
98
- - lib/dnapi/extensions.rb
99
88
  - lib/dnapi/gem_dep.rb
100
89
  - lib/dnapi/instance.rb
101
90
  - lib/dnapi/monitoring.rb
@@ -127,43 +116,31 @@ files:
127
116
  - spec/spec_helper.rb
128
117
  - spec/stack_spec.rb
129
118
  - spec/struct_spec.rb
130
- has_rdoc: true
131
119
  homepage: http://github.com/engineyard/dnapi
132
120
  licenses: []
133
-
134
121
  post_install_message:
135
122
  rdoc_options: []
136
-
137
- require_paths:
123
+ require_paths:
138
124
  - lib
139
- required_ruby_version: !ruby/object:Gem::Requirement
125
+ required_ruby_version: !ruby/object:Gem::Requirement
140
126
  none: false
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
127
+ requirements:
128
+ - - ! '>='
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
149
132
  none: false
150
- requirements:
151
- - - ">"
152
- - !ruby/object:Gem::Version
153
- hash: 25
154
- segments:
155
- - 1
156
- - 3
157
- - 1
133
+ requirements:
134
+ - - ! '>'
135
+ - !ruby/object:Gem::Version
158
136
  version: 1.3.1
159
137
  requirements: []
160
-
161
138
  rubyforge_project:
162
- rubygems_version: 1.3.7
139
+ rubygems_version: 1.8.10
163
140
  signing_key:
164
141
  specification_version: 3
165
142
  summary: API for chef DNA.
166
- test_files:
143
+ test_files:
167
144
  - spec/app_spec.rb
168
145
  - spec/component_spec.rb
169
146
  - spec/components/addons_spec.rb
@@ -182,3 +159,4 @@ test_files:
182
159
  - spec/spec_helper.rb
183
160
  - spec/stack_spec.rb
184
161
  - spec/struct_spec.rb
162
+ has_rdoc:
@@ -1,26 +0,0 @@
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
@@ -1,32 +0,0 @@
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