janky 0.11.0 → 0.11.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4e36e0fb610583f88d64b504993cb6c57305e15
4
- data.tar.gz: 827b6fa7764586c70852a679a4a9fcab23d18601
3
+ metadata.gz: 58d52422d4f7c22902eeeff06e8b63671fa21594
4
+ data.tar.gz: a65162a5e523477f2c0ecd29d2db9d97c6318295
5
5
  SHA512:
6
- metadata.gz: 4546417aef772b7d387ec7808631c16d1869d202569ed316fa93bbf862fd34242492a1e691dbc58b125be088d11b2dc3f1b1d82754308f56afc1d9c7bfec2749
7
- data.tar.gz: 4ee74b538771d5b05da1f4d10388f996749cd7b6daaaeb136771dd8f66af0e88e0fcd3557736bbbe70920e732e1c0fa19fbaa254b932f8e82ef94d6843043cb9
6
+ metadata.gz: 3416367277f1c30ab0609b74f99f9a667b4385be56f611bce7fa26698866d6f4aa6d9bf79db0db2ddda752160774d0b839bc210db4f84943550e562ef1558fd1
7
+ data.tar.gz: 62e67c8e6719ccd9082dc2bcac8eee5edd0af591097f8fae1da50f5696123e16598a9bd9fc601b319beba2c2f00d65724244dcc2fe177f44a6d6236ebf2deb26
data/CHANGES CHANGED
@@ -1,3 +1,7 @@
1
+ = 0.11.1 / 2015-02-20
2
+ * Update gemspec to include the hubot chat service files
3
+ * Update recommended Jenkins version in the README
4
+
1
5
  = 0.11.0 / 2014-11-14
2
6
 
3
7
  * Add support for Slack chat rooms
data/README.md CHANGED
@@ -48,7 +48,7 @@ Of a specific branch:
48
48
 
49
49
  hubot ci build janky/libgit2
50
50
 
51
- Different builds aren't relevant to the same Campfire room and so Janky
51
+ Different builds aren't relevant to the same chat room and so Janky
52
52
  lets you choose where notifications are sent to. First get a list of
53
53
  available rooms:
54
54
 
@@ -79,7 +79,7 @@ Installing
79
79
 
80
80
  ### Jenkins
81
81
 
82
- Janky requires access to a Jenkins server. Version **1.427** is
82
+ Janky requires access to a Jenkins server. Version **1.580** is
83
83
  recommended. Refer to the Jenkins [documentation][doc] for installation
84
84
  instructions and install the [Notification Plugin][np] version 1.4.
85
85
 
@@ -57,6 +57,7 @@ lib/janky/builder/runner.rb
57
57
  lib/janky/chat_service.rb
58
58
  lib/janky/chat_service/campfire.rb
59
59
  lib/janky/chat_service/hipchat.rb
60
+ lib/janky/chat_service/hubot.rb
60
61
  lib/janky/chat_service/slack.rb
61
62
  lib/janky/chat_service/mock.rb
62
63
  lib/janky/commit.rb
@@ -0,0 +1,52 @@
1
+ module Janky
2
+ module ChatService
3
+ class Hubot
4
+ def initialize(settings)
5
+ @available_rooms = settings["JANKY_CHAT_HUBOT_ROOMS"]
6
+ @default_room = settings["JANKY_CHAT_HUBOT_DEFAULT_ROOM"]
7
+ url = settings["JANKY_CHAT_HUBOT_URL"]
8
+ if url.nil? || url.empty?
9
+ raise Error, "JANKY_CHAT_HUBOT_URL setting is required"
10
+ end
11
+ @url = URI(url)
12
+ end
13
+
14
+ def speak(message, room, options = {:color => "yellow"})
15
+ request(message, room)
16
+ end
17
+
18
+ def rooms
19
+ @available_rooms.split(',').map do |room|
20
+ id, name = room.strip.split(':')
21
+ name ||= id
22
+ Room.new(id, name)
23
+ end
24
+ end
25
+
26
+ def request(message, room)
27
+ room ||= @default_room
28
+ uri = @url
29
+ user = uri.user
30
+ pass = uri.password
31
+ path = uri.path
32
+
33
+ http = Net::HTTP.new(uri.host, uri.port)
34
+ if uri.scheme == "https"
35
+ http.use_ssl = true
36
+ end
37
+
38
+ post = Net::HTTP::Post.new("#{path}/janky")
39
+ post.basic_auth(user, pass) if user && pass
40
+ post["Content-Type"] = "application/json"
41
+ post.body = {:message => message, :room => room}.to_json
42
+ response = http.request(post)
43
+ unless response.code == "200"
44
+ Exception.push_http_response(response)
45
+ raise Error, "Failed to notify"
46
+ end
47
+ end
48
+ end
49
+ end
50
+
51
+ register_chat_service "hubot", ChatService::Hubot
52
+ end
@@ -1,3 +1,3 @@
1
1
  module Janky
2
- VERSION = "0.11.0"
2
+ VERSION = "0.11.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: janky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Rozet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-14 00:00:00.000000000 Z
11
+ date: 2015-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -220,6 +220,7 @@ files:
220
220
  - lib/janky/chat_service.rb
221
221
  - lib/janky/chat_service/campfire.rb
222
222
  - lib/janky/chat_service/hipchat.rb
223
+ - lib/janky/chat_service/hubot.rb
223
224
  - lib/janky/chat_service/mock.rb
224
225
  - lib/janky/chat_service/slack.rb
225
226
  - lib/janky/commit.rb
@@ -302,7 +303,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
302
303
  version: '0'
303
304
  requirements: []
304
305
  rubyforge_project:
305
- rubygems_version: 2.2.0
306
+ rubygems_version: 2.2.2
306
307
  signing_key:
307
308
  specification_version: 4
308
309
  summary: Continuous Integration server built on top of Jenkins and designed for GitHub