dnapi 1.1.98 → 1.1.100.pre2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/dnapi/components/metadata.rb +3 -0
- data/lib/dnapi/components/nodejs.rb +14 -10
- data/lib/dnapi/recipe.rb +1 -1
- data/lib/dnapi/stack.rb +9 -2
- data/lib/dnapi/version.rb +1 -1
- data/spec/app_spec.rb +1 -1
- data/spec/components/nodejs_spec.rb +3 -7
- data/spec/stack_spec.rb +3 -3
- metadata +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module DNApi
|
|
2
2
|
module Components
|
|
3
|
-
class NodeJS <
|
|
3
|
+
class NodeJS < Struct.new(:key)
|
|
4
4
|
include Component
|
|
5
5
|
|
|
6
6
|
desc "Evented I/O for V8 JavaScript"
|
|
@@ -9,22 +9,26 @@ module DNApi
|
|
|
9
9
|
|
|
10
10
|
belongs_to Environment
|
|
11
11
|
|
|
12
|
-
NAME
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
NAME = 'Node.js'.freeze
|
|
13
|
+
|
|
14
|
+
def app_server_stacks
|
|
15
|
+
DNApi::Stack.all.select do |stack|
|
|
16
|
+
stack.ruby_versions.include?(self.class)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
15
19
|
|
|
16
20
|
def self.label
|
|
17
|
-
|
|
21
|
+
NAME
|
|
18
22
|
end
|
|
19
23
|
|
|
20
|
-
def
|
|
21
|
-
|
|
24
|
+
def label
|
|
25
|
+
NAME
|
|
22
26
|
end
|
|
23
27
|
|
|
24
|
-
def
|
|
25
|
-
|
|
28
|
+
def name
|
|
29
|
+
NAME
|
|
26
30
|
end
|
|
27
|
-
end
|
|
28
31
|
|
|
32
|
+
end
|
|
29
33
|
end
|
|
30
34
|
end
|
data/lib/dnapi/recipe.rb
CHANGED
data/lib/dnapi/stack.rb
CHANGED
|
@@ -60,12 +60,19 @@ module DNApi
|
|
|
60
60
|
:recipes => [Recipe::Nginx, Recipe::Trinidad])
|
|
61
61
|
|
|
62
62
|
Nginxtcp = new(:name => 'nginxtcp',
|
|
63
|
-
:label => '
|
|
63
|
+
:label => 'Node.js Early Access',
|
|
64
64
|
:web_server => :nginxtcp,
|
|
65
65
|
:rack_server => :nodejs,
|
|
66
66
|
:ruby_versions => [DNApi::Components::NodeJS],
|
|
67
67
|
:recipes => [Recipe::Nginxtcp, Recipe::Node])
|
|
68
68
|
|
|
69
|
+
NginxNode = new(:name => 'node',
|
|
70
|
+
:label => 'Node.js',
|
|
71
|
+
:web_server => :nginx,
|
|
72
|
+
:rack_server => :nodejs,
|
|
73
|
+
:ruby_versions => [DNApi::Components::NodeJS],
|
|
74
|
+
:recipes => [Recipe::Nginx, Recipe::Node])
|
|
75
|
+
|
|
69
76
|
NginxThin = new(:name => 'thin',
|
|
70
77
|
:label => 'Thin',
|
|
71
78
|
:web_server => :nginx,
|
|
@@ -89,7 +96,7 @@ module DNApi
|
|
|
89
96
|
:recipes => [Recipe::Nginx, Recipe::PHP])
|
|
90
97
|
|
|
91
98
|
def self.all
|
|
92
|
-
[NginxMongrel, NginxPassenger, NginxPassenger3, ApachePassenger, NginxUnicorn, Trinidad, Nginxtcp, NginxThin, NginxPuma, NginxPHP]
|
|
99
|
+
[NginxMongrel, NginxPassenger, NginxPassenger3, ApachePassenger, NginxUnicorn, Trinidad, Nginxtcp, NginxNode, NginxThin, NginxPuma, NginxPHP]
|
|
93
100
|
end
|
|
94
101
|
|
|
95
102
|
def self.get(name)
|
data/lib/dnapi/version.rb
CHANGED
data/spec/app_spec.rb
CHANGED
|
@@ -52,7 +52,7 @@ describe DNApi::App do
|
|
|
52
52
|
end
|
|
53
53
|
describe "nginx_nodejs environment" do
|
|
54
54
|
before do
|
|
55
|
-
@environment = DNApi::Environment.new(:stack => DNApi::Stack.get('
|
|
55
|
+
@environment = DNApi::Environment.new(:stack => DNApi::Stack.get('node'))
|
|
56
56
|
@app = DNApi::App.new
|
|
57
57
|
@environment.apps = [@app]
|
|
58
58
|
end
|
|
@@ -8,8 +8,7 @@ describe DNApi::Components::NodeJS do
|
|
|
8
8
|
|
|
9
9
|
describe "#label" do
|
|
10
10
|
it "should have the right label" do
|
|
11
|
-
|
|
12
|
-
@nodejs.label.should == 'Node.js - 0.6.x'
|
|
11
|
+
@nodejs.label.should == 'Node.js'
|
|
13
12
|
end
|
|
14
13
|
end
|
|
15
14
|
|
|
@@ -17,11 +16,8 @@ describe DNApi::Components::NodeJS do
|
|
|
17
16
|
it { @nodejs.name.should == 'Node.js' }
|
|
18
17
|
end
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
it "does not have a version because package.json takes care of that" do
|
|
20
|
+
expect { @nodejs.version }.to raise_error(NoMethodError)
|
|
22
21
|
end
|
|
23
22
|
|
|
24
|
-
describe "#patch_level" do
|
|
25
|
-
it { @nodejs.patch_level.should == '17' }
|
|
26
|
-
end
|
|
27
23
|
end
|
data/spec/stack_spec.rb
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
2
2
|
|
|
3
3
|
describe DNApi::Stack do
|
|
4
|
-
describe "
|
|
5
|
-
it 'has node &
|
|
6
|
-
DNApi::Stack::
|
|
4
|
+
describe "NginxNode" do
|
|
5
|
+
it 'has node & nginx for recipes' do
|
|
6
|
+
DNApi::Stack::NginxNode.recipes.should == [DNApi::Recipe::Nginx, DNApi::Recipe::Node]
|
|
7
7
|
end
|
|
8
8
|
end
|
|
9
9
|
|
metadata
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dnapi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
5
|
-
prerelease:
|
|
4
|
+
version: 1.1.100.pre2
|
|
5
|
+
prerelease: 8
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- Engine Yard
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2012-
|
|
12
|
+
date: 2012-08-16 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: json
|