ticketmaster-github 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +43 -7
- data/VERSION +1 -1
- data/lib/provider/github.rb +3 -3
- data/lib/provider/ticket.rb +6 -2
- data/ticketmaster-github.gemspec +72 -0
- metadata +5 -4
data/README.md
CHANGED
@@ -5,19 +5,55 @@ 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
|
-
github = TicketMaster.new(:github, {:username => "code", :
|
8
|
+
github = TicketMaster.new(:github, {:username => "code", :token => "m4st3r!"})
|
9
9
|
|
10
|
-
If you do not pass in the token
|
10
|
+
If you do not pass in the token and the username, it will only access public information for the account.
|
11
11
|
|
12
|
-
== Finding Projects
|
12
|
+
== Finding Projects(Repositories)
|
13
13
|
|
14
|
-
|
15
|
-
project = github.project.find(:id => 505)
|
14
|
+
You can find your own projects by doing:
|
16
15
|
|
17
|
-
|
16
|
+
projects = github.projects # Will return all your repositories
|
17
|
+
projects = github.projects(['your_repo1', 'your_repo2'])
|
18
|
+
project = github.project('your_repo')
|
18
19
|
|
19
|
-
|
20
|
+
Also you can access other users repos
|
21
|
+
|
22
|
+
project = github.project.find(:first, {:user => 'other_user', :repo => 'his_repo'})
|
23
|
+
|
24
|
+
Or even make a search with an array
|
25
|
+
|
26
|
+
projects = github.project.find(:all, ['ruby','git'])
|
27
|
+
|
28
|
+
== Finding Tickets(Issues)
|
29
|
+
|
30
|
+
tickets = project.tickets # All open issues
|
31
|
+
tickets = project.tickets(:all, {:state => 'closed'}) # All closed tickets
|
32
|
+
ticket = project.ticket(<issue_number>)
|
33
|
+
|
34
|
+
== Open Tickets
|
20
35
|
|
36
|
+
ticket = project.ticket!({:title => "New ticket", :body => "Body for the very new ticket"})
|
37
|
+
|
38
|
+
== Close a ticket
|
39
|
+
|
40
|
+
ticket = ticket.close
|
41
|
+
|
42
|
+
== Reopen a ticket
|
43
|
+
|
44
|
+
ticket = ticket.reopen
|
45
|
+
|
46
|
+
= Update a ticket
|
47
|
+
|
48
|
+
ticket.title = "New title"
|
49
|
+
ticket.body = "New body"
|
50
|
+
ticket.save
|
51
|
+
|
52
|
+
== Finding Comments
|
53
|
+
comments = ticket.comments
|
54
|
+
|
55
|
+
== Create Comment
|
56
|
+
comment = ticket.comment!(<comment text>)
|
21
57
|
|
22
58
|
## Requirements
|
23
59
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/provider/github.rb
CHANGED
@@ -24,10 +24,10 @@ module TicketMaster::Provider
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def projects(*options)
|
27
|
-
|
28
|
-
options.collect{|name| Project.find(name)}.first if options.first.is_a?(Array)
|
29
|
-
else
|
27
|
+
if options.empty?
|
30
28
|
PROJECT_API.find(:user => Octopi::Api.api.login).collect{|repo| Project.new repo}
|
29
|
+
elsif options.first.is_a?(Array)
|
30
|
+
options.collect{|name| Project.find(name)}.first
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
data/lib/provider/ticket.rb
CHANGED
@@ -49,7 +49,11 @@ module TicketMaster::Provider
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def self.open(project_id, *options)
|
52
|
-
|
52
|
+
begin
|
53
|
+
self.new self::API.open(build_attributes(project_id, options.first))
|
54
|
+
rescue
|
55
|
+
self.find(project_id, :all).last
|
56
|
+
end
|
53
57
|
end
|
54
58
|
|
55
59
|
def close
|
@@ -63,7 +67,7 @@ module TicketMaster::Provider
|
|
63
67
|
def save
|
64
68
|
t = API.find(Ticket.build_attributes(repository, {:number => number}))
|
65
69
|
|
66
|
-
return false if t.title == title and t.body
|
70
|
+
return false if t.title == title and t.body == body
|
67
71
|
|
68
72
|
t.title = title
|
69
73
|
t.body = body
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{ticketmaster-github}
|
8
|
+
s.version = "0.1.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["HybridGroup"]
|
12
|
+
s.date = %q{2010-08-13}
|
13
|
+
s.description = %q{This provides an interface with github through the ticketmaster gem.}
|
14
|
+
s.email = %q{hong.quach@abigfisch.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.md"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.md",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"lib/github/github.rb",
|
27
|
+
"lib/provider/comment.rb",
|
28
|
+
"lib/provider/github.rb",
|
29
|
+
"lib/provider/project.rb",
|
30
|
+
"lib/provider/ticket.rb",
|
31
|
+
"lib/ticketmaster-github.rb",
|
32
|
+
"spec/comment_spec.rb",
|
33
|
+
"spec/factories/comment.rb",
|
34
|
+
"spec/factories/issue.rb",
|
35
|
+
"spec/factories/repository.rb",
|
36
|
+
"spec/project_spec.rb",
|
37
|
+
"spec/spec.opts",
|
38
|
+
"spec/spec_helper.rb",
|
39
|
+
"spec/ticket_spec.rb",
|
40
|
+
"spec/ticketmaster-github_spec.rb",
|
41
|
+
"ticketmaster-github.gemspec"
|
42
|
+
]
|
43
|
+
s.homepage = %q{http://github.com/kiafaldorius/ticketmaster-github}
|
44
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
45
|
+
s.require_paths = ["lib"]
|
46
|
+
s.rubygems_version = %q{1.3.7}
|
47
|
+
s.summary = %q{The github provider for ticketmaster}
|
48
|
+
s.test_files = [
|
49
|
+
"spec/comment_spec.rb",
|
50
|
+
"spec/factories/comment.rb",
|
51
|
+
"spec/factories/issue.rb",
|
52
|
+
"spec/factories/repository.rb",
|
53
|
+
"spec/project_spec.rb",
|
54
|
+
"spec/spec_helper.rb",
|
55
|
+
"spec/ticket_spec.rb",
|
56
|
+
"spec/ticketmaster-github_spec.rb"
|
57
|
+
]
|
58
|
+
|
59
|
+
if s.respond_to? :specification_version then
|
60
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
61
|
+
s.specification_version = 3
|
62
|
+
|
63
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
64
|
+
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
65
|
+
else
|
66
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
67
|
+
end
|
68
|
+
else
|
69
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
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: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
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: 2010-08-
|
18
|
+
date: 2010-08-13 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- spec/spec_helper.rb
|
66
66
|
- spec/ticket_spec.rb
|
67
67
|
- spec/ticketmaster-github_spec.rb
|
68
|
+
- ticketmaster-github.gemspec
|
68
69
|
has_rdoc: true
|
69
70
|
homepage: http://github.com/kiafaldorius/ticketmaster-github
|
70
71
|
licenses: []
|