ticketmaster-trac 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.8
1
+ 0.2.9
@@ -13,7 +13,7 @@ module TicketMaster::Provider
13
13
  object = object.first
14
14
  unless object.is_a? Hash
15
15
  @system_data = {:client => object}
16
- hash = {:id => object.id,
16
+ hash = {:id => object[:id],
17
17
  :author => object.author,
18
18
  :body => object.body,
19
19
  :ticket_id => object.ticket_id,
@@ -42,6 +42,10 @@ module TicketMaster::Provider
42
42
  end
43
43
  end
44
44
 
45
+ def id
46
+ self[:id]
47
+ end
48
+
45
49
  end
46
50
  end
47
51
  end
data/lib/trac/trac.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  class CommentUtil
4
4
 
5
- def initialize(ticket_id, trac, doc)
5
+ def initialize(ticket_id, trac, doc = nil)
6
6
  @doc = doc || Nokogiri::HTML(open("#{trac[:url]}/ticket/#{ticket_id}", :http_basic_authentication=>[trac[:username], trac[:password]]))
7
7
  @ticket_id = ticket_id
8
8
  end
@@ -14,7 +14,7 @@ class CommentUtil
14
14
  authors = @doc.css('h3.change')
15
15
  comment_id += 1
16
16
  unless body[comment_id-1].nil? || authors[comment_id-1].nil?
17
- build_comment_hash(value, comment_id, body[comment_id-1].text, authors[comment_id-1].content)
17
+ Hashie::Mash.new build_comment_hash(value, comment_id, body[comment_id-1].text, authors[comment_id-1].content)
18
18
  end
19
19
  end
20
20
  end
@@ -4,7 +4,7 @@ describe "CommentUtil" do
4
4
 
5
5
  before(:each) do
6
6
  trac = {:url => 'http://localhost/trac', :username => 'username', :password => 'password'}
7
- @comment_util = CommentUtil.new(1, trac, Nokogiri::HTML(File.open('commentutils-data.html')))
7
+ @comment_util = CommentUtil.new(1, trac, Nokogiri::HTML(File.open('spec/commentutils-data.html')))
8
8
  end
9
9
 
10
10
  it "should return all comments for a ticket" do
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ticketmaster-trac}
8
- s.version = "0.2.8"
8
+ s.version = "0.2.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Rafael George"]
@@ -22,7 +22,6 @@ Gem::Specification.new do |s|
22
22
  "README.md",
23
23
  "Rakefile",
24
24
  "VERSION",
25
- "commentutils-data.html",
26
25
  "lib/provider/comment.rb",
27
26
  "lib/provider/project.rb",
28
27
  "lib/provider/ticket.rb",
@@ -31,6 +30,7 @@ Gem::Specification.new do |s|
31
30
  "lib/trac/trac.rb",
32
31
  "spec/comments_spec.rb",
33
32
  "spec/commentutil_spec.rb",
33
+ "spec/commentutils-data.html",
34
34
  "spec/fixtures/tickets.xml",
35
35
  "spec/projects_spec.rb",
36
36
  "spec/spec.opts",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ticketmaster-trac
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 8
10
- version: 0.2.8
9
+ - 9
10
+ version: 0.2.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rafael George
@@ -141,7 +141,6 @@ files:
141
141
  - README.md
142
142
  - Rakefile
143
143
  - VERSION
144
- - commentutils-data.html
145
144
  - lib/provider/comment.rb
146
145
  - lib/provider/project.rb
147
146
  - lib/provider/ticket.rb
@@ -150,6 +149,7 @@ files:
150
149
  - lib/trac/trac.rb
151
150
  - spec/comments_spec.rb
152
151
  - spec/commentutil_spec.rb
152
+ - spec/commentutils-data.html
153
153
  - spec/fixtures/tickets.xml
154
154
  - spec/projects_spec.rb
155
155
  - spec/spec.opts