Commit e45067af0192eb9acf68006f6512ac51084017e4
1 parent
f2611648
Exists in
master
and in
1 other branch
added campfire tracker
Showing
8 changed files
with
60 additions
and
9 deletions
Show diff stats
Gemfile
@@ -30,6 +30,7 @@ gem 'kaminari' | @@ -30,6 +30,7 @@ gem 'kaminari' | ||
30 | gem 'rack-ssl-enforcer' | 30 | gem 'rack-ssl-enforcer' |
31 | gem 'fabrication', "~> 1.3.0" # Both for tests, and loading demo data | 31 | gem 'fabrication', "~> 1.3.0" # Both for tests, and loading demo data |
32 | gem 'rails_autolink', '~> 1.0.9' | 32 | gem 'rails_autolink', '~> 1.0.9' |
33 | +gem 'campy' | ||
33 | 34 | ||
34 | platform :ruby do | 35 | platform :ruby do |
35 | gem 'mongo', '= 1.3.1' | 36 | gem 'mongo', '= 1.3.1' |
@@ -45,7 +46,7 @@ group :development, :test do | @@ -45,7 +46,7 @@ group :development, :test do | ||
45 | gem 'webmock', :require => false | 46 | gem 'webmock', :require => false |
46 | unless ENV["CI"] | 47 | unless ENV["CI"] |
47 | gem 'ruby-debug', :platform => :mri_18 | 48 | gem 'ruby-debug', :platform => :mri_18 |
48 | - gem 'debugger', :platform => :mri_19 | 49 | + gem (RUBY_VERSION == "1.9.2" ? 'ruby-debug19' : 'debugger'), :platform => :mri_19 |
49 | end | 50 | end |
50 | # gem 'rpm_contrib', :git => "git://github.com/bensymonds/rpm_contrib.git", :branch => "mongo-1.4.0_update" | 51 | # gem 'rpm_contrib', :git => "git://github.com/bensymonds/rpm_contrib.git", :branch => "mongo-1.4.0_update" |
51 | end | 52 | end |
Gemfile.lock
@@ -34,11 +34,14 @@ GEM | @@ -34,11 +34,14 @@ GEM | ||
34 | i18n (~> 0.6) | 34 | i18n (~> 0.6) |
35 | multi_json (~> 1.0) | 35 | multi_json (~> 1.0) |
36 | addressable (2.2.8) | 36 | addressable (2.2.8) |
37 | + archive-tar-minitar (0.5.2) | ||
37 | arel (3.0.2) | 38 | arel (3.0.2) |
38 | bcrypt-ruby (3.0.1) | 39 | bcrypt-ruby (3.0.1) |
39 | bson (1.3.1) | 40 | bson (1.3.1) |
40 | bson_ext (1.3.1) | 41 | bson_ext (1.3.1) |
41 | builder (3.0.0) | 42 | builder (3.0.0) |
43 | + campy (0.1.3) | ||
44 | + multi_json (~> 1.0) | ||
42 | capybara (1.1.2) | 45 | capybara (1.1.2) |
43 | mime-types (>= 1.16) | 46 | mime-types (>= 1.16) |
44 | nokogiri (>= 1.3.3) | 47 | nokogiri (>= 1.3.3) |
@@ -55,13 +58,6 @@ GEM | @@ -55,13 +58,6 @@ GEM | ||
55 | rdoc | 58 | rdoc |
56 | daemons (1.1.8) | 59 | daemons (1.1.8) |
57 | database_cleaner (0.6.7) | 60 | database_cleaner (0.6.7) |
58 | - debugger (1.1.3) | ||
59 | - columnize (>= 0.3.1) | ||
60 | - debugger-linecache (~> 1.1.1) | ||
61 | - debugger-ruby_core_source (~> 1.1.2) | ||
62 | - debugger-linecache (1.1.1) | ||
63 | - debugger-ruby_core_source (>= 1.1.1) | ||
64 | - debugger-ruby_core_source (1.1.2) | ||
65 | devise (1.5.3) | 61 | devise (1.5.3) |
66 | bcrypt-ruby (~> 3.0) | 62 | bcrypt-ruby (~> 3.0) |
67 | orm_adapter (~> 0.0.3) | 63 | orm_adapter (~> 0.0.3) |
@@ -112,6 +108,8 @@ GEM | @@ -112,6 +108,8 @@ GEM | ||
112 | activesupport (>= 3.0.0) | 108 | activesupport (>= 3.0.0) |
113 | linecache (0.46) | 109 | linecache (0.46) |
114 | rbx-require-relative (> 0.0.4) | 110 | rbx-require-relative (> 0.0.4) |
111 | + linecache19 (0.5.13) | ||
112 | + ruby_core_source (>= 0.1.4) | ||
115 | mail (2.4.4) | 113 | mail (2.4.4) |
116 | i18n (>= 0.4.0) | 114 | i18n (>= 0.4.0) |
117 | mime-types (~> 1.16) | 115 | mime-types (~> 1.16) |
@@ -219,8 +217,18 @@ GEM | @@ -219,8 +217,18 @@ GEM | ||
219 | ruby-debug-base (~> 0.10.4.0) | 217 | ruby-debug-base (~> 0.10.4.0) |
220 | ruby-debug-base (0.10.4) | 218 | ruby-debug-base (0.10.4) |
221 | linecache (>= 0.3) | 219 | linecache (>= 0.3) |
220 | + ruby-debug-base19 (0.11.25) | ||
221 | + columnize (>= 0.3.1) | ||
222 | + linecache19 (>= 0.5.11) | ||
223 | + ruby_core_source (>= 0.1.4) | ||
224 | + ruby-debug19 (0.11.6) | ||
225 | + columnize (>= 0.3.1) | ||
226 | + linecache19 (>= 0.5.11) | ||
227 | + ruby-debug-base19 (>= 0.11.19) | ||
222 | ruby-fogbugz (0.1.1) | 228 | ruby-fogbugz (0.1.1) |
223 | crack | 229 | crack |
230 | + ruby_core_source (0.1.5) | ||
231 | + archive-tar-minitar (>= 0.5.2) | ||
224 | rubyzip (0.9.8) | 232 | rubyzip (0.9.8) |
225 | selenium-webdriver (2.21.2) | 233 | selenium-webdriver (2.21.2) |
226 | childprocess (>= 0.2.5) | 234 | childprocess (>= 0.2.5) |
@@ -269,9 +277,9 @@ DEPENDENCIES | @@ -269,9 +277,9 @@ DEPENDENCIES | ||
269 | actionmailer_inline_css (~> 1.3.0) | 277 | actionmailer_inline_css (~> 1.3.0) |
270 | bson (= 1.3.1) | 278 | bson (= 1.3.1) |
271 | bson_ext (= 1.3.1) | 279 | bson_ext (= 1.3.1) |
280 | + campy | ||
272 | capybara | 281 | capybara |
273 | database_cleaner (~> 0.6.0) | 282 | database_cleaner (~> 0.6.0) |
274 | - debugger | ||
275 | devise (~> 1.5.3) | 283 | devise (~> 1.5.3) |
276 | email_spec | 284 | email_spec |
277 | execjs | 285 | execjs |
@@ -299,6 +307,7 @@ DEPENDENCIES | @@ -299,6 +307,7 @@ DEPENDENCIES | ||
299 | rspec (~> 2.6) | 307 | rspec (~> 2.6) |
300 | rspec-rails (~> 2.6) | 308 | rspec-rails (~> 2.6) |
301 | ruby-debug | 309 | ruby-debug |
310 | + ruby-debug19 | ||
302 | ruby-fogbugz | 311 | ruby-fogbugz |
303 | therubyracer | 312 | therubyracer |
304 | thin | 313 | thin |
1.57 KB
1.61 KB
1.57 KB
app/assets/stylesheets/issue_tracker_icons.css.erb
1 | /* Issue Tracker inactive, select, create and goto icons */ | 1 | /* Issue Tracker inactive, select, create and goto icons */ |
2 | <% trackers = IssueTracker.subclasses.map{|t| t.label } << 'none' %> | 2 | <% trackers = IssueTracker.subclasses.map{|t| t.label } << 'none' %> |
3 | + | ||
3 | <% trackers.each do |tracker| %> | 4 | <% trackers.each do |tracker| %> |
4 | div.issue_tracker.nested label.<%= tracker %> { | 5 | div.issue_tracker.nested label.<%= tracker %> { |
5 | background: url(/assets/<%= tracker %>_inactive.png) no-repeat; | 6 | background: url(/assets/<%= tracker %>_inactive.png) no-repeat; |
app/models/issue_tracker.rb
@@ -14,6 +14,7 @@ class IssueTracker | @@ -14,6 +14,7 @@ class IssueTracker | ||
14 | field :username, :type => String | 14 | field :username, :type => String |
15 | field :password, :type => String | 15 | field :password, :type => String |
16 | field :ticket_properties, :type => String | 16 | field :ticket_properties, :type => String |
17 | + field :room_id, :type => String | ||
17 | 18 | ||
18 | validate :check_params | 19 | validate :check_params |
19 | 20 |
@@ -0,0 +1,39 @@ | @@ -0,0 +1,39 @@ | ||
1 | +class IssueTrackers::CampfireTracker < IssueTracker | ||
2 | + Label = "campfire" | ||
3 | + Fields = [ | ||
4 | + [:account, { | ||
5 | + :placeholder => "Campfire Subdomain" | ||
6 | + }], | ||
7 | + [:api_token, { | ||
8 | + :placeholder => "API Token" | ||
9 | + }], | ||
10 | + [:project_id, { | ||
11 | + :placeholder => "Room ID", | ||
12 | + :label => "Room ID", | ||
13 | + }], | ||
14 | + ] | ||
15 | + | ||
16 | + def check_params | ||
17 | + if Fields.detect {|f| self[f[0]].blank? } | ||
18 | + errors.add :base, 'You must specify your Campfire subdomain, API token and Room ID' | ||
19 | + end | ||
20 | + end | ||
21 | + | ||
22 | + def create_issue(problem, reported_by = nil) | ||
23 | + # build the campfire client | ||
24 | + campy = Campy::Room.new(:account => account, :token => api_token, :room_id => project_id) | ||
25 | + | ||
26 | + # post the issue to the campfire room | ||
27 | + campy.paste issue_title problem | ||
28 | + | ||
29 | + # update the problem to say where it was sent | ||
30 | + problem.update_attributes( | ||
31 | + :issue_link => "Sent to Campfire", | ||
32 | + :issue_type => Label | ||
33 | + ) | ||
34 | + end | ||
35 | + | ||
36 | + def url | ||
37 | + "http://#{account}.campfirenow.com" | ||
38 | + end | ||
39 | +end | ||
0 | \ No newline at end of file | 40 | \ No newline at end of file |