capistrano-campout 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## 1.1.0 (Apr 10, 2012)
2
+
3
+ Switched to [broach](https://github.com/Manfred/broach) instead of [tinder](https://github.com/collectiveidea/tinder) due to Tinder's reliance on ActiveSupport and the side-effect issues of ActiveSupport with capistrano (See [Issue #169](https://github.com/capistrano/capistrano/issues/169), [Issue #170](https://github.com/capistrano/capistrano/issues/170), and [Pull Request #175](https://github.com/capistrano/capistrano/pull/175) )
data/README.md CHANGED
@@ -16,11 +16,11 @@ from two projects: [capistrano-mountaintop](https://github.com/technicalpickles/
16
16
 
17
17
  I created my own instead of forking either for the following reasons
18
18
 
19
- * I wanted to use Tinder (Capfire uses broach)
20
- * I wanted the necessary functionality built in instead of using additional gems (mountaintop depends on capistrano-campfire and capistrano-log_with_awesome)
19
+ * I initially wanted to use Tinder (Capfire uses broach). I later went with Broach due to ActiveSupport (which Tinder requires) conflicts with Capistrano.
20
+ * I wanted more customization with regard to messages than capfire provided.
21
+ * I liked EngineYard's logger implementation much better than capistrano-log_with_awesome (which capistrano-mountaintop depends on) - and liked it better integrated into campout's gem itself.
21
22
  * I wanted configuration-file based settings that I can separate into shared (checked into git) and local (git ignored) files
22
23
  * I wanted room to expand for my team's needs for utilities for git and github inspection
23
- * Because I could.
24
24
 
25
25
  ## Installation
26
26
 
@@ -69,23 +69,7 @@ Otherwise, use the source, Luke.
69
69
 
70
70
  ## Known Limitations
71
71
 
72
- ### Deploy:Cleanup task
73
-
74
- Capistrano::Campout requires [Tinder](https://github.com/collectiveidea/tinder) - which requires [ActiveSupport](https://github.com/rails/rails/tree/master/activesupport)
75
-
76
- Apparently, Capistrano's "deploy:cleanup" task breaks in some situations due to conflicts between Capistrano and ActiveSupport
77
-
78
- See:
79
-
80
- * [Issue #169](https://github.com/capistrano/capistrano/issues/169)
81
- * [Issue #170](https://github.com/capistrano/capistrano/issues/170)
82
- * [Pull Request #175](https://github.com/capistrano/capistrano/pull/175)
83
-
84
- Until that's fixed, you'll have to comment out any "deploy:cleanup" invocations
85
-
86
- ### Error checking
87
-
88
- There isn't much. And there's no tests. The latter might be a feature.
72
+ There isn't much error checking on the campfire connection. And there's no tests. The latter might be a feature.
89
73
 
90
74
  ## Contributing
91
75
 
@@ -20,6 +20,6 @@ Gem::Specification.new do |gem|
20
20
  gem.require_paths = ["lib"]
21
21
  gem.version = Capistrano::Campout::VERSION
22
22
  gem.add_dependency('capistrano', '>= 2.11')
23
- gem.add_dependency('tinder', '>= 1.8')
23
+ gem.add_dependency('broach', '>= 0.2')
24
24
  gem.add_dependency('grit', '>= 2.4')
25
25
  end
@@ -6,7 +6,7 @@ module Capistrano
6
6
  module Campout
7
7
  class TemplateError < NameError
8
8
  end
9
-
9
+
10
10
  class Core
11
11
  attr_accessor :settings, :campfire, :room
12
12
 
@@ -43,7 +43,7 @@ module Capistrano
43
43
  end
44
44
 
45
45
  def play(sound)
46
- room.play(sound)
46
+ room.sound(sound)
47
47
  end
48
48
 
49
49
  def paste(text)
@@ -54,18 +54,27 @@ module Capistrano
54
54
  @campfire ||= connect_to_campfire
55
55
  end
56
56
 
57
- def connect_to_campfire
58
- options = {token: settings.campfire.token}
59
- if(!settings.campfire.ssl.nil?)
60
- options[:ssl] = settings.campfire.ssl
61
- end
57
+ def find_campfire_room(room_id)
58
+ broach_settings = {
59
+ 'account' => settings.campfire.domain,
60
+ 'token' => settings.campfire.token
61
+ }
62
62
 
63
- if(!settings.campfire.ssl_verify.nil?)
64
- options[:ssl_verify] = settings.campfire.ssl_verify
63
+ if(!settings.campfire.ssl.nil?)
64
+ broach_settings['use_ssl'] = settings.campfire.ssl
65
+ else
66
+ broach_settings['use_ssl'] = true
65
67
  end
66
- Tinder::Campfire.new(settings.campfire.domain,options)
68
+
69
+ Broach.settings = broach_settings
70
+ Broach::Room.find(room_id)
67
71
  end
68
72
 
73
+ def room
74
+ @room ||= find_campfire_room(settings.campfire.room)
75
+ end
76
+
77
+
69
78
  def pre_announce(options = {})
70
79
  self.speak(erberize(settings.pre_deploy.message,'pre_deploy message',options[:binding]))
71
80
  if(!settings.suppress_sounds and settings.pre_deploy.play)
@@ -130,9 +139,7 @@ module Capistrano
130
139
  end
131
140
 
132
141
 
133
- def room
134
- @room ||= campfire.find_room_by_id(settings.campfire.room)
135
- end
142
+
136
143
 
137
144
  def will_do(options = {})
138
145
  puts "Before Deployment:"
@@ -192,11 +199,8 @@ module Capistrano
192
199
 
193
200
  # Takes a period of time in seconds and returns it in human-readable form (down to minutes)
194
201
  # code from http://www.postal-code.com/binarycode/2007/04/04/english-friendly-timespan/
195
- def time_period_to_s(time_period,abbreviated=false,defaultstring = '')
202
+ def time_period_to_s(time_period,abbreviated=false,defaultstring='')
196
203
  out_str = ''
197
- if(time_period.blank?)
198
- return defaultstring
199
- end
200
204
  interval_array = [ [:weeks, 604800], [:days, 86400], [:hours, 3600], [:minutes, 60], [:seconds, 1] ]
201
205
  interval_array.each do |sub|
202
206
  if time_period >= sub[1] then
@@ -211,7 +215,7 @@ module Capistrano
211
215
  out_str += time_val.to_s + " #{name}"
212
216
  end
213
217
  end
214
- if(out_str.blank?)
218
+ if(out_str.nil? or out_str.empty?)
215
219
  return defaultstring
216
220
  else
217
221
  return out_str
@@ -2,6 +2,10 @@
2
2
  # Copyright (c) 2012 Jason Adam Young
3
3
  # === LICENSE:
4
4
  # see LICENSE file
5
+
6
+ # TODO: clean this implementation up, not the biggest fan of what
7
+ # I have here.
8
+
5
9
  module Capistrano
6
10
  module Campout
7
11
  class GitUtils
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Campout
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -3,7 +3,7 @@
3
3
  # === LICENSE:
4
4
  # see LICENSE file
5
5
  require 'capistrano'
6
- require 'tinder'
6
+ require 'broach'
7
7
  require 'grit'
8
8
 
9
9
  require 'capistrano-campout/logger'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-campout
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-08 00:00:00.000000000 Z
12
+ date: 2012-04-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
16
- requirement: &70347365888740 !ruby/object:Gem::Requirement
16
+ requirement: &70255309559320 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,21 +21,21 @@ dependencies:
21
21
  version: '2.11'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70347365888740
24
+ version_requirements: *70255309559320
25
25
  - !ruby/object:Gem::Dependency
26
- name: tinder
27
- requirement: &70347365887720 !ruby/object:Gem::Requirement
26
+ name: broach
27
+ requirement: &70255309558780 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
31
31
  - !ruby/object:Gem::Version
32
- version: '1.8'
32
+ version: '0.2'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70347365887720
35
+ version_requirements: *70255309558780
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: grit
38
- requirement: &70347365885720 !ruby/object:Gem::Requirement
38
+ requirement: &70255309558300 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '2.4'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70347365885720
46
+ version_requirements: *70255309558300
47
47
  description: ! " Capistrano::Campout is a gem extension to capistrano to post/speak
48
48
  messages and paste logs from a capistrano deployment \n to a campfire room. Settings
49
49
  are configurable using ERB in a \"config/campout.yml\" or \"config/campout.local.yml\"
@@ -57,6 +57,7 @@ extensions: []
57
57
  extra_rdoc_files: []
58
58
  files:
59
59
  - .gitignore
60
+ - CHANGELOG.md
60
61
  - Gemfile
61
62
  - LICENSE
62
63
  - README.md