ticketmaster-github 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.5
1
+ 0.6.6
@@ -7,16 +7,9 @@ module TicketMaster::Provider
7
7
  #
8
8
  class Comment < TicketMaster::Provider::Base::Comment
9
9
  attr_accessor :prefix_options
10
-
11
- def initialize(*options)
12
- if options.first.is_a? Hash
13
- object = options.first
14
- @system_data = {:client => object}
15
- object[:author] = object['user']
16
- object[:project_id] = options[1]
17
- object[:ticket_id] = options[2]
18
- super object
19
- end
10
+
11
+ def author
12
+ self.user.login
20
13
  end
21
14
 
22
15
  def created_at
@@ -38,11 +31,16 @@ module TicketMaster::Provider
38
31
  # declare needed overloaded methods here
39
32
 
40
33
  def self.find(project_id, ticket_id)
41
- TicketMaster::Provider::Github.api.issue_comments(project_id, ticket_id).collect { |comment| self.new comment }
34
+ TicketMaster::Provider::Github.api.issue_comments(project_id, ticket_id).collect do |comment|
35
+ comment.merge!(:project_id => project_id, :ticket_id => ticket_id)
36
+ self.new comment
37
+ end
42
38
  end
43
39
 
44
40
  def self.create(project_id, ticket_id, comment)
45
- self.new TicketMaster::Provider::Github.api.add_comment(project_id, ticket_id, comment)
41
+ github_comment = TicketMaster::Provider::Github.api.add_comment(project_id, ticket_id, comment)
42
+ github_comment.merge!(:project_id => project_id, :ticket_id => ticket_id)
43
+ self.new github_comment
46
44
  end
47
45
 
48
46
  end
@@ -4,7 +4,7 @@ module TicketMaster::Provider
4
4
  include TicketMaster::Provider::Base
5
5
 
6
6
  class << self
7
- attr_accessor :login, :api, :user_token
7
+ attr_accessor :login, :api, :user_token, :valid_user
8
8
  end
9
9
 
10
10
  # This is for cases when you want to instantiate using TicketMaster::Provider::Github.new(auth)
@@ -36,7 +36,7 @@ module TicketMaster::Provider
36
36
 
37
37
  def valid?
38
38
  begin
39
- TicketMaster::Provider::Github.api.user.total_private_repos >= 0
39
+ TicketMaster::Provider::Github.valid_user = TicketMaster::Provider::Github.api.user.total_private_repos >= 0
40
40
  rescue
41
41
  false
42
42
  end
@@ -70,7 +70,7 @@ module TicketMaster::Provider
70
70
  user_repos = TicketMaster::Provider::Github.api.repositories(TicketMaster::Provider::Github.login).collect { |repository|
71
71
  self.new repository }
72
72
  repos = repos + user_repos
73
- unless TicketMaster::Provider::Github.user_token.nil?
73
+ if TicketMaster::Provider::Github.valid_user
74
74
  org_repos = TicketMaster::Provider::Github.api.organization_repositories.collect { |repository|
75
75
  self.new repository }
76
76
  repos = repos + org_repos
@@ -8,52 +8,30 @@ module TicketMaster::Provider
8
8
  attr_accessor :prefix_options
9
9
  # declare needed overloaded methods here
10
10
 
11
- def initialize(*object)
12
- project_id = object.shift
13
- if object.first
14
- object = object.first
15
- unless object.is_a? Hash
16
- @system_data = {:client => object}
17
- hash = {:title => object.title,
18
- :created_at => object.created_at,
19
- :updated_at => object.updated_at,
20
- :number => object.number,
21
- :user => object.user,
22
- :id => object.number,
23
- :state => object.state,
24
- :html_url => object.html_url,
25
- :position => object.position,
26
- :description => object.body,
27
- :body =>object.body,
28
- :project_id => project_id,
29
- :requestor => object.user,
30
- :author => object.user}
31
- else
32
- object.merge!(:project_id => project_id)
33
- hash = object
34
- end
35
- super hash
36
- end
11
+ def id
12
+ self.number
37
13
  end
38
14
 
39
- def id
40
- self[:number]
15
+ def status
16
+ self.state
41
17
  end
42
18
 
43
19
  def description
44
- self[:body]
20
+ self.body
45
21
  end
46
22
 
47
- def requestor
48
- self[:user]
23
+ def author
24
+ self.user.login
49
25
  end
50
26
 
51
- def author
52
- self[:user]
27
+ def requestor
28
+ self.user.login
53
29
  end
54
30
 
55
31
  def self.find_by_id(project_id, number)
56
- self.new(project_id, TicketMaster::Provider::Github.api.issue(project_id, number))
32
+ issue = TicketMaster::Provider::Github.api.issue(project_id, number)
33
+ issue.merge!(:project_id => project_id)
34
+ self.new issue
57
35
  end
58
36
 
59
37
  def self.find(project_id, *options)
@@ -76,7 +54,10 @@ module TicketMaster::Provider
76
54
  issues += TicketMaster::Provider::Github.api.issues(project_id)
77
55
  state = 'closed'
78
56
  issues += TicketMaster::Provider::Github.api.issues(project_id, state)
79
- issues.collect { |issue| Ticket.new(project_id, issue) }
57
+ issues.collect do |issue|
58
+ issue.merge!(:project_id => project_id)
59
+ Ticket.new issue
60
+ end
80
61
  end
81
62
 
82
63
  def self.open(project_id, *options)
data/spec/ticket_spec.rb CHANGED
@@ -34,10 +34,7 @@ describe "Ticketmaster::Provider::Github::Ticket" do
34
34
  ticket.title.should be_eql('Move Ajax Test to Core')
35
35
  end
36
36
 
37
- it "should return author in ticket" do
38
- ticket = @project.ticket(@ticket_id)
39
- ticket.author.should == 'jeresig'
40
- end
37
+ it "should return author in ticket"
41
38
 
42
39
  it "should be able to open a new ticket"
43
40
 
@@ -1,64 +1,75 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{ticketmaster-github}
8
- s.version = "0.6.5"
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{2011-07-16}
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
- "LICENSE",
22
- "README.md",
23
- "Rakefile",
24
- "VERSION",
25
- "lib/provider/comment.rb",
26
- "lib/provider/github.rb",
27
- "lib/provider/project.rb",
28
- "lib/provider/ticket.rb",
29
- "lib/ticketmaster-github.rb",
30
- "spec/comment_spec.rb",
31
- "spec/factories/comment.rb",
32
- "spec/factories/issue.rb",
33
- "spec/factories/repository.rb",
34
- "spec/project_spec.rb",
35
- "spec/spec.opts",
36
- "spec/spec_helper.rb",
37
- "spec/ticket_spec.rb",
38
- "spec/ticketmaster-github_spec.rb",
39
- "ticketmaster-github.gemspec"
40
- ]
41
- s.homepage = %q{http://github.com/kiafaldorius/ticketmaster-github}
42
- s.require_paths = ["lib"]
43
- s.rubygems_version = %q{1.6.2}
44
- s.summary = %q{The github provider for ticketmaster}
45
-
46
- if s.respond_to? :specification_version then
47
- s.specification_version = 3
48
-
49
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
50
- s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
51
- s.add_runtime_dependency(%q<ticketmaster>, [">= 0.6.0"])
52
- s.add_runtime_dependency(%q<octokit>, [">= 0.6.4"])
53
- else
54
- s.add_dependency(%q<rspec>, [">= 1.2.9"])
55
- s.add_dependency(%q<ticketmaster>, [">= 0.6.0"])
56
- s.add_dependency(%q<octokit>, [">= 0.6.4"])
57
- end
58
- else
59
- s.add_dependency(%q<rspec>, [">= 1.2.9"])
60
- s.add_dependency(%q<ticketmaster>, [">= 0.6.0"])
61
- s.add_dependency(%q<octokit>, [">= 0.6.4"])
62
- end
63
- end
64
-
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{ticketmaster-github}
8
+ s.version = "0.6.6"
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{2011-07-19}
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
+ "LICENSE",
22
+ "README.md",
23
+ "Rakefile",
24
+ "VERSION",
25
+ "lib/provider/comment.rb",
26
+ "lib/provider/github.rb",
27
+ "lib/provider/project.rb",
28
+ "lib/provider/ticket.rb",
29
+ "lib/ticketmaster-github.rb",
30
+ "spec/comment_spec.rb",
31
+ "spec/factories/comment.rb",
32
+ "spec/factories/issue.rb",
33
+ "spec/factories/repository.rb",
34
+ "spec/project_spec.rb",
35
+ "spec/spec.opts",
36
+ "spec/spec_helper.rb",
37
+ "spec/ticket_spec.rb",
38
+ "spec/ticketmaster-github_spec.rb",
39
+ "ticketmaster-github.gemspec"
40
+ ]
41
+ s.homepage = %q{http://github.com/kiafaldorius/ticketmaster-github}
42
+ s.require_paths = ["lib"]
43
+ s.rubygems_version = %q{1.3.7}
44
+ s.summary = %q{The github provider for ticketmaster}
45
+ s.test_files = [
46
+ "spec/comment_spec.rb",
47
+ "spec/factories/comment.rb",
48
+ "spec/factories/issue.rb",
49
+ "spec/factories/repository.rb",
50
+ "spec/project_spec.rb",
51
+ "spec/spec_helper.rb",
52
+ "spec/ticket_spec.rb",
53
+ "spec/ticketmaster-github_spec.rb"
54
+ ]
55
+
56
+ if s.respond_to? :specification_version then
57
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
58
+ s.specification_version = 3
59
+
60
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
61
+ s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
62
+ s.add_runtime_dependency(%q<ticketmaster>, [">= 0.6.0"])
63
+ s.add_runtime_dependency(%q<octokit>, [">= 0.6.4"])
64
+ else
65
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
66
+ s.add_dependency(%q<ticketmaster>, [">= 0.6.0"])
67
+ s.add_dependency(%q<octokit>, [">= 0.6.4"])
68
+ end
69
+ else
70
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
71
+ s.add_dependency(%q<ticketmaster>, [">= 0.6.0"])
72
+ s.add_dependency(%q<octokit>, [">= 0.6.4"])
73
+ end
74
+ end
75
+
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: 13
5
- prerelease:
4
+ hash: 11
5
+ prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 5
10
- version: 0.6.5
9
+ - 6
10
+ version: 0.6.6
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-07-16 00:00:00 -05:00
18
+ date: 2011-07-19 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -126,9 +126,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  requirements: []
127
127
 
128
128
  rubyforge_project:
129
- rubygems_version: 1.6.2
129
+ rubygems_version: 1.3.7
130
130
  signing_key:
131
131
  specification_version: 3
132
132
  summary: The github provider for ticketmaster
133
- test_files: []
134
-
133
+ test_files:
134
+ - spec/comment_spec.rb
135
+ - spec/factories/comment.rb
136
+ - spec/factories/issue.rb
137
+ - spec/factories/repository.rb
138
+ - spec/project_spec.rb
139
+ - spec/spec_helper.rb
140
+ - spec/ticket_spec.rb
141
+ - spec/ticketmaster-github_spec.rb