post2irc 0.9.1 → 0.9.2

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.
@@ -21,9 +21,14 @@ class SinatraListener < Sinatra::Base
21
21
  @@token == prefix
22
22
  end
23
23
 
24
+ def talk(service, parts)
25
+ parts.insert(0,service)
26
+ Ircbot.report string_cleaner( parts.compact.join(' :: ') )
27
+ end
28
+
24
29
  post "/:prefix" do
25
30
  halt UNAUTHORIZED unless authorized?(params[:prefix])
26
- Ircbot.report string_cleaner(params[:q])
31
+ talk 'custom', [params[:q]]
27
32
  end
28
33
 
29
34
  post "/:prefix/sources/bitbucket/service" do
@@ -36,7 +41,7 @@ class SinatraListener < Sinatra::Base
36
41
  repository_uri=payload['repository']['absolute_url']
37
42
  repository_name=payload['repository']['name']
38
43
 
39
- Ircbot.report string_cleaner( ['bitbucket', repository_name, messages_authors, "#{base_uri}#{repository_uri}"].compact.join(' :: ') )
44
+ talk 'bitbucket', [ repository_name, messages_authors, "#{base_uri}#{repository_uri}"]
40
45
  end
41
46
  end
42
47
 
@@ -50,7 +55,7 @@ class SinatraListener < Sinatra::Base
50
55
  #we get the URLs and remove the /services/v3 so they will be accessed via direct link
51
56
  stories_urls =activity['stories'].map{|s1| s1['story'].map{|s2| s2['url'] } }.flatten.join(' , ').gsub('/services/v3','') rescue nil
52
57
 
53
- Ircbot.report string_cleaner( ['pivotal', event_type, author, description, stories_urls].compact.join(' :: ') )
58
+ talk 'pivotal', [event_type, author, description, stories_urls]
54
59
  end
55
60
  end
56
61
 
@@ -1,4 +1,4 @@
1
1
  module Post2irc
2
- VERSION = "0.9.1"
2
+ VERSION = "0.9.2"
3
3
  end
4
4
 
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.email = ["javier@formatinternet.com"]
10
10
  s.homepage = "http://javier-ramirez.com"
11
11
  s.summary = %q{Post to irc by sending a regular http post to a URL}
12
- s.description = %q{This gem will start a sinatra script that will listen to posts and will publish the contents to an irc channel. No authentication is provided.}
12
+ s.description = %q{This gem will start a sinatra script that will listen to posts and will publish the contents to an irc channel. Simple token authentication is provided. built-in integrations for bitbucket and pivotal tracker web hooks}
13
13
 
14
14
  s.rubyforge_project = "post2irc"
15
15
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: post2irc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-08-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
16
- requirement: &82039780 !ruby/object:Gem::Requirement
16
+ requirement: &81019580 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *82039780
24
+ version_requirements: *81019580
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: cinch
27
- requirement: &82039410 !ruby/object:Gem::Requirement
27
+ requirement: &81019230 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *82039410
35
+ version_requirements: *81019230
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: json
38
- requirement: &82038880 !ruby/object:Gem::Requirement
38
+ requirement: &81018860 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *82038880
46
+ version_requirements: *81018860
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: xml-simple
49
- requirement: &82038320 !ruby/object:Gem::Requirement
49
+ requirement: &81018190 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,9 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *82038320
57
+ version_requirements: *81018190
58
58
  description: This gem will start a sinatra script that will listen to posts and will
59
- publish the contents to an irc channel. No authentication is provided.
59
+ publish the contents to an irc channel. Simple token authentication is provided.
60
+ built-in integrations for bitbucket and pivotal tracker web hooks
60
61
  email:
61
62
  - javier@formatinternet.com
62
63
  executables: