capistrano_mailer 4.0.1 → 4.0.2

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/Rakefile CHANGED
@@ -1,52 +1,40 @@
1
- require 'rake'
2
- require 'rake/testtask'
3
- require 'rdoc/task'
4
-
5
- begin
6
- require 'jeweler'
7
- Jeweler::Tasks.new do |gemspec|
8
- gemspec.name = "capistrano_mailer"
9
- gemspec.summary = "Capistrano Deployment Email Notification"
10
- gemspec.description = %q{Capistrano Deployment Email Notification. Keep the whole team informed of each release!}
11
- gemspec.email = ["peter.boling@gmail.com", "dave@textgoeshere.org.uk", "jason@rustedcode.com"]
12
- gemspec.homepage = "http://github.com/pboling/capistrano_mailer"
13
- gemspec.authors = ["Peter Boling", "Dave Nolan", "Jason Rust"]
14
- gemspec.add_dependency 'actionmailer'
15
- gemspec.files = ["README.rdoc",
16
- "capistrano_mailer.gemspec",
17
- "lib/cap_mailer.rb",
18
- "lib/capistrano/mailer.rb",
19
- "Rakefile",
20
- "MIT-LICENSE",
21
- "views/cap_mailer/_section.html.erb",
22
- "views/cap_mailer/_section.text.erb",
23
- "views/cap_mailer/_section_custom.html.erb",
24
- "views/cap_mailer/_section_custom.text.erb",
25
- "views/cap_mailer/notification_email.html.erb",
26
- "views/cap_mailer/notification_email.text.erb",
27
- "VERSION.yml"]
28
- end
29
- Jeweler::GemcutterTasks.new
30
- rescue LoadError
31
- puts "Jeweler not available. Install it with: sudo gem install jeweler"
32
- end
33
-
34
- desc 'Default: run unit tests.'
35
- task :default => :test
36
-
37
- desc 'Test the capistrano_mailer gem.'
38
- Rake::TestTask.new(:test) do |t|
39
- t.libs << 'lib'
40
- t.libs << 'test'
41
- t.pattern = 'test/**/*_test.rb'
42
- t.verbose = true
43
- end
44
-
45
- desc 'Generate documentation for the capistrano_mailer gem.'
46
- Rake::RDocTask.new(:rdoc) do |rdoc|
47
- rdoc.rdoc_dir = 'rdoc'
48
- rdoc.title = 'capistrano_mailer'
49
- rdoc.options << '--line-numbers' << '--inline-source'
50
- rdoc.rdoc_files.include('README.markdown')
51
- rdoc.rdoc_files.include('lib/**/*.rb')
52
- end
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+ require 'rdoc/task'
4
+
5
+ begin
6
+ require 'jeweler'
7
+ Jeweler::Tasks.new do |gemspec|
8
+ gemspec.name = "capistrano_mailer"
9
+ gemspec.summary = "Capistrano Deployment Email Notification"
10
+ gemspec.description = %q{Capistrano Deployment Email Notification. Keep the whole team informed of each release!}
11
+ gemspec.email = ["peter.boling@gmail.com", "dave@textgoeshere.org.uk", "jason@rustedcode.com"]
12
+ gemspec.homepage = "http://github.com/pboling/capistrano_mailer"
13
+ gemspec.authors = ["Peter Boling", "Dave Nolan", "Jason Rust"]
14
+ gemspec.add_dependency 'actionmailer'
15
+ gemspec.files = `git ls-files`.split("\n")
16
+ end
17
+ Jeweler::GemcutterTasks.new
18
+ rescue LoadError
19
+ puts "Jeweler not available. Install it with: sudo gem install jeweler"
20
+ end
21
+
22
+ desc 'Default: run unit tests.'
23
+ task :default => :test
24
+
25
+ desc 'Test the capistrano_mailer gem.'
26
+ Rake::TestTask.new(:test) do |t|
27
+ t.libs << 'lib'
28
+ t.libs << 'test'
29
+ t.pattern = 'test/**/*_test.rb'
30
+ t.verbose = true
31
+ end
32
+
33
+ desc 'Generate documentation for the capistrano_mailer gem.'
34
+ Rake::RDocTask.new(:rdoc) do |rdoc|
35
+ rdoc.rdoc_dir = 'rdoc'
36
+ rdoc.title = 'capistrano_mailer'
37
+ rdoc.options << '--line-numbers' << '--inline-source'
38
+ rdoc.rdoc_files.include('README.markdown')
39
+ rdoc.rdoc_files.include('lib/**/*.rb')
40
+ end
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 4
3
3
  :minor: 0
4
- :patch: 1
5
- :build: !!null
4
+ :patch: 2
5
+ :build:
@@ -0,0 +1,60 @@
1
+ body {
2
+ font: 14px normal Helvetica, Arial, Sans;
3
+ background: #966;
4
+ }
5
+
6
+ div.mail-content {
7
+ width: 800px;
8
+ margin: 10px auto;
9
+ background: #fdd;
10
+ border: 10px solid #a66;
11
+ }
12
+
13
+ h1 {
14
+ clear: both;
15
+ margin: 0;
16
+ padding: 40px 20px 5px 20px;
17
+ border-bottom: 1px dotted;
18
+ background: #c88;
19
+ }
20
+
21
+ p.view-site, p.mail-footer {
22
+ margin: 8px 0 20px 20px;
23
+ padding: 0;
24
+ font-style: italic;
25
+ }
26
+
27
+ p.released {
28
+ margin: 10px 20px;
29
+ font-weight: bold;
30
+ }
31
+
32
+ div.section {
33
+ margin: 20px;
34
+ padding: 0 0 20px 0;
35
+ }
36
+
37
+ div.section h2 {
38
+ margin: 0;
39
+ padding: 10px 10px 5px 10px;
40
+ background: #fcc;
41
+ border-left: 10px solid #a66;
42
+ color: #333;
43
+ }
44
+
45
+ div.section p.data-item {
46
+ margin: 10px; padding: 0;
47
+ }
48
+
49
+ div.section p.data-item p.key {
50
+ float: left;
51
+ width: 150px;
52
+ padding: 10px 10px 0;
53
+ }
54
+
55
+ div.section p.data-item p.value {
56
+ float: left;
57
+ width: 490px;
58
+ padding: 10px 10px 0;
59
+ }
60
+
@@ -0,0 +1,60 @@
1
+ body {
2
+ font: 14px normal Helvetica, Arial, Sans;
3
+ background: #666;
4
+ }
5
+
6
+ div.mail-content {
7
+ width: 800px;
8
+ margin: 10px auto;
9
+ background: #dfd;
10
+ border: 10px solid #6a6;
11
+ }
12
+
13
+ h1 {
14
+ clear: both;
15
+ margin: 0;
16
+ padding: 40px 20px 5px 20px;
17
+ border-bottom: 1px dotted;
18
+ background: #8c8;
19
+ }
20
+
21
+ p.view-site, p.mail-footer {
22
+ margin: 8px 0 20px 20px;
23
+ padding: 0;
24
+ font-style: italic;
25
+ }
26
+
27
+ p.released {
28
+ margin: 10px 20px;
29
+ font-weight: bold;
30
+ }
31
+
32
+ div.section {
33
+ margin: 20px;
34
+ padding: 0 0 20px 0;
35
+ }
36
+
37
+ div.section h2 {
38
+ margin: 0;
39
+ padding: 10px 10px 5px 10px;
40
+ background: #cfc;
41
+ border-left: 10px solid #6a6;
42
+ color: #333;
43
+ }
44
+
45
+ div.section p.data-item {
46
+ margin: 10px; padding: 0;
47
+ }
48
+
49
+ div.section p.data-item p.key {
50
+ float: left;
51
+ width: 150px;
52
+ padding: 10px 10px 0;
53
+ }
54
+
55
+ div.section p.data-item p.value {
56
+ float: left;
57
+ width: 490px;
58
+ padding: 10px 10px 0;
59
+ }
60
+
@@ -5,45 +5,63 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "capistrano_mailer"
8
- s.version = "4.0.1"
8
+ s.version = "4.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Peter Boling", "Dave Nolan", "Jason Rust"]
12
- s.date = "2011-12-11"
12
+ s.date = "2013-01-22"
13
13
  s.description = "Capistrano Deployment Email Notification. Keep the whole team informed of each release!"
14
14
  s.email = ["peter.boling@gmail.com", "dave@textgoeshere.org.uk", "jason@rustedcode.com"]
15
15
  s.extra_rdoc_files = [
16
16
  "README.rdoc"
17
17
  ]
18
18
  s.files = [
19
+ ".gitignore",
20
+ "CHANGELOG",
21
+ "Gemfile",
22
+ "Gemfile.lock",
19
23
  "MIT-LICENSE",
20
24
  "README.rdoc",
21
25
  "Rakefile",
22
26
  "VERSION.yml",
27
+ "assets/stylesheets/failure.css",
28
+ "assets/stylesheets/success.css",
23
29
  "capistrano_mailer.gemspec",
24
30
  "lib/cap_mailer.rb",
25
31
  "lib/capistrano/mailer.rb",
32
+ "lib/capistrano/mailer_recipes.rb",
33
+ "test/build_gem_test.rb",
34
+ "views/cap_mailer/_message_body.html.erb",
35
+ "views/cap_mailer/_message_body.text.erb",
26
36
  "views/cap_mailer/_section.html.erb",
27
37
  "views/cap_mailer/_section.text.erb",
28
38
  "views/cap_mailer/_section_custom.html.erb",
29
39
  "views/cap_mailer/_section_custom.text.erb",
40
+ "views/cap_mailer/failed.notification_email.html.erb",
41
+ "views/cap_mailer/failed.notification_email.text.erb",
30
42
  "views/cap_mailer/notification_email.html.erb",
31
43
  "views/cap_mailer/notification_email.text.erb"
32
44
  ]
33
45
  s.homepage = "http://github.com/pboling/capistrano_mailer"
34
46
  s.require_paths = ["lib"]
35
- s.rubygems_version = "1.8.10"
47
+ s.rubygems_version = "1.8.24"
36
48
  s.summary = "Capistrano Deployment Email Notification"
37
49
 
38
50
  if s.respond_to? :specification_version then
39
51
  s.specification_version = 3
40
52
 
41
53
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
54
+ s.add_runtime_dependency(%q<capistrano-log_with_awesome>, [">= 0"])
55
+ s.add_runtime_dependency(%q<inline-style>, [">= 0"])
42
56
  s.add_runtime_dependency(%q<actionmailer>, [">= 0"])
43
57
  else
58
+ s.add_dependency(%q<capistrano-log_with_awesome>, [">= 0"])
59
+ s.add_dependency(%q<inline-style>, [">= 0"])
44
60
  s.add_dependency(%q<actionmailer>, [">= 0"])
45
61
  end
46
62
  else
63
+ s.add_dependency(%q<capistrano-log_with_awesome>, [">= 0"])
64
+ s.add_dependency(%q<inline-style>, [">= 0"])
47
65
  s.add_dependency(%q<actionmailer>, [">= 0"])
48
66
  end
49
67
  end
@@ -1,184 +1,207 @@
1
- class CapMailer < ActionMailer::Base
2
-
3
- @@default_base_config ||= {
4
- :sender_address => %("#{(defined?(Rails) ? Rails.env.capitalize : defined?(RAILS_ENV) ? RAILS_ENV.capitalize : defined?(ENV) ? ENV['RAILS_ENV'] : "")} Capistrano Deployment" <capistrano.mailer@example.com>),
5
- :recipient_addresses => [],
6
- # Customize the subject line
7
- :subject_prepend => "[DEPLOYMENT]-[#{(defined?(Rails) ? Rails.env.capitalize : defined?(RAILS_ENV) ? RAILS_ENV.capitalize : defined?(ENV) ? ENV['RAILS_ENV'] : "")}] ",
8
- :subject_append => nil,
9
- # Include which sections of the deployment email?
10
- :sections => %w(deployment release_data source_control latest_release previous_release other_deployment_info extra_information),
11
- :site_name => "",
12
- :email_content_type => "text/html",
13
- :template_root => "#{File.dirname(__FILE__)}/../views"
14
- }
15
-
16
- cattr_accessor :default_base_config
17
- attr_accessor :config, :options
18
- attr_accessor :date, :time, :inferred_command, :task_name, :repo_end
19
-
20
- def self.configure(&block)
21
- yield @@default_base_config
22
- end
23
-
24
- def self.configure_capistrano_mailer(&block)
25
- puts "Deprecated 'configure_capistrano_mailer'. Please update your capistrano_mailer configuration to use 'configure' instead of 'configure_capistrano_mailer'"
26
- end
27
-
28
- self.prepend_view_path default_base_config[:template_root]
29
-
30
- def self.reloadable?() false end
31
-
32
- def notification_email(cap, config = {}, *args)
33
- @options = { :release_data => {}, :extra_information => {}, :data => {} }.merge(args.extract_options!)
34
- @config = default_base_config.merge(config.reverse_merge({
35
- :rails_env => cap.rails_env,
36
- :host => cap.host,
37
- :task_name => cap.task_name,
38
- :application => cap.application,
39
- :repository => cap.repository,
40
- :scm => cap.scm,
41
- :deploy_via => cap.deploy_via,
42
- :deploy_to => cap.deploy_to,
43
- :revision => cap.revision,
44
- :real_revision => cap.real_revision,
45
- :release_name => cap.release_name,
46
- #This does not appear to be a capistrano variable:
47
- #:release_notes => cap.release_notes,
48
- :version_dir => cap.version_dir,
49
- :shared_dir => cap.shared_dir,
50
- :current_dir => cap.current_dir,
51
- :releases_path => cap.releases_path,
52
- :shared_path => cap.shared_path,
53
- :current_path => cap.current_path,
54
- :release_path => cap.release_path,
55
- :releases => cap.releases,
56
- :current_release => cap.current_release,
57
- :previous_release => cap.previous_release,
58
- :current_revision => cap.current_revision,
59
- :latest_revision => cap.latest_revision,
60
- :previous_revision => cap.previous_revision,
61
- :run_method => cap.run_method,
62
- :latest_release => cap.latest_release
63
-
64
- #This does not appear to be a capistrano variable:
65
- #:site_url => cap.site_url
66
- }))
67
-
68
- @date = Date.today.to_s
69
- @time = Time.now.strftime("%I:%M %p").to_s
70
- @inferred_command = "cap #{@config[:rails_env]} #{@config[:task_name]}"
71
- @task_name = @config[:task_name] || "unknown"
72
-
73
- repo = @config[:repository]
74
- x = repo.include?('/') ? repo.rindex('/') - 1 : repo.length
75
- front = repo.slice(0..x)
76
- back = repo.sub(front, '')
77
- unless back == 'trunk'
78
- x = front.include?('/') ? front.rindex('/') - 1 : front.length
79
- front = front.slice(0..x)
80
- end
81
- @repo_end = repo.sub(front, '')
82
-
83
- body_data_hash.each_pair do |k, v|
84
- self.instance_variable_set("@#{k}", v)
85
- end
86
-
87
- mail :subject => subject_line,
88
- :to => @config[:recipient_addresses],
89
- :from => @config[:sender_address]
90
- end
91
-
92
- private
93
-
94
- def subject_line
95
- #The subject prepend and append are useful for people to setup filters in mail clients.
96
- user = config[:user] ? " by #{config[:user]}" : ""
97
- middle = config[:subject] ? config[:subject] : "[#{config[:rails_env].upcase}][#{repo_end}] #{inferred_command}#{user}"
98
- "#{config[:subject_prepend]}#{middle}#{config[:subject_append]}"
99
- end
100
-
101
- def body_data_hash
102
- options[:data].merge({
103
- :section_data => section_data_hash,
104
- :date => date,
105
- :time => time,
106
- :task_name => task_name,
107
- :inferred_command => inferred_command,
108
- :repo_end => repo_end,
109
- :site_name => config[:site_name],
110
- :site_url => config[:site_url],
111
- :application => config[:application],
112
- :sections => config[:sections]
113
- })
114
- end
115
-
116
- def section_data_hash
117
- {
118
- :deployment => section_hash_deployment,
119
- :source_control => section_hash_source_control,
120
- :latest_release => section_hash_latest_release,
121
- :previous_release => section_hash_previous_release,
122
- :other_deployment_info => section_hash_other_deployment_info,
123
- :release_data => options[:release_data],
124
- :extra_information => options[:extra_information]
125
- }
126
- end
127
-
128
- def section_hash_deployment
129
- {
130
- :date => date,
131
- :time => time,
132
- :rails_env => config[:rails_env],
133
- :task_name => task_name,
134
- :inferred_command => inferred_command,
135
- :host => config[:host],
136
- :release_name => config[:release_name],
137
- :release_notes => config[:release_notes]
138
- }
139
- end
140
-
141
- def section_hash_source_control
142
- {
143
- :revision => config[:revision],
144
- :released => repo_end,
145
- :repository => config[:repository],
146
- :branch => config[:branch],
147
- :scm => config[:scm],
148
- :deploy_via => config[:deploy_via],
149
- :deploy_to => config[:deploy_to]
150
- }
151
- end
152
-
153
- def section_hash_latest_release
154
- {
155
- :latest_release => config[:latest_release],
156
- :latest_revision => config[:latest_revision],
157
- :release_path => config[:release_path],
158
- :real_revision => config[:real_revision],
159
- :current_path => config[:current_path]
160
- }
161
- end
162
-
163
- def section_hash_previous_release
164
- {
165
- :current_release => config[:current_release],
166
- :current_revision => config[:current_revision],
167
- :previous_release => config[:previous_release],
168
- :previous_revision => config[:previous_revision],
169
- :releases => config[:releases]
170
- }
171
- end
172
-
173
- def section_hash_other_deployment_info
174
- {
175
- :version_dir => config[:version_dir],
176
- :shared_dir => config[:shared_dir],
177
- :current_dir => config[:current_dir],
178
- :releases_path => config[:releases_path],
179
- :shared_path => config[:shared_path],
180
- :run_method => config[:run_method],
181
- :ip_address => config[:ip_address]
182
- }
183
- end
184
- end
1
+ class CapMailer < ActionMailer::Base
2
+
3
+ @@default_base_config ||= ActiveSupport::InheritableOptions.new({
4
+ :sender_address => %("#{(defined?(Rails) ? Rails.env.capitalize : defined?(RAILS_ENV) ? RAILS_ENV.capitalize : defined?(ENV) ? ENV['RAILS_ENV'] : "")} Capistrano Deployment" <capistrano.mailer@example.com>),
5
+ :recipient_addresses => [],
6
+ # Customize the subject line
7
+ :subject_prepend => "[DEPLOYMENT]-[#{(defined?(Rails) ? Rails.env.capitalize : defined?(RAILS_ENV) ? RAILS_ENV.capitalize : defined?(ENV) ? ENV['RAILS_ENV'] : "")}] ",
8
+ :subject_append => nil,
9
+ # Include which sections of the deployment email?
10
+ :sections => %w(deployment release_data source_control latest_release previous_release other_deployment_info extra_information),
11
+ :site_name => "",
12
+ :template_prefixes => { :success => nil, :failure => "failed" },
13
+ :template_path => "#{File.dirname(__FILE__)}/../views",
14
+ :attach_log_on => :failure
15
+ })
16
+
17
+ cattr_accessor :default_base_config
18
+ attr_accessor :config, :options
19
+ attr_accessor :date, :time, :inferred_command, :task_name, :repo_end
20
+
21
+ def self.configure(&block)
22
+ yield @@default_base_config
23
+ end
24
+
25
+ def self.configure_capistrano_mailer(&block)
26
+ puts "Deprecated 'configure_capistrano_mailer'. Please update your capistrano_mailer configuration to use 'configure' instead of 'configure_capistrano_mailer'"
27
+ end
28
+
29
+ self.prepend_view_path default_base_config[:template_path]
30
+ self.register_interceptor InlineStyle::Mail::Interceptor.new(:stylesheets_path =>
31
+ (default_base_config[:stylesheets_path] || "#{File.dirname(__FILE__)}/../assets")
32
+ )
33
+
34
+ def self.reloadable?() false end
35
+
36
+ def notification_email(cap, config = {}, *args)
37
+ @options = { :release_data => {}, :extra_information => {}, :data => {} }.merge(args.extract_options!)
38
+ @config = default_base_config.merge(config.reverse_merge({
39
+ :rails_env => cap.rails_env,
40
+ :host => cap.host,
41
+ :task_name => cap.task_name,
42
+ :application => cap.application,
43
+ :repository => cap.repository,
44
+ :scm => cap.scm,
45
+ :deploy_via => cap.deploy_via,
46
+ :deploy_to => cap.deploy_to,
47
+ :revision => cap.revision,
48
+ :real_revision => cap.real_revision,
49
+ :release_name => cap.release_name,
50
+ :release_notes => cap.release_notes,
51
+ :version_dir => cap.version_dir,
52
+ :shared_dir => cap.shared_dir,
53
+ :current_dir => cap.current_dir,
54
+ :releases_path => cap.releases_path,
55
+ :shared_path => cap.shared_path,
56
+ :current_path => cap.current_path,
57
+ :release_path => cap.release_path,
58
+ :releases => cap.releases,
59
+ :current_release => cap.current_release,
60
+ :previous_release => cap.previous_release,
61
+ :current_revision => cap.current_revision,
62
+ :latest_revision => cap.latest_revision,
63
+ :previous_revision => cap.previous_revision,
64
+ :run_method => cap.run_method,
65
+ :latest_release => cap.latest_release
66
+ }))
67
+
68
+ @date = Date.today.to_s
69
+ @time = Time.now.strftime("%I:%M %p").to_s
70
+ @inferred_command = "cap #{@config[:rails_env]} #{@config[:task_name]}"
71
+ @task_name = @config[:task_name] || "unknown"
72
+
73
+ repo = @config[:repository]
74
+ x = repo.include?('/') ? repo.rindex('/') - 1 : repo.length
75
+ front = repo.slice(0..x)
76
+ back = repo.sub(front, '')
77
+ unless back == 'trunk'
78
+ x = front.include?('/') ? front.rindex('/') - 1 : front.length
79
+ front = front.slice(0..x)
80
+ end
81
+ @repo_end = repo.sub(front, '')
82
+
83
+ body_data_hash.each_pair do |k, v|
84
+ self.instance_variable_set("@#{k}", v)
85
+ end
86
+
87
+ log = cap.fetch(:full_log)
88
+ fail_pattern = /^failed|rolling back/i
89
+ @job_status = (log =~ fail_pattern) ? :failure : cap.fetch(:mailer_status, :success)
90
+ template_prefix = @config[:template_prefixes][@job_status] ? "#{@config[:template_prefixes][@job_status]}." : ""
91
+ template_name = @config[:template_name] || "#{template_prefix}#{action_name}"
92
+
93
+ attach_log = case @config[:attach_log_on]
94
+ when Symbol, String
95
+ @job_status == @config[:attach_log_on].to_sym
96
+ when Array
97
+ @config[:attach_log_on].collect(&:to_sym).include? @job_status
98
+ else
99
+ false
100
+ end
101
+
102
+ if attach_log
103
+ log_file_name = "deploy-log-#{Time.now.strftime("%Y-%m-%d-%H%M%S")}.txt"
104
+ attachments[log_file_name] = { :content => log, :mime_type => "text/plain" }
105
+ end
106
+
107
+ self.config.assets_dir = "#{File.dirname(__FILE__)}/../assets"
108
+
109
+ mail :subject => "#{@job_status.to_s.upcase}: #{subject_line}",
110
+ :to => @config[:recipient_addresses],
111
+ :from => @config[:sender_address],
112
+ :template_name => template_name
113
+ end
114
+
115
+ private
116
+
117
+ def subject_line
118
+ #The subject prepend and append are useful for people to setup filters in mail clients.
119
+ user = config[:user] ? " by #{config[:user]}" : ""
120
+ middle = config[:subject] ? config[:subject] : "[#{config[:rails_env].upcase}][#{repo_end}] #{inferred_command}#{user}"
121
+ "#{config[:subject_prepend]}#{middle}#{config[:subject_append]}"
122
+ end
123
+
124
+ def body_data_hash
125
+ options[:data].merge({
126
+ :section_data => section_data_hash,
127
+ :date => date,
128
+ :time => time,
129
+ :task_name => task_name,
130
+ :inferred_command => inferred_command,
131
+ :repo_end => repo_end,
132
+ :site_name => config[:site_name],
133
+ :site_url => config[:site_url],
134
+ :application => config[:application],
135
+ :sections => config[:sections]
136
+ })
137
+ end
138
+
139
+ def section_data_hash
140
+ {
141
+ :deployment => section_hash_deployment,
142
+ :source_control => section_hash_source_control,
143
+ :latest_release => section_hash_latest_release,
144
+ :previous_release => section_hash_previous_release,
145
+ :other_deployment_info => section_hash_other_deployment_info,
146
+ :release_data => options[:release_data],
147
+ :extra_information => options[:extra_information]
148
+ }
149
+ end
150
+
151
+ def section_hash_deployment
152
+ {
153
+ :date => date,
154
+ :time => time,
155
+ :rails_env => config[:rails_env],
156
+ :task_name => task_name,
157
+ :inferred_command => inferred_command,
158
+ :host => config[:host],
159
+ :release_name => config[:release_name],
160
+ :release_notes => config[:release_notes]
161
+ }
162
+ end
163
+
164
+ def section_hash_source_control
165
+ {
166
+ :revision => config[:revision],
167
+ :released => repo_end,
168
+ :repository => config[:repository],
169
+ :branch => config[:branch],
170
+ :scm => config[:scm],
171
+ :deploy_via => config[:deploy_via],
172
+ :deploy_to => config[:deploy_to]
173
+ }
174
+ end
175
+
176
+ def section_hash_latest_release
177
+ {
178
+ :latest_release => config[:latest_release],
179
+ :latest_revision => config[:latest_revision],
180
+ :release_path => config[:release_path],
181
+ :real_revision => config[:real_revision],
182
+ :current_path => config[:current_path]
183
+ }
184
+ end
185
+
186
+ def section_hash_previous_release
187
+ {
188
+ :current_release => config[:current_release],
189
+ :current_revision => config[:current_revision],
190
+ :previous_release => config[:previous_release],
191
+ :previous_revision => config[:previous_revision],
192
+ :releases => config[:releases]
193
+ }
194
+ end
195
+
196
+ def section_hash_other_deployment_info
197
+ {
198
+ :version_dir => config[:version_dir],
199
+ :shared_dir => config[:shared_dir],
200
+ :current_dir => config[:current_dir],
201
+ :releases_path => config[:releases_path],
202
+ :shared_path => config[:shared_path],
203
+ :run_method => config[:run_method],
204
+ :ip_address => config[:ip_address]
205
+ }
206
+ end
207
+ end