hipcow 1.0.0

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/hipcow.rb +23 -0
  3. metadata +72 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 16608b94819b55615f015e5dc24f4208fb419f38
4
+ data.tar.gz: 4d2450032a4279f74285721c557a1f11765781be
5
+ SHA512:
6
+ metadata.gz: 3ce8c6716ddcbc2de7f6d6eecbe8a75f3946521cd2c615d0f241a1bcd1df728e73df5ec059bb106e257922f49918b35b3fd3d11e886d51640205a876bbc7b9aa
7
+ data.tar.gz: 9148b6d6f61f545ca67f5be242cb818117ab1405db6360125379f563469189003ec4f9a04371f5e68f74b829e65cb40a270a76f40365a18a353eaad9295b9ed4
@@ -0,0 +1,23 @@
1
+ require 'hipchat-api'
2
+ require 'ruby_cowsay'
3
+
4
+ class Hipcow
5
+ def initialize(api_key, cow = 'default', notify = 0, name = 'Hipcow', color = 'random')
6
+ @hipchat_client = HipChat::API.new(api_key)
7
+ @cow = Cow.new({cow: cow})
8
+ @notify = notify
9
+ @name = name
10
+ @color = color
11
+ end
12
+
13
+ def get_rooms
14
+ @hipchat_client.rooms_list
15
+ end
16
+
17
+ def say(room_id, message)
18
+ cow_text = @cow.say(message)
19
+ cow_html = '<pre style="font-size: 18px;margin-left: 40px;display: block;font-family: monospace;white-space: pre;margin: 1em 0px;">' +
20
+ cow_text +'</pre>'
21
+ @hipchat_client.rooms_message(room_id, @name, cow_html, notify = @notify, color = @color, message_format = 'html')
22
+ end
23
+ end
metadata ADDED
@@ -0,0 +1,72 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hipcow
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Khanh Nguyen
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: hipchat-api
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 1.0.6
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.0.6
27
+ - !ruby/object:Gem::Dependency
28
+ name: ruby_cowsay
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 0.1.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 0.1.1
41
+ description: Become the cow whisperer on Hipchat... Or at least a whispering cow...
42
+ email: khanhplications@gmail.com
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files: []
46
+ files:
47
+ - lib/hipcow.rb
48
+ homepage: https://github.com/khanh2907/hipcow
49
+ licenses:
50
+ - MIT
51
+ metadata: {}
52
+ post_install_message:
53
+ rdoc_options: []
54
+ require_paths:
55
+ - lib
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ requirements: []
67
+ rubyforge_project:
68
+ rubygems_version: 2.4.5
69
+ signing_key:
70
+ specification_version: 4
71
+ summary: cowsay for Hipchat
72
+ test_files: []