hipchat 0.10.1 → 0.11.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: bb03d2f22ec6f6322984e7553499d1afc92f66ac
4
- data.tar.gz: f420d48473496bab159eadba9427ad1a08c43069
3
+ metadata.gz: b14a3d503b8dd0e2328c0428d84ce558d8610997
4
+ data.tar.gz: 149915edf47032db069730107a43b85e00a57dfe
5
5
  SHA512:
6
- metadata.gz: 4ff0d6d246094a422292ca917538bcda73aad8433a3108560a9008ba930013535cfca235496d9e1b9634faa0e3f9974b5080bcacb4ffe238c2098432f4552049
7
- data.tar.gz: 784400c9ee7e6c2eac9f6d2dc776915d56646c423134fe3176785ef1713347ba05ee7835e7074a6bc12eb853956f53f9b47d86dd5a65068b8d6d1c47b0147f4e
6
+ metadata.gz: 2bc937a5155d8c7c7b5f666fec0bec676b26517a8c3b5834faafffa0097b8faab3d742fd66f521ebca98325aadd94c6d8acc7483c69393fb5fc45446ebb57051
7
+ data.tar.gz: 3f03b59bb670761e06120cfc91e84e497b20418e7e9c7aa9b29d60ed1a14cfe73fbe0de0fd453f7be17b07d2beebb5d046e8639eb69fb3771671f5a664fbf848
@@ -26,7 +26,7 @@ client['my room'].topic('Free Ice Cream in the kitchen')
26
26
  # Change the from field for a topic update (default "API")
27
27
  client['my room'].topic('Weekely sales: $10,000', :from => 'Sales Team')
28
28
 
29
- # Get history from a room
29
+ # Get history from a room
30
30
  client['my room'].history()
31
31
 
32
32
  # Get history for a date in time with a particular timezone (default is latest 75 messages, timezone default is 'UTC')
@@ -60,6 +60,10 @@ Send a message using a rake task:
60
60
 
61
61
  bc. rake hipchat:send["hello world"]
62
62
 
63
+ or
64
+
65
+ bc. rake hipchat:send MESSAGE="hello world"
66
+
63
67
  Options like the room, API token, user name and notification flag can be set in YAML.
64
68
 
65
69
  RAILS_ROOT/config/hipchat.yml:
@@ -65,13 +65,7 @@ Capistrano::Configuration.instance(:must_exist).load do
65
65
  rooms.each { |room|
66
66
  begin
67
67
  hipchat_client[room].send(deploy_user, message, options)
68
- rescue UnknownRoom => e
69
- puts e.message
70
- puts e.backtrace
71
- rescue Unauthorized => e
72
- puts e.message
73
- puts e.backtrace
74
- rescue UnknownResponseCode => e
68
+ rescue => e
75
69
  puts e.message
76
70
  puts e.backtrace
77
71
  end
@@ -2,7 +2,7 @@ require 'hipchat'
2
2
 
3
3
  namespace :hipchat do
4
4
  desc "Sends a HipChat message as a particular user"
5
- task :send do
5
+ task :send, [:message] do |t, args|
6
6
  required_options = [:message, :room, :token, :user]
7
7
  config_file = Rails.root.join 'config', 'hipchat.yml'
8
8
 
@@ -14,16 +14,21 @@ namespace :hipchat do
14
14
  :room => ENV['ROOM'],
15
15
  :token => ENV['TOKEN']
16
16
  }.reject { |k, v| v.blank? }
17
-
17
+
18
18
  system_options = {
19
19
  :user => ENV['USER']
20
20
  }.reject { |k, v| v.blank? }
21
21
 
22
+ argument_options = {
23
+ :message => args.message
24
+ }.reject { |k, v| v.blank? }
25
+
22
26
  if File.exists? config_file
23
27
  options.reverse_merge! YAML.load_file(config_file).symbolize_keys
24
28
  end
25
-
29
+
26
30
  options.reverse_merge! system_options
31
+ options.merge! argument_options
27
32
 
28
33
  options[:notify] = options[:notify].to_s != 'false'
29
34
 
@@ -1,3 +1,3 @@
1
1
  module HipChat
2
- VERSION = "0.10.1"
2
+ VERSION = "0.11.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hipchat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - HipChat/Atlassian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-15 00:00:00.000000000 Z
11
+ date: 2013-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty