ticketmaster-github 0.4.6 → 0.4.7
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.
- data/README.md +6 -6
- data/VERSION +1 -1
- data/lib/provider/comment.rb +2 -2
- data/lib/provider/github.rb +2 -0
- data/lib/provider/project.rb +1 -1
- data/lib/provider/ticket.rb +7 -7
- data/lib/ticketmaster-github.rb +1 -0
- data/spec/project_spec.rb +8 -2
- data/spec/spec_helper.rb +1 -1
- data/spec/ticket_spec.rb +1 -7
- data/ticketmaster-github.gemspec +2 -2
- metadata +4 -4
data/README.md
CHANGED
@@ -5,7 +5,7 @@ This is a provider for [ticketmaster](http://ticketrb.com). It provides interope
|
|
5
5
|
# Usage and Examples
|
6
6
|
|
7
7
|
First we have to instantiate a new ticketmaster instance:
|
8
|
-
|
8
|
+
github = TicketMaster.new(:github, {:login => "coder", :token => "m4st3r!"})
|
9
9
|
|
10
10
|
If you do not pass in the token and the username, it will only access public information for the account.
|
11
11
|
|
@@ -14,8 +14,8 @@ If you do not pass in the token and the username, it will only access public inf
|
|
14
14
|
You can find your own projects by doing:
|
15
15
|
|
16
16
|
projects = github.projects # Will return all your repositories
|
17
|
-
|
18
|
-
|
17
|
+
projects = github.projects(['your_repo1', 'your_repo2'])
|
18
|
+
project = github.project('your_repo')
|
19
19
|
|
20
20
|
Also you can access other users repos
|
21
21
|
|
@@ -27,7 +27,7 @@ Or even make a search with an array
|
|
27
27
|
|
28
28
|
== Finding Tickets(Issues)
|
29
29
|
|
30
|
-
|
30
|
+
tickets = project.tickets # All open issues
|
31
31
|
tickets = project.tickets(:all, {:state => 'closed'}) # All closed tickets
|
32
32
|
ticket = project.ticket(<issue_number>)
|
33
33
|
|
@@ -53,7 +53,7 @@ Or even make a search with an array
|
|
53
53
|
comments = ticket.comments
|
54
54
|
|
55
55
|
== Create Comment
|
56
|
-
comment = ticket.comment!(
|
56
|
+
comment = ticket.comment!("your comment goes here")
|
57
57
|
|
58
58
|
## Requirements
|
59
59
|
|
@@ -83,4 +83,4 @@ If you see or find any issues, feel free to open up an issue report.
|
|
83
83
|
|
84
84
|
## Copyright
|
85
85
|
|
86
|
-
Copyright (c) 2010 The Hybrid Group. See LICENSE for details.
|
86
|
+
Copyright (c) 2010-2011 The Hybrid Group. See LICENSE for details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.7
|
data/lib/provider/comment.rb
CHANGED
@@ -38,11 +38,11 @@ module TicketMaster::Provider
|
|
38
38
|
# declare needed overloaded methods here
|
39
39
|
|
40
40
|
def self.find(project_id, ticket_id)
|
41
|
-
TicketMaster::Provider::Github.api.issue_comments(
|
41
|
+
TicketMaster::Provider::Github.api.issue_comments(project_id, ticket_id).collect { |comment| self.new comment }
|
42
42
|
end
|
43
43
|
|
44
44
|
def self.create(project_id, ticket_id, comment)
|
45
|
-
self.new TicketMaster::Provider::Github.api.add_comment(
|
45
|
+
self.new TicketMaster::Provider::Github.api.add_comment(project_id, ticket_id, comment)
|
46
46
|
end
|
47
47
|
|
48
48
|
end
|
data/lib/provider/github.rb
CHANGED
@@ -34,6 +34,8 @@ module TicketMaster::Provider
|
|
34
34
|
Project.find_all(options)
|
35
35
|
elsif options.first.is_a? Array
|
36
36
|
options.first.collect { |name| Project.find_by_id(name) }
|
37
|
+
elsif options.first.is_a? String
|
38
|
+
Project.find_by_id(options.first)
|
37
39
|
elsif options.first.is_a? Hash
|
38
40
|
Project.find_by_attributes(options.first)
|
39
41
|
end
|
data/lib/provider/project.rb
CHANGED
data/lib/provider/ticket.rb
CHANGED
@@ -38,7 +38,7 @@ module TicketMaster::Provider
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def self.find_by_id(project_id, number)
|
41
|
-
self.new(project_id, TicketMaster::Provider::Github.api.issue(
|
41
|
+
self.new(project_id, TicketMaster::Provider::Github.api.issue(project_id, number))
|
42
42
|
end
|
43
43
|
|
44
44
|
def self.find(project_id, *options)
|
@@ -58,16 +58,16 @@ module TicketMaster::Provider
|
|
58
58
|
|
59
59
|
def self.find_all(project_id)
|
60
60
|
issues = []
|
61
|
-
issues += TicketMaster::Provider::Github.api.issues(
|
61
|
+
issues += TicketMaster::Provider::Github.api.issues(project_id)
|
62
62
|
state = 'closed'
|
63
|
-
issues += TicketMaster::Provider::Github.api.issues(
|
63
|
+
issues += TicketMaster::Provider::Github.api.issues(project_id, state)
|
64
64
|
issues.collect { |issue| Ticket.new(project_id, issue) }
|
65
65
|
end
|
66
66
|
|
67
67
|
def self.open(project_id, *options)
|
68
68
|
body = options.first.delete(:body)
|
69
69
|
title = options.first.delete(:title)
|
70
|
-
TicketMaster::Provider::Github.api.create_issue(
|
70
|
+
TicketMaster::Provider::Github.api.create_issue(project_id, title, body, options.first)
|
71
71
|
end
|
72
72
|
|
73
73
|
def created_at
|
@@ -89,16 +89,16 @@ module TicketMaster::Provider
|
|
89
89
|
def save
|
90
90
|
t = Ticket.find_by_id(project_id, number)
|
91
91
|
return false if t.title == title and t.body == body
|
92
|
-
Ticket.new(project_id, TicketMaster::Provider::Github.api.update_issue(
|
92
|
+
Ticket.new(project_id, TicketMaster::Provider::Github.api.update_issue(project_id, number, title, body))
|
93
93
|
true
|
94
94
|
end
|
95
95
|
|
96
96
|
def reopen
|
97
|
-
Ticket.new(project_id, TicketMaster::Provider::Github.api.reopen_issue(
|
97
|
+
Ticket.new(project_id, TicketMaster::Provider::Github.api.reopen_issue(project_id, number))
|
98
98
|
end
|
99
99
|
|
100
100
|
def close
|
101
|
-
Ticket.new(project_id, TicketMaster::Provider::Github.api.close_issue(
|
101
|
+
Ticket.new(project_id, TicketMaster::Provider::Github.api.close_issue(project_id, number))
|
102
102
|
end
|
103
103
|
|
104
104
|
def comments
|
data/lib/ticketmaster-github.rb
CHANGED
data/spec/project_spec.rb
CHANGED
@@ -20,7 +20,13 @@ describe "Ticketmaster::Provider::Github::Project" do
|
|
20
20
|
projects = @github.projects([@repo_name])
|
21
21
|
projects.should be_an_instance_of(Array)
|
22
22
|
projects.first.should be_an_instance_of(@klass)
|
23
|
-
projects.first.
|
23
|
+
projects.first.name.should == @repo_name
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should be able to load a single project based on a single name(id)" do
|
27
|
+
project = @github.projects(@repo_name)
|
28
|
+
project.should be_an_instance_of(@klass)
|
29
|
+
project.name.should == @repo_name
|
24
30
|
end
|
25
31
|
|
26
32
|
it "should be able to find by name(id)" do
|
@@ -38,7 +44,7 @@ describe "Ticketmaster::Provider::Github::Project" do
|
|
38
44
|
it "should be able to find by attributes" do
|
39
45
|
projects = @github.projects(:name => @repo_name)
|
40
46
|
projects.should be_an_instance_of(Array)
|
41
|
-
projects.first.
|
47
|
+
projects.first.name.should be_eql(@repo_name)
|
42
48
|
end
|
43
49
|
end
|
44
50
|
|
data/spec/spec_helper.rb
CHANGED
@@ -2,10 +2,10 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
2
2
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
3
3
|
|
4
4
|
require 'rubygems'
|
5
|
+
require 'ticketmaster'
|
5
6
|
require 'active_support/core_ext/string'
|
6
7
|
require 'spec'
|
7
8
|
require 'factory_girl'
|
8
|
-
require 'ticketmaster'
|
9
9
|
require 'ticketmaster-github'
|
10
10
|
|
11
11
|
Dir["#{File.dirname(__FILE__)}/factories/*.rb"].each {|f| require f}
|
data/spec/ticket_spec.rb
CHANGED
@@ -35,13 +35,7 @@ describe "Ticketmaster::Provider::Github::Ticket" do
|
|
35
35
|
|
36
36
|
it "should be able to open a new ticket"
|
37
37
|
|
38
|
-
it "should be able to update a existing ticket"
|
39
|
-
@api.stub!('issue').and_return(@ticket)
|
40
|
-
tick = @project.ticket(@ticket_id)
|
41
|
-
tick.stub!('save').and_return(true)
|
42
|
-
tick.title = 'hello'
|
43
|
-
tick.save.should be_eql(true)
|
44
|
-
end
|
38
|
+
it "should be able to update a existing ticket"
|
45
39
|
|
46
40
|
it "should be able to reopen a ticket"
|
47
41
|
|
data/ticketmaster-github.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{ticketmaster-github}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["HybridGroup"]
|
12
|
-
s.date = %q{2011-04-
|
12
|
+
s.date = %q{2011-04-11}
|
13
13
|
s.description = %q{Ticketmaster provider for Github Issues tracking.}
|
14
14
|
s.email = %q{hong@hybridgroup.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ticketmaster-github
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 7
|
10
|
+
version: 0.4.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- HybridGroup
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-04-
|
18
|
+
date: 2011-04-11 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|