dnapi 1.1.98 → 1.1.100.pre2

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,6 +7,9 @@ module DNApi
7
7
 
8
8
  desc "Adds arbitrary data to the DNA. DO UNDER NO CIRCUMSTANCE ADD ANY VALIDATION TO THIS!"
9
9
 
10
+ key :metadata
11
+ belongs_to DNApi::Environment
12
+
10
13
  def [](key)
11
14
  self.send(key)
12
15
  end
@@ -1,6 +1,6 @@
1
1
  module DNApi
2
2
  module Components
3
- class NodeJS < VersionedComponent.new(:key)
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 = 'Node.js'.freeze
13
- VERSION = '0.6'.freeze
14
- PATCH_LEVEL = '17'.freeze
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
- "#{NAME} - #{VERSION}.x"
21
+ NAME
18
22
  end
19
23
 
20
- def self.version
21
- "#{VERSION}.#{PATCH_LEVEL}"
24
+ def label
25
+ NAME
22
26
  end
23
27
 
24
- def self.package
25
- 'net-libs/nodejs'
28
+ def name
29
+ NAME
26
30
  end
27
- end
28
31
 
32
+ end
29
33
  end
30
34
  end
@@ -24,7 +24,7 @@ module DNApi
24
24
 
25
25
  def self.all
26
26
  [Monit, Memcached, Nginx, NginxPassenger, ApachePassenger,
27
- Mongrel, Unicorn, Mysql51, Mysql55, Nginxtcp, Node,
27
+ Mongrel, Unicorn, Mysql51, Mysql55, Nginxtcp, Node,
28
28
  Trinidad, Thin, Puma, PHP]
29
29
  end
30
30
  end
@@ -60,12 +60,19 @@ module DNApi
60
60
  :recipes => [Recipe::Nginx, Recipe::Trinidad])
61
61
 
62
62
  Nginxtcp = new(:name => 'nginxtcp',
63
- :label => 'NodeJS',
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)
@@ -1,3 +1,3 @@
1
1
  module DNApi
2
- VERSION = '1.1.98'
2
+ VERSION = '1.1.100.pre2'
3
3
  end
@@ -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('nginxtcp'))
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
- described_class.label.should == 'Node.js - 0.6.x'
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
- describe "#version" do
21
- it { @nodejs.version.should == '0.6' }
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
@@ -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 "Nginxtcp" do
5
- it 'has node & nginxtcp for recipes' do
6
- DNApi::Stack::Nginxtcp.recipes.should == [DNApi::Recipe::Nginxtcp, DNApi::Recipe::Node]
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.98
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-07-27 00:00:00.000000000 Z
12
+ date: 2012-08-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json