cinch-github 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +41 -0
- data/README.md +1 -1
- data/cinch-github.gemspec +2 -2
- data/lib/cinch/plugins/github.rb +7 -0
- data/lib/{cinch-github → cinch/plugins/github}/issue.rb +3 -3
- data/lib/{cinch-github → cinch/plugins/github}/version.rb +1 -1
- data/test/issue_test.rb +14 -10
- data/test/teststrap.rb +1 -1
- metadata +12 -9
- data/lib/cinch-github.rb +0 -7
data/Gemfile.lock
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
cinch-github (0.0.1)
|
5
|
+
cinch
|
6
|
+
octopi
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: http://rubygems.org/
|
10
|
+
specs:
|
11
|
+
api_cache (0.2.0)
|
12
|
+
cinch (1.1.1)
|
13
|
+
crack (0.1.8)
|
14
|
+
httparty (0.7.3)
|
15
|
+
crack (= 0.1.8)
|
16
|
+
mechanize (1.0.0)
|
17
|
+
nokogiri (>= 1.2.1)
|
18
|
+
mocha (0.9.10)
|
19
|
+
rake
|
20
|
+
nokogiri (1.4.4)
|
21
|
+
octopi (0.4.0)
|
22
|
+
api_cache
|
23
|
+
httparty (>= 0.4.5)
|
24
|
+
mechanize (>= 0.9.3)
|
25
|
+
nokogiri (>= 1.3.1)
|
26
|
+
rake (0.8.7)
|
27
|
+
riot (0.12.1)
|
28
|
+
rr
|
29
|
+
term-ansicolor
|
30
|
+
rr (1.0.2)
|
31
|
+
term-ansicolor (1.0.5)
|
32
|
+
|
33
|
+
PLATFORMS
|
34
|
+
ruby
|
35
|
+
|
36
|
+
DEPENDENCIES
|
37
|
+
cinch
|
38
|
+
cinch-github!
|
39
|
+
mocha
|
40
|
+
octopi
|
41
|
+
riot (~> 0.12.0)
|
data/README.md
CHANGED
@@ -25,7 +25,7 @@ This plugin manages interaction between Github issues via the Github API.
|
|
25
25
|
|
26
26
|
To setup the Issue plugin to work with your cinch bot, we'll need to provide some info like so:
|
27
27
|
|
28
|
-
Cinch::Github::Issue.configure do |c|
|
28
|
+
Cinch::Plugins::Github::Issue.configure do |c|
|
29
29
|
c.user = 'achiu' # your github username
|
30
30
|
c.token = 'some_token' # your github API token
|
31
31
|
c.author = 'padrino' # your repository author
|
data/cinch-github.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "cinch
|
3
|
+
require "cinch/plugins/github/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "cinch-github"
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
|
-
s.add_dependency 'cinch'
|
22
|
+
s.add_dependency 'cinch', '~>1.1.1'
|
23
23
|
s.add_dependency 'octopi'
|
24
24
|
s.add_development_dependency 'riot', '~>0.12.0'
|
25
25
|
s.add_development_dependency 'mocha'
|
@@ -18,9 +18,9 @@ module Cinch
|
|
18
18
|
end
|
19
19
|
|
20
20
|
match %r{help github issue}, :method => :display_help # !issue help gitub issue
|
21
|
-
match %r{issue state (open|closed) (
|
22
|
-
match %r{issue find (
|
23
|
-
match %r{issue link (
|
21
|
+
match %r{issue state (open|closed) (.+)}, :method => :get_ticket # !issue state closed bugs
|
22
|
+
match %r{issue find (.+)}, :method => :get_ticket # !issue find sinatra
|
23
|
+
match %r{issue link (.+)}, :method => :reply_link # !issue link 35
|
24
24
|
|
25
25
|
# Display Github Issue Help
|
26
26
|
def display_help(m)
|
data/test/issue_test.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
require File.expand_path('../teststrap',__FILE__)
|
2
2
|
|
3
3
|
context "Issue Plugin" do
|
4
|
+
setup do
|
5
|
+
Cinch::Plugins::Github::Issue.stubs(:__register_with_bot).with(any_parameters).returns(true)
|
6
|
+
end
|
7
|
+
|
4
8
|
helper :issue do
|
5
9
|
Cinch::Plugins::Github::Issue.configure do |c|
|
6
10
|
c.user = 'achiu'
|
@@ -19,13 +23,13 @@ context "Issue Plugin" do
|
|
19
23
|
asserts(:repo).equals 'cinch-github'
|
20
24
|
end
|
21
25
|
|
22
|
-
context "matches" do
|
26
|
+
context "matches" do
|
23
27
|
setup do
|
24
28
|
@issue = issue
|
25
29
|
mock_match @issue, %r{help github issue}, :display_help
|
26
30
|
mock_match @issue, %r{issue state (open|closed) (.*)}, :get_ticket
|
27
31
|
mock_match @issue, %r{issue find (.*)}, :get_ticket
|
28
|
-
mock_match @issue, %r{issue link (.*)}, :reply_link
|
32
|
+
mock_match @issue, %r{issue link (.*)}, :reply_link
|
29
33
|
end
|
30
34
|
asserts("that it has matches") { @issue.new(Cinch::Bot.new) }
|
31
35
|
end
|
@@ -63,8 +67,8 @@ context "Issue Plugin" do
|
|
63
67
|
end
|
64
68
|
|
65
69
|
context "#get_ticket" do
|
66
|
-
|
67
|
-
context "with closed state" do
|
70
|
+
|
71
|
+
context "with closed state" do
|
68
72
|
setup do
|
69
73
|
@issue = issue.new(Cinch::Bot.new)
|
70
74
|
@message = mock()
|
@@ -74,7 +78,7 @@ context "Issue Plugin" do
|
|
74
78
|
asserts("that it searches") { @issue.get_ticket(@message, 'open', 'bob') }
|
75
79
|
end
|
76
80
|
|
77
|
-
context "without state" do
|
81
|
+
context "without state" do
|
78
82
|
setup do
|
79
83
|
@issue = issue.new(Cinch::Bot.new)
|
80
84
|
@message = mock()
|
@@ -86,9 +90,9 @@ context "Issue Plugin" do
|
|
86
90
|
|
87
91
|
end
|
88
92
|
|
89
|
-
context "#search_issue" do
|
90
|
-
|
91
|
-
context "with default" do
|
93
|
+
context "#search_issue" do
|
94
|
+
|
95
|
+
context "with default" do
|
92
96
|
setup do
|
93
97
|
@issue = issue.new(Cinch::Bot.new)
|
94
98
|
@issue.expects(:authenticated_with).with(:login => 'achiu',:token => 'my_token').returns(true)
|
@@ -97,8 +101,8 @@ context "Issue Plugin" do
|
|
97
101
|
end
|
98
102
|
asserts("that it searches with state open") { @issue.search_issue('bob') }
|
99
103
|
end
|
100
|
-
|
101
|
-
context "with state" do
|
104
|
+
|
105
|
+
context "with state" do
|
102
106
|
setup do
|
103
107
|
@issue = issue.new(Cinch::Bot.new)
|
104
108
|
@issue.expects(:authenticated_with).with(:login => 'achiu', :token => 'my_token').returns(true)
|
data/test/teststrap.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Arthur Chiu
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-01-29 00:00:00 -08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -23,11 +23,13 @@ dependencies:
|
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
24
|
none: false
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
segments:
|
29
|
-
-
|
30
|
-
|
29
|
+
- 1
|
30
|
+
- 1
|
31
|
+
- 1
|
32
|
+
version: 1.1.1
|
31
33
|
type: :runtime
|
32
34
|
version_requirements: *id001
|
33
35
|
- !ruby/object:Gem::Dependency
|
@@ -83,13 +85,14 @@ extra_rdoc_files: []
|
|
83
85
|
files:
|
84
86
|
- .gitignore
|
85
87
|
- Gemfile
|
88
|
+
- Gemfile.lock
|
86
89
|
- LICENSE
|
87
90
|
- README.md
|
88
91
|
- Rakefile
|
89
92
|
- cinch-github.gemspec
|
90
|
-
- lib/cinch
|
91
|
-
- lib/cinch
|
92
|
-
- lib/cinch
|
93
|
+
- lib/cinch/plugins/github.rb
|
94
|
+
- lib/cinch/plugins/github/issue.rb
|
95
|
+
- lib/cinch/plugins/github/version.rb
|
93
96
|
- test.watchr
|
94
97
|
- test/issue_test.rb
|
95
98
|
- test/teststrap.rb
|