deployable 0.0.5 → 0.0.6

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/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 0.0.6 (February 1st, 2012)
2
+
3
+ * Updated initrd script for passenger to nog log
4
+ * Added custom ERB template handler so it works in ruby 1.9.x and 1.8.x
5
+
6
+ ## 0.0.5 (January 25th, 2012)
7
+
8
+ * Don't depend on highline, let the environment decide
9
+
1
10
  ## 0.0.4 (January 25th, 2012)
2
11
 
3
12
  * Don't fail if a certain config isn't set, just ignore it.
@@ -138,8 +138,19 @@ class Application
138
138
  # Run the before start callback
139
139
  run_callback(:start, :before)
140
140
 
141
+ # Make sure we have the required dirs
142
+ execute "mkdir -p #{self.path + "shared/pid"}"
143
+ execute "mkdir -p #{self.path + "shared/log"}"
144
+
141
145
  # Start the server
142
- puts rvm_execute(self.config, "passenger start #{self.path + "current"} --user #{USER} --port #{self.config['passenger']['port']} --environment production -d --pid-file #{self.path + "passenger.pid"}")
146
+ options = []
147
+ options << "--user #{USER}"
148
+ options << "--port #{self.config['passenger']['port']}"
149
+ options << "--environment production"
150
+ options << "--daemonize"
151
+ options << "--pid-file #{self.path + "shared/pid/passenger.pid"}"
152
+ options << "--log-file /dev/null"
153
+ puts rvm_execute(self.config, "passenger start #{self.path + "current"} #{options.join(" ")}")
143
154
 
144
155
  # Run the after start callback
145
156
  run_callback(:start, :after)
@@ -64,7 +64,8 @@
64
64
  # within the file.
65
65
  # For instance, the template above takes advantage of Capistrano CLI
66
66
  # to ask for a MySQL database password instead of hard coding it into the template.
67
- require 'ostruct'
67
+
68
+ require "deployable/helpers/erb_template"
68
69
 
69
70
  Capistrano::Configuration.instance.load do
70
71
  namespace :database do
@@ -105,9 +106,7 @@ EOF
105
106
  location = fetch(:template_dir, "config/deploy/templates") + '/database.yml.erb'
106
107
  template = File.file?(location) ? File.read(location) : default_template
107
108
 
108
-
109
- view = ERB.new(template)
110
- put view.result(OpenStruct.new(:config => fetch(:database_config)).send(:binding)), "#{deploy_to}/database.yml"
109
+ put Deployable::ErbTemplate.new(template).render(fetch(:database_config, {})), "#{deploy_to}/database.yml"
111
110
  end
112
111
 
113
112
  desc <<-DESC
@@ -0,0 +1,15 @@
1
+ require 'erb'
2
+ require 'ostruct'
3
+
4
+ module Deployable
5
+ class ErbTemplate
6
+ def initialize(template)
7
+ @template = ERB.new(template)
8
+ end
9
+
10
+ def render(variables)
11
+ context = OpenStruct.new(:config => variables).instance_eval{ binding }
12
+ @template.result(context)
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module Deployable
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,66 +1,48 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: deployable
3
- version: !ruby/object:Gem::Version
4
- hash: 21
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.6
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 5
10
- version: 0.0.5
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Digitpaint
14
9
  - Flurin Egger
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2012-01-25 00:00:00 Z
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
13
+ date: 2012-02-01 00:00:00.000000000Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
22
16
  name: capistrano
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &70307105225940 !ruby/object:Gem::Requirement
25
18
  none: false
26
- requirements:
19
+ requirements:
27
20
  - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 43
30
- segments:
31
- - 2
32
- - 9
33
- - 0
21
+ - !ruby/object:Gem::Version
34
22
  version: 2.9.0
35
23
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: capistrano-ext
39
24
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: *70307105225940
26
+ - !ruby/object:Gem::Dependency
27
+ name: capistrano-ext
28
+ requirement: &70307105225440 !ruby/object:Gem::Requirement
41
29
  none: false
42
- requirements:
30
+ requirements:
43
31
  - - ~>
44
- - !ruby/object:Gem::Version
45
- hash: 29
46
- segments:
47
- - 1
48
- - 2
49
- - 1
32
+ - !ruby/object:Gem::Version
50
33
  version: 1.2.1
51
34
  type: :runtime
52
- version_requirements: *id002
53
- description: This library contains commonly used capistrano tasks, a couple of default recipes and example configurations.
54
- email:
35
+ prerelease: false
36
+ version_requirements: *70307105225440
37
+ description: This library contains commonly used capistrano tasks, a couple of default
38
+ recipes and example configurations.
39
+ email:
55
40
  - info@digitpaint.nl
56
41
  - flurin@digitpaint.nl
57
42
  executables: []
58
-
59
43
  extensions: []
60
-
61
44
  extra_rdoc_files: []
62
-
63
- files:
45
+ files:
64
46
  - .gitignore
65
47
  - .yardopts
66
48
  - CHANGELOG.md
@@ -77,6 +59,7 @@ files:
77
59
  - lib/deployable/config_files.rb
78
60
  - lib/deployable/database.rb
79
61
  - lib/deployable/directories.rb
62
+ - lib/deployable/helpers/erb_template.rb
80
63
  - lib/deployable/passenger.rb
81
64
  - lib/deployable/passenger_standalone.rb
82
65
  - lib/deployable/recipes/default_with_database.rb
@@ -84,36 +67,26 @@ files:
84
67
  - lib/deployable/version.rb
85
68
  homepage: https://github.com/DigitPaint/Deployable
86
69
  licenses: []
87
-
88
70
  post_install_message:
89
71
  rdoc_options: []
90
-
91
- require_paths:
72
+ require_paths:
92
73
  - lib
93
- required_ruby_version: !ruby/object:Gem::Requirement
74
+ required_ruby_version: !ruby/object:Gem::Requirement
94
75
  none: false
95
- requirements:
96
- - - ">="
97
- - !ruby/object:Gem::Version
98
- hash: 3
99
- segments:
100
- - 0
101
- version: "0"
102
- required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
81
  none: false
104
- requirements:
105
- - - ">="
106
- - !ruby/object:Gem::Version
107
- hash: 3
108
- segments:
109
- - 0
110
- version: "0"
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
111
86
  requirements: []
112
-
113
87
  rubyforge_project: deployable
114
- rubygems_version: 1.8.15
88
+ rubygems_version: 1.8.6
115
89
  signing_key:
116
90
  specification_version: 3
117
91
  summary: A collection of handy capistrano tasks and recipes
118
92
  test_files: []
119
-