flowdock 0.1.2 → 0.1.3

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.
@@ -5,12 +5,16 @@ require 'cgi'
5
5
 
6
6
  Capistrano::Configuration.instance(:must_exist).load do
7
7
  set :flowdock_send_notification, false
8
-
9
- set(:current_branch) do
10
- capture("cat #{current_path}/BRANCH").chomp rescue "master"
11
- end
12
8
 
13
9
  namespace :flowdock do
10
+ task :read_current_deployed_branch do
11
+ set :current_branch, capture("cat #{current_path}/BRANCH").chomp rescue "master"
12
+ end
13
+
14
+ task :save_deployed_branch do
15
+ run "echo '#{source.head}' > #{current_path}/BRANCH"
16
+ end
17
+
14
18
  task :set_flowdock_api do
15
19
  set :rails_env, (!stage.nil?) ? stage : ENV['RAILS_ENV']
16
20
  set :repo, Grit::Repo.new(".")
@@ -33,7 +37,7 @@ Capistrano::Configuration.instance(:must_exist).load do
33
37
  end
34
38
 
35
39
  def notification_message
36
- if branch == current_branch || stage == :production
40
+ if branch == current_branch
37
41
  message = "<p>The following changes were just deployed to #{rails_env}:</p>"
38
42
  commits = repo.commits_between(previous_revision, current_revision).reverse
39
43
 
@@ -57,6 +61,8 @@ Capistrano::Configuration.instance(:must_exist).load do
57
61
  end
58
62
 
59
63
  before "deploy", "flowdock:trigger_notification"
64
+ before "deploy", "flowdock:read_current_deployed_branch"
60
65
  before "flowdock:notify_deploy_finished", "flowdock:set_flowdock_api"
61
66
  after "deploy", "flowdock:notify_deploy_finished"
67
+ after "deploy", "flowdock:save_deployed_branch"
62
68
  end
@@ -1,3 +1,3 @@
1
1
  module Flowdock
2
- GEM_VERSION = "0.1.2"
2
+ GEM_VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flowdock
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - anttipitkanen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-13 00:00:00 Z
18
+ date: 2011-09-22 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: httparty