jumpup-hipchat 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c38cab98e288d6f45809c90a6dfa628c18e7ed78
4
- data.tar.gz: eff8dac1f00a69a1fadb2b8bf33a1cf9ebb0f875
3
+ metadata.gz: e983c1913d6010c2721df952d3a7b1b4f1240d3e
4
+ data.tar.gz: 7915bdb75400d9d87266f5cad8edc9e8c9bcf721
5
5
  SHA512:
6
- metadata.gz: 36578d0652ead5f0fef86c3856b0b0fba02c862edeebe7cc21318230c3167512b6d21761d4178c8c430c6dea6afdc296234599b9dc3cccc9dd7d58f25f057bb2
7
- data.tar.gz: c3cbd33e3414f49a6c55036cf696d5498622497cb19cd8c66db28de8a64054deb5602a7ff90a13153e585062cfd11e638ac4ae2f57cc4890b1c237869fa73613
6
+ metadata.gz: 4610c74b8ee61459176859c357c35ba10796015e45f430401408e0c200cf572cf6a4c0d1aba1ab675c99f14e4ef76a5025b20cd26dc959a0c310e19b83db4339
7
+ data.tar.gz: bd003f04d8604e1dc1582bd0eb8230c57462026f1fc35161aad90924650294f5ebb8972ad1bfe7058c620c0b046fc9d77fa8462249e438fec590e0e7d5a8b13a
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.0.0
1
+ ruby-2.1.1
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.1 (Feb 25, 2014)
3
+ ## 0.2.0 (May 16, 2014)
4
+
5
+ ### features
6
+
7
+ - Show branch that is being integrated when posting messages to HipChat [[GH-14]]
8
+
9
+ ## 0.1.1 (Apr 25, 2014)
4
10
 
5
11
  ### bug fixes
6
12
 
@@ -23,6 +29,7 @@
23
29
  The changelog began with version 0.1.0, so any changes prior to that
24
30
  can be seen by reading old git commit messages.
25
31
 
32
+ [GH-14]: https://github.com/Helabs/jumpup-hipchat/pull/14
26
33
  [GH-12]: https://github.com/Helabs/jumpup-hipchat/issues/12
27
34
  [GH-3]: https://github.com/Helabs/jumpup-hipchat/issues/3
28
35
  [GH-2]: https://github.com/Helabs/jumpup-hipchat/issues/2
data/README.md CHANGED
@@ -30,9 +30,7 @@ HIPCHAT_APP_NAME="Your project name" # used on announcement messages
30
30
 
31
31
  ```ruby
32
32
  INTEGRATION_TASKS = %w(
33
- jumpup:heroku:add_remote
34
- jumpup:heroku:check
35
- jumpup:heroku:lock
33
+ jumpup:heroku:start
36
34
  jumpup:hipchat:announce
37
35
  jumpup:start
38
36
  jumpup:bundle_install
@@ -40,8 +38,7 @@ INTEGRATION_TASKS = %w(
40
38
  spec
41
39
  jumpup:coverage_verify
42
40
  jumpup:finish
43
- jumpup:heroku:deploy
44
- jumpup:heroku:unlock
41
+ jumpup:heroku:finish
45
42
  jumpup:hipchat:finish
46
43
  )
47
44
  ```
@@ -0,0 +1,45 @@
1
+ require 'hipchat'
2
+
3
+ module Jumpup
4
+ module Hipchat
5
+ class Integrate
6
+ def self.announce
7
+ instance.announce
8
+ end
9
+
10
+ def self.finish
11
+ instance.finish
12
+ end
13
+
14
+ def self.instance
15
+ @integrate ||= Integrate.new(ENV['HIPCHAT_APP_NAME'], ENV['HIPCHAT_TOKEN'], ENV['HIPCHAT_ROOM'])
16
+ end
17
+
18
+ def initialize(app_name, token, room)
19
+ @app_name = app_name
20
+ @room = room
21
+ @client = ::HipChat::Client.new(token)
22
+ @git_user = `git config --get user.name`.strip
23
+ @git_branch = `git rev-parse --abbrev-ref HEAD`.strip
24
+ end
25
+
26
+ def announce
27
+ send_message "[#{@git_branch}] User #{@git_user} started to integrate project #{@app_name}"
28
+ end
29
+
30
+ def finish
31
+ send_message "[#{@git_branch}] User #{@git_user} finished to integrate project #{@app_name}. Well done pro!"
32
+ end
33
+
34
+ private
35
+
36
+ def send_message(msg)
37
+ begin
38
+ @client[@room].send(@git_user, msg, notify: true)
39
+ rescue => ex
40
+ puts "----> Unable to send message to HipChat room!\n ERROR: #{ex}"
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -1,5 +1,5 @@
1
1
  module Jumpup
2
2
  module Hipchat
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -1,31 +1,15 @@
1
- require 'hipchat'
2
-
3
1
  namespace :jumpup do
4
- # REFACTOR: Extract a separate class with duplicated logic
5
2
  namespace :hipchat do
6
3
  desc "Announce the begining of the integration process to a hipchat room"
7
4
  task :announce do
8
- user = `git config --get user.name`.strip
9
- msg = "User #{user} started to integrate project #{ENV['HIPCHAT_APP_NAME']}"
10
-
11
- client = HipChat::Client.new(ENV['HIPCHAT_TOKEN'])
12
- begin
13
- client[ENV['HIPCHAT_ROOM']].send(user, msg, notify: true)
14
- rescue => ex
15
- puts "----> Unable to send message to HipChat room!\n ERROR: #{ex}"
16
- end
5
+ require 'jumpup-hipchat/integrate'
6
+ Jumpup::Hipchat::Integrate.announce
17
7
  end
18
8
 
9
+ desc "Announce the end of the integration process to a hipchat room"
19
10
  task :finish do
20
- user = `git config --get user.name`.strip
21
- msg = "User #{user} finished to integrate project #{ENV['HIPCHAT_APP_NAME']}. Well done pro!"
22
-
23
- client = HipChat::Client.new(ENV['HIPCHAT_TOKEN'])
24
- begin
25
- client[ENV['HIPCHAT_ROOM']].send(user, msg, notify: true)
26
- rescue => ex
27
- puts "----> Unable to send message to HipChat room!\n ERROR: #{ex}"
28
- end
11
+ require 'jumpup-hipchat/integrate'
12
+ Jumpup::Hipchat::Integrate.finish
29
13
  end
30
14
  end
31
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jumpup-hipchat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - HE:labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-25 00:00:00.000000000 Z
11
+ date: 2014-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -55,6 +55,7 @@ files:
55
55
  - Rakefile
56
56
  - jumpup-hipchat.gemspec
57
57
  - lib/jumpup-hipchat.rb
58
+ - lib/jumpup-hipchat/integrate.rb
58
59
  - lib/jumpup-hipchat/version.rb
59
60
  - lib/tasks/integrate.rake
60
61
  homepage: https://github.com/Helabs/jumpup-hipchat