flowdock 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 24e1cb19dbf59f9a6e46d8bd350acba328186ceb
4
+ data.tar.gz: 1e4a0a89662cf13e4f7f2d494450b356942bb6e6
5
+ SHA512:
6
+ metadata.gz: 892e801cc9d9fa275bad3809f7bdf69fd90060b9f27701c9ffc50fb33c798a688c8d08a6c976439f1aa9a04f94e5780fbaa6deb38eee95603172dbeccfa64485
7
+ data.tar.gz: ae229181dfcebb6c491d42d80181e12dc32a8e96b8122bb58e8f34c744d0ffc5253fefdee099b57890b0d8e5a9763661840b415973f0d43357b4104d8c03bd39
data/.travis.yml CHANGED
@@ -1,4 +1,3 @@
1
1
  rvm:
2
- - 1.8.7
3
2
  - 1.9.3
4
3
  - jruby
data/Gemfile CHANGED
@@ -11,6 +11,6 @@ group :development do
11
11
  gem "rspec", "~> 2.6"
12
12
  gem "webmock"
13
13
  gem "bundler", "~> 1.0"
14
- gem "jeweler", "~> 1.6.4"
14
+ gem "jeweler", ">= 2.0.1"
15
15
  gem "jruby-openssl", :platforms => :jruby
16
16
  end
data/README.md CHANGED
@@ -6,7 +6,7 @@ Ruby Gem for using the Flowdock Push API. See [Push API documentation](http://ww
6
6
 
7
7
  [![Build Status](https://secure.travis-ci.org/flowdock/flowdock-api.png)](http://travis-ci.org/flowdock/flowdock-api)
8
8
 
9
- flowdock gem is tested on Ruby 1.8.7, 1.9.3 and JRuby.
9
+ flowdock gem is tested on Ruby 1.9.3 and JRuby.
10
10
 
11
11
  ## Dependencies
12
12
 
@@ -25,60 +25,59 @@ To post content to Chat or Team Inbox, you need to use the target flow's API tok
25
25
 
26
26
  ### Posting to Chat
27
27
 
28
- require 'rubygems'
29
- require 'flowdock'
28
+ ```ruby
29
+ require 'rubygems'
30
+ require 'flowdock'
30
31
 
31
- # create a new Flow object with target flow's api token and external user name (enough for posting to Chat)
32
- flow = Flowdock::Flow.new(:api_token => "__FLOW_TOKEN__", :external_user_name => "John")
32
+ # create a new Flow object with target flow's api token and external user name (enough for posting to Chat)
33
+ flow = Flowdock::Flow.new(:api_token => "__FLOW_TOKEN__", :external_user_name => "John")
33
34
 
34
- # send message to Chat
35
- flow.push_to_chat(:content => "Hello!", :tags => ["cool", "stuff"])
35
+ # send message to Chat
36
+ flow.push_to_chat(:content => "Hello!", :tags => ["cool", "stuff"])
37
+ ```
36
38
 
37
39
  ### Posting to Team Inbox
38
40
 
39
- # create a new Flow object with target flow's api token and sender information for Team Inbox posting
40
- flow = Flowdock::Flow.new(:api_token => "__FLOW_TOKEN__",
41
- :source => "myapp", :from => {:name => "John Doe", :address => "john.doe@example.com"})
41
+ ```ruby
42
+ # create a new Flow object with target flow's api token and sender information for Team Inbox posting
43
+ flow = Flowdock::Flow.new(:api_token => "__FLOW_TOKEN__",
44
+ :source => "myapp", :from => {:name => "John Doe", :address => "john.doe@example.com"})
42
45
 
43
- # send message to Team Inbox
44
- flow.push_to_team_inbox(:subject => "Greetings from Flowdock API Gem!",
45
- :content => "<h2>It works!</h2><p>Now you can start developing your awesome application for Flowdock.</p>",
46
- :tags => ["cool", "stuff"], :link => "http://www.flowdock.com/")
46
+ # send message to Team Inbox
47
+ flow.push_to_team_inbox(:subject => "Greetings from Flowdock API Gem!",
48
+ :content => "<h2>It works!</h2><p>Now you can start developing your awesome application for Flowdock.</p>",
49
+ :tags => ["cool", "stuff"], :link => "http://www.flowdock.com/")
50
+ ```
47
51
 
48
52
  ### Posting to multiple flows
49
53
 
50
- require 'rubygems'
51
- require 'flowdock'
54
+ ```ruby
55
+ require 'rubygems'
56
+ require 'flowdock'
52
57
 
53
- # create a new Flow object with the api tokens of the target flows
54
- flow = Flowdock::Flow.new(:api_token => ["__FLOW_TOKEN__", "__ANOTHER_FLOW_TOKEN__"], ... )
58
+ # create a new Flow object with the api tokens of the target flows
59
+ flow = Flowdock::Flow.new(:api_token => ["__FLOW_TOKEN__", "__ANOTHER_FLOW_TOKEN__"], ... )
55
60
 
56
- # see above examples of posting to Chat or Team Inbox
61
+ # see above examples of posting to Chat or Team Inbox
62
+ ```
57
63
 
58
64
  ## API methods
59
65
 
60
66
  * Flow methods
61
67
 
62
- *push_to_team_inbox* - Send message to Team Inbox. See [API documentation](http://www.flowdock.com/api/team-inbox) for details.
63
-
64
- *push_to_chat* - Send message to Chat. See [API documentation](http://www.flowdock.com/api/chat) for details.
68
+ `push_to_team_inbox` - Send message to Team Inbox. See [API documentation](http://www.flowdock.com/api/team-inbox) for details.
65
69
 
66
- *send_message(params)* - Deprecated. Please use *push_to_team_inbox* instead.
70
+ `push_to_chat` - Send message to Chat. See [API documentation](http://www.flowdock.com/api/chat) for details.
67
71
 
72
+ `send_message(params)` - Deprecated. Please use `push_to_team_inbox` instead.
68
73
 
69
- ## Capistrano deployment task
70
74
 
71
- The Flowdock API Ruby Gem includes a ready task for sending deployment notifications with Capistrano (you need to have Grit installed too). Just add the task into your deploy.rb file and configure the settings to match your project and flow:
75
+ ## Deployment notifications
72
76
 
73
- ```
74
- require 'flowdock/capistrano'
75
-
76
- # for Flowdock Gem notifications
77
- set :flowdock_project_name, "My project"
78
- set :flowdock_deploy_tags, ["frontend"]
79
- set :flowdock_api_token, ["_YOUR_API_TOKEN_HERE_"]
80
- ```
77
+ There are separate gems for deployment notifications:
81
78
 
79
+ * [capistrano-flowdock](https://github.com/flowdock/capistrano-flowdock)
80
+ * [mina-flowdock](https://github.com/elskwid/mina-flowdock)
82
81
 
83
82
  ## Copyright
84
83
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.4.0
data/flowdock.gemspec CHANGED
@@ -2,14 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: flowdock 0.4.0 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "flowdock"
8
- s.version = "0.3.1"
9
+ s.version = "0.4.0"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
11
13
  s.authors = ["Antti Pitk\u{e4}nen"]
12
- s.date = "2013-04-05"
14
+ s.date = "2014-04-10"
13
15
  s.email = "team@flowdock.com"
14
16
  s.extra_rdoc_files = [
15
17
  "LICENSE",
@@ -32,12 +34,11 @@ Gem::Specification.new do |s|
32
34
  ]
33
35
  s.homepage = "http://github.com/flowdock/flowdock-api"
34
36
  s.licenses = ["MIT"]
35
- s.require_paths = ["lib"]
36
- s.rubygems_version = "1.8.23"
37
+ s.rubygems_version = "2.2.1"
37
38
  s.summary = "Ruby Gem for using Flowdock's API"
38
39
 
39
40
  if s.respond_to? :specification_version then
40
- s.specification_version = 3
41
+ s.specification_version = 4
41
42
 
42
43
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
43
44
  s.add_runtime_dependency(%q<httparty>, ["~> 0.7"])
@@ -46,7 +47,7 @@ Gem::Specification.new do |s|
46
47
  s.add_development_dependency(%q<rspec>, ["~> 2.6"])
47
48
  s.add_development_dependency(%q<webmock>, [">= 0"])
48
49
  s.add_development_dependency(%q<bundler>, ["~> 1.0"])
49
- s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
50
+ s.add_development_dependency(%q<jeweler>, [">= 2.0.1"])
50
51
  s.add_development_dependency(%q<jruby-openssl>, [">= 0"])
51
52
  else
52
53
  s.add_dependency(%q<httparty>, ["~> 0.7"])
@@ -55,7 +56,7 @@ Gem::Specification.new do |s|
55
56
  s.add_dependency(%q<rspec>, ["~> 2.6"])
56
57
  s.add_dependency(%q<webmock>, [">= 0"])
57
58
  s.add_dependency(%q<bundler>, ["~> 1.0"])
58
- s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
59
+ s.add_dependency(%q<jeweler>, [">= 2.0.1"])
59
60
  s.add_dependency(%q<jruby-openssl>, [">= 0"])
60
61
  end
61
62
  else
@@ -65,7 +66,7 @@ Gem::Specification.new do |s|
65
66
  s.add_dependency(%q<rspec>, ["~> 2.6"])
66
67
  s.add_dependency(%q<webmock>, [">= 0"])
67
68
  s.add_dependency(%q<bundler>, ["~> 1.0"])
68
- s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
69
+ s.add_dependency(%q<jeweler>, [">= 2.0.1"])
69
70
  s.add_dependency(%q<jruby-openssl>, [">= 0"])
70
71
  end
71
72
  end
@@ -1,89 +1 @@
1
- require 'flowdock'
2
- require 'digest/md5'
3
- require 'cgi'
4
-
5
- Capistrano::Configuration.instance(:must_exist).load do
6
-
7
- namespace :flowdock do
8
- task :read_current_deployed_branch do
9
- current_branch = capture("cat #{current_path}/BRANCH").chomp rescue "master"
10
- set :current_branch, current_branch
11
- end
12
-
13
- task :save_deployed_branch do
14
- begin
15
- run "echo '#{source.head.chomp}' > #{current_path}/BRANCH"
16
- rescue => e
17
- puts "Flowdock: error in saving deployed branch information: #{e.to_s}"
18
- end
19
- end
20
-
21
- task :set_flowdock_api do
22
- set :flowdock_deploy_env, fetch(:stage, fetch(:rails_env, ENV["RAILS_ENV"] || "production"))
23
- begin
24
- require 'grit'
25
- set :repo, Grit::Repo.new(".")
26
- config = Grit::Config.new(repo)
27
- rescue LoadError => e
28
- puts "Flowdock: you need to have Grit gem installed: #{e.to_s}"
29
- rescue => e
30
- puts "Flowdock: error in fetching your git repository information: #{e.to_s}"
31
- end
32
-
33
- begin
34
- flows = Array(flowdock_api_token).map do |api_token|
35
- Flowdock::Flow.new(:api_token => api_token,
36
- :source => "Capistrano deployment", :project => flowdock_project_name,
37
- :from => {:name => config["user.name"], :address => config["user.email"]})
38
- end
39
- set :flowdock_api, flows
40
- rescue => e
41
- puts "Flowdock: error in configuring Flowdock API: #{e.to_s}"
42
- end
43
- end
44
-
45
- task :notify_deploy_finished do
46
- # send message to the flow
47
- begin
48
- flowdock_api.each do |flow|
49
- flow.push_to_team_inbox(:format => "html",
50
- :subject => "#{flowdock_project_name} deployed with branch #{branch} on ##{flowdock_deploy_env}",
51
- :content => notification_message,
52
- :tags => ["deploy", "#{flowdock_deploy_env}"] | flowdock_deploy_tags)
53
- end
54
- rescue => e
55
- puts "Flowdock: error in sending notification to your flow: #{e.to_s}"
56
- end
57
- end
58
-
59
- def notification_message
60
- if branch == current_branch
61
- message = "<p>The following changes were just deployed to #{flowdock_deploy_env}:</p>"
62
- commits = repo.commits_between(previous_revision, current_revision).reverse
63
-
64
- unless commits.empty?
65
- commits.each do |c|
66
- short, long = c.message.split(/\n+/, 2)
67
- message << "\n<div style=\"margin-bottom: 10px\"><div style=\"height:30px;width:30px;float:left;margin-right:5px;\"><img src=\"https://secure.gravatar.com/avatar/#{Digest::MD5::hexdigest(c.author.email.downcase)}?s=30\" /></div>"
68
- message << "<div style=\"padding-left: 35px;\">#{CGI.escapeHTML(short)}<br/>"
69
- if long
70
- long.gsub!(/\n/, '<br />')
71
- message << '<p style="margin:5px 0px; padding: 0 5px; border-left: 3px solid #ccc">' + long + '</p>'
72
- end
73
- message << "<span style=\"font-size: 90%; color: #333\"><code>#{c.id_abbrev}</code> <a href=\"mailto:#{CGI.escapeHTML(c.author.email)}\">#{CGI.escapeHTML(c.author.name)}</a> on #{c.authored_date.strftime("%b %d, %H:%M")}</span></div></div>"
74
- end
75
- end
76
- else
77
- message = "Branch #{source.head} was deployed to #{flowdock_deploy_env}. Previously deployed branch was #{current_branch}."
78
- end
79
- message
80
- end
81
- end
82
-
83
- before "deploy:update_code", "flowdock:read_current_deployed_branch"
84
- before "flowdock:notify_deploy_finished", "flowdock:set_flowdock_api"
85
- ["deploy", "deploy:migrations"].each do |task|
86
- after task, "flowdock:notify_deploy_finished"
87
- after task, "flowdock:save_deployed_branch"
88
- end
89
- end
1
+ warn "Capistrano notifier has been extracted to `capistrano-flowdock` gem"
metadata CHANGED
@@ -1,144 +1,127 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flowdock
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.3.1
4
+ version: 0.4.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Antti Pitkänen
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-05 00:00:00.000000000 Z
11
+ date: 2014-04-10 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- version_requirements: !ruby/object:Gem::Requirement
16
- none: false
17
- requirements:
18
- - - ~>
19
- - !ruby/object:Gem::Version
20
- version: '0.7'
21
14
  name: httparty
22
- prerelease: false
23
15
  requirement: !ruby/object:Gem::Requirement
24
- none: false
25
16
  requirements:
26
- - - ~>
17
+ - - "~>"
27
18
  - !ruby/object:Gem::Version
28
19
  version: '0.7'
29
20
  type: :runtime
30
- - !ruby/object:Gem::Dependency
21
+ prerelease: false
31
22
  version_requirements: !ruby/object:Gem::Requirement
32
- none: false
33
23
  requirements:
34
- - - ! '>='
24
+ - - "~>"
35
25
  - !ruby/object:Gem::Version
36
- version: '0'
26
+ version: '0.7'
27
+ - !ruby/object:Gem::Dependency
37
28
  name: multi_json
38
- prerelease: false
39
29
  requirement: !ruby/object:Gem::Requirement
40
- none: false
41
30
  requirements:
42
- - - ! '>='
31
+ - - ">="
43
32
  - !ruby/object:Gem::Version
44
33
  version: '0'
45
34
  type: :runtime
46
- - !ruby/object:Gem::Dependency
35
+ prerelease: false
47
36
  version_requirements: !ruby/object:Gem::Requirement
48
- none: false
49
37
  requirements:
50
- - - ! '>='
38
+ - - ">="
51
39
  - !ruby/object:Gem::Version
52
- version: 2.4.2
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
53
42
  name: rdoc
54
- prerelease: false
55
43
  requirement: !ruby/object:Gem::Requirement
56
- none: false
57
44
  requirements:
58
- - - ! '>='
45
+ - - ">="
59
46
  - !ruby/object:Gem::Version
60
47
  version: 2.4.2
61
48
  type: :development
62
- - !ruby/object:Gem::Dependency
49
+ prerelease: false
63
50
  version_requirements: !ruby/object:Gem::Requirement
64
- none: false
65
51
  requirements:
66
- - - ~>
52
+ - - ">="
67
53
  - !ruby/object:Gem::Version
68
- version: '2.6'
54
+ version: 2.4.2
55
+ - !ruby/object:Gem::Dependency
69
56
  name: rspec
70
- prerelease: false
71
57
  requirement: !ruby/object:Gem::Requirement
72
- none: false
73
58
  requirements:
74
- - - ~>
59
+ - - "~>"
75
60
  - !ruby/object:Gem::Version
76
61
  version: '2.6'
77
62
  type: :development
78
- - !ruby/object:Gem::Dependency
63
+ prerelease: false
79
64
  version_requirements: !ruby/object:Gem::Requirement
80
- none: false
81
65
  requirements:
82
- - - ! '>='
66
+ - - "~>"
83
67
  - !ruby/object:Gem::Version
84
- version: '0'
68
+ version: '2.6'
69
+ - !ruby/object:Gem::Dependency
85
70
  name: webmock
86
- prerelease: false
87
71
  requirement: !ruby/object:Gem::Requirement
88
- none: false
89
72
  requirements:
90
- - - ! '>='
73
+ - - ">="
91
74
  - !ruby/object:Gem::Version
92
75
  version: '0'
93
76
  type: :development
94
- - !ruby/object:Gem::Dependency
77
+ prerelease: false
95
78
  version_requirements: !ruby/object:Gem::Requirement
96
- none: false
97
79
  requirements:
98
- - - ~>
80
+ - - ">="
99
81
  - !ruby/object:Gem::Version
100
- version: '1.0'
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
101
84
  name: bundler
102
- prerelease: false
103
85
  requirement: !ruby/object:Gem::Requirement
104
- none: false
105
86
  requirements:
106
- - - ~>
87
+ - - "~>"
107
88
  - !ruby/object:Gem::Version
108
89
  version: '1.0'
109
90
  type: :development
110
- - !ruby/object:Gem::Dependency
91
+ prerelease: false
111
92
  version_requirements: !ruby/object:Gem::Requirement
112
- none: false
113
93
  requirements:
114
- - - ~>
94
+ - - "~>"
115
95
  - !ruby/object:Gem::Version
116
- version: 1.6.4
96
+ version: '1.0'
97
+ - !ruby/object:Gem::Dependency
117
98
  name: jeweler
118
- prerelease: false
119
99
  requirement: !ruby/object:Gem::Requirement
120
- none: false
121
100
  requirements:
122
- - - ~>
101
+ - - ">="
123
102
  - !ruby/object:Gem::Version
124
- version: 1.6.4
103
+ version: 2.0.1
125
104
  type: :development
126
- - !ruby/object:Gem::Dependency
105
+ prerelease: false
127
106
  version_requirements: !ruby/object:Gem::Requirement
128
- none: false
129
107
  requirements:
130
- - - ! '>='
108
+ - - ">="
131
109
  - !ruby/object:Gem::Version
132
- version: '0'
110
+ version: 2.0.1
111
+ - !ruby/object:Gem::Dependency
133
112
  name: jruby-openssl
134
- prerelease: false
135
113
  requirement: !ruby/object:Gem::Requirement
136
- none: false
137
114
  requirements:
138
- - - ! '>='
115
+ - - ">="
139
116
  - !ruby/object:Gem::Version
140
117
  version: '0'
141
118
  type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
142
125
  description:
143
126
  email: team@flowdock.com
144
127
  executables: []
@@ -147,9 +130,9 @@ extra_rdoc_files:
147
130
  - LICENSE
148
131
  - README.md
149
132
  files:
150
- - .document
151
- - .rspec
152
- - .travis.yml
133
+ - ".document"
134
+ - ".rspec"
135
+ - ".travis.yml"
153
136
  - Gemfile
154
137
  - LICENSE
155
138
  - README.md
@@ -163,29 +146,25 @@ files:
163
146
  homepage: http://github.com/flowdock/flowdock-api
164
147
  licenses:
165
148
  - MIT
149
+ metadata: {}
166
150
  post_install_message:
167
151
  rdoc_options: []
168
152
  require_paths:
169
153
  - lib
170
154
  required_ruby_version: !ruby/object:Gem::Requirement
171
- none: false
172
155
  requirements:
173
- - - ! '>='
156
+ - - ">="
174
157
  - !ruby/object:Gem::Version
175
- segments:
176
- - 0
177
- hash: 2786572984791329864
178
158
  version: '0'
179
159
  required_rubygems_version: !ruby/object:Gem::Requirement
180
- none: false
181
160
  requirements:
182
- - - ! '>='
161
+ - - ">="
183
162
  - !ruby/object:Gem::Version
184
163
  version: '0'
185
164
  requirements: []
186
165
  rubyforge_project:
187
- rubygems_version: 1.8.23
166
+ rubygems_version: 2.2.1
188
167
  signing_key:
189
- specification_version: 3
168
+ specification_version: 4
190
169
  summary: Ruby Gem for using Flowdock's API
191
170
  test_files: []