Commit df20cb1a21929aa8c074c796705880f585264a98
1 parent
d9b71184
Exists in
master
and in
1 other branch
ping campfire if theres a notice
Showing
5 changed files
with
19 additions
and
2 deletions
Show diff stats
Gemfile
Gemfile.lock
| ... | ... | @@ -68,6 +68,7 @@ GEM |
| 68 | 68 | rspec (~> 2.0) |
| 69 | 69 | erubis (2.7.0) |
| 70 | 70 | eventmachine (0.12.10) |
| 71 | + excon (0.15.5) | |
| 71 | 72 | execjs (1.4.0) |
| 72 | 73 | multi_json (~> 1.0) |
| 73 | 74 | fabrication (1.3.2) |
| ... | ... | @@ -81,6 +82,14 @@ GEM |
| 81 | 82 | libxml-ruby (~> 2.0) |
| 82 | 83 | has_scope (0.5.1) |
| 83 | 84 | hashie (1.2.0) |
| 85 | + heroku (2.30.1) | |
| 86 | + heroku-api (~> 0.3.1) | |
| 87 | + launchy (>= 0.3.2) | |
| 88 | + netrc (~> 0.7.5) | |
| 89 | + rest-client (~> 1.6.1) | |
| 90 | + rubyzip | |
| 91 | + heroku-api (0.3.2) | |
| 92 | + excon (~> 0.15.5) | |
| 84 | 93 | hike (1.2.1) |
| 85 | 94 | hoptoad_notifier (2.4.11) |
| 86 | 95 | activesupport |
| ... | ... | @@ -128,6 +137,7 @@ GEM |
| 128 | 137 | railties (>= 3.0.0) |
| 129 | 138 | multi_json (1.3.6) |
| 130 | 139 | multipart-post (1.1.5) |
| 140 | + netrc (0.7.5) | |
| 131 | 141 | nokogiri (1.5.0) |
| 132 | 142 | oa-core (0.3.2) |
| 133 | 143 | oauth2 (0.5.2) |
| ... | ... | @@ -285,6 +295,7 @@ DEPENDENCIES |
| 285 | 295 | execjs |
| 286 | 296 | fabrication (~> 1.3.0) |
| 287 | 297 | haml |
| 298 | + heroku | |
| 288 | 299 | hoptoad_notifier (~> 2.4) |
| 289 | 300 | htmlentities (~> 4.3.0) |
| 290 | 301 | inherited_resources | ... | ... |
app/models/issue_trackers/campfire_tracker.rb
| ... | ... | @@ -24,7 +24,7 @@ class IssueTrackers::CampfireTracker < IssueTracker |
| 24 | 24 | campy = Campy::Room.new(:account => subdomain, :token => api_token, :room_id => project_id) |
| 25 | 25 | |
| 26 | 26 | # post the issue to the campfire room |
| 27 | - campy.paste "[errbit] http://#{Errbit::Config.host}/apps/#{problem.app.id.to_s} #{issue_title problem}" | |
| 27 | + campy.speak "[errbit] http://#{Errbit::Config.host}/apps/#{problem.app.id.to_s} #{issue_title problem}" | |
| 28 | 28 | |
| 29 | 29 | # update the problem to say where it was sent |
| 30 | 30 | problem.update_attributes( | ... | ... |
app/models/notice_observer.rb
| ... | ... | @@ -4,6 +4,11 @@ class NoticeObserver < Mongoid::Observer |
| 4 | 4 | def after_create notice |
| 5 | 5 | return unless should_notify? notice |
| 6 | 6 | |
| 7 | + # if the app has the campfire tracker, post into the chat | |
| 8 | + if notice.app.issue_tracker.class.name == "IssueTrackers::CampfireTracker" | |
| 9 | + app.issue_tracker.create_issue(notice) | |
| 10 | + end | |
| 11 | + | |
| 7 | 12 | Mailer.err_notification(notice).deliver |
| 8 | 13 | end |
| 9 | 14 | ... | ... |
lib/tasks/errbit/demo.rake