Class: DNApi::Stack

Inherits:
Struct
  • Object
show all
Defined in:
lib/dnapi/stack.rb

Constant Summary collapse

NginxMongrel =
new(:name          => 'nginx_mongrel',
:label         => 'Mongrel',
:web_server    => :nginx,
:rack_server   => :mongrel,
:ruby_versions => (DNApi::Components::RubyVersion.all - [DNApi::Components::Ruby193,
                                                         DNApi::Components::Ruby192,
                                                         DNApi::Components::JRuby187,
                                                         DNApi::Components::JRuby192,
                                                         DNApi::Components::Rubinius,
                                                         DNApi::Components::Rubinius19]),
:recipes       => [Recipe::Nginx, Recipe::Mongrel])
NginxPassenger =
new(:name          => 'nginx_passenger',
:label         => 'Passenger',
:web_server    => :nginx,
:rack_server   => :passenger,
:ruby_versions => (DNApi::Components::RubyVersion.all - [DNApi::Components::JRuby187,
                                                         DNApi::Components::JRuby192,
                                                         DNApi::Components::Rubinius,
                                                         DNApi::Components::Rubinius19]),
:recipes       => [Recipe::Nginx, Recipe::Passenger, Recipe::NginxPassenger])
NginxPassenger3 =
new(:name          => 'nginx_passenger3',
:label         => 'Passenger 3',
:web_server    => :nginx,
:rack_server   => :passenger,
:ruby_versions => (DNApi::Components::RubyVersion.all - [DNApi::Components::JRuby187,
                                                         DNApi::Components::JRuby192,
                                                         DNApi::Components::Ruby186]),
:recipes       => [Recipe::Nginx, Recipe::Passenger3])
ApachePassenger =

FIXME: Remove

new(:name          => 'apache_passenger',
:label         => 'Apache + Passenger',
:web_server    => :apache,
:rack_server   => :passenger,
:ruby_versions => [DNApi::Components::Ruby186],
:recipes       => [Recipe::Passenger, Recipe::ApachePassenger])
NginxUnicorn =
new(:name          => 'nginx_unicorn',
:label         => 'Unicorn',
:web_server    => :nginx,
:rack_server   => :unicorn,
:ruby_versions => (DNApi::Components::RubyVersion.all - [DNApi::Components::JRuby187,
                                                         DNApi::Components::JRuby192]),
:recipes       => [Recipe::Nginx, Recipe::Unicorn])
Trinidad =
new(:name          => 'trinidad',
:label         => 'Trinidad',
:web_server    => :nginx,
:rack_server   => :trinidad,
:ruby_versions => [DNApi::Components::JRuby187, DNApi::Components::JRuby192],
:recipes       => [Recipe::Nginx, Recipe::Trinidad])
Nginxtcp =
new(:name          => 'nginxtcp',
:label         => 'NodeJS',
:web_server    => :nginxtcp,
:rack_server   => :nodejs,
:ruby_versions => [DNApi::Components::NodeJS],
:recipes       => [Recipe::Nginxtcp, Recipe::Node])
NginxThin =
new(:name          => 'thin',
:label         => 'Thin',
:web_server    => :nginx,
:rack_server   => :thin,
:ruby_versions => (DNApi::Components::RubyVersion.all - [DNApi::Components::JRuby187,
                                                         DNApi::Components::JRuby192]),
:recipes       => [Recipe::Nginx, Recipe::Thin])
NginxPuma =
new(:name          => 'puma',
:label         => 'Puma',
:web_server    => :nginx,
:rack_server   => :puma,
:ruby_versions => DNApi::Components::RubyVersion.all,
:recipes       => [Recipe::Nginx, Recipe::Puma])
NginxPHP =
new(:name          => 'nginx_fpm',
:label         => 'PHP-FPM',
:web_server    => :nginx,
:rack_server   => :fpm,
:ruby_versions => [DNApi::Components::PHP],
:recipes       => [Recipe::Nginx, Recipe::PHP])

Instance Attribute Summary collapse

Attributes inherited from Struct

#parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Struct

#==, #_many, _many, #_many_values, #_ones, _ones, #_ones_values, _umembers, belongs_to, from, #inspect, many, map, one, #to_hash, #umember_inspect, unserialized_member

Methods included from Test::Ext

#default_fauxture_name, #fixture, #generate, #generate_attributes, #pick

Constructor Details

#initialize(opts = {}) ⇒ Stack

Returns a new instance of Stack.



4
5
6
# File 'lib/dnapi/stack.rb', line 4

def initialize(opts = {})
  super(opts)
end

Instance Attribute Details

#labelObject

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



2
3
4
# File 'lib/dnapi/stack.rb', line 2

def label
  @label
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



2
3
4
# File 'lib/dnapi/stack.rb', line 2

def name
  @name
end

#rack_serverObject

Returns the value of attribute rack_server

Returns:

  • (Object)

    the current value of rack_server



2
3
4
# File 'lib/dnapi/stack.rb', line 2

def rack_server
  @rack_server
end

#recipesObject

Returns the value of attribute recipes

Returns:

  • (Object)

    the current value of recipes



2
3
4
# File 'lib/dnapi/stack.rb', line 2

def recipes
  @recipes
end

#ruby_versionsObject

Returns the value of attribute ruby_versions

Returns:

  • (Object)

    the current value of ruby_versions



2
3
4
# File 'lib/dnapi/stack.rb', line 2

def ruby_versions
  @ruby_versions
end

#web_serverObject

Returns the value of attribute web_server

Returns:

  • (Object)

    the current value of web_server



2
3
4
# File 'lib/dnapi/stack.rb', line 2

def web_server
  @web_server
end

Class Method Details

.allObject



91
92
93
# File 'lib/dnapi/stack.rb', line 91

def self.all
  [NginxMongrel, NginxPassenger, NginxPassenger3, ApachePassenger, NginxUnicorn, Trinidad, Nginxtcp, NginxThin, NginxPuma, NginxPHP]
end

.get(name) ⇒ Object



95
96
97
# File 'lib/dnapi/stack.rb', line 95

def self.get(name)
  all.detect {|s| s.name == name }
end