ticketmaster-github 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.2.0
@@ -11,9 +11,30 @@ module TicketMaster::Provider
11
11
 
12
12
  def initialize(*options)
13
13
  if options.first.is_a? Hash
14
- super options.first
14
+ object = options.first
15
+ @system_data = {:client => object}
16
+ object[:author] = object['user']
17
+ object[:project_id] = options[1]
18
+ object[:ticket_id] = options[2]
19
+ super object
15
20
  end
16
21
  end
22
+
23
+ def created_at
24
+ @created_at ||= begin
25
+ Time.parse(self[:created_at])
26
+ rescue
27
+ self[:created_at]
28
+ end
29
+ end
30
+
31
+ def created_at
32
+ @updated_at ||= begin
33
+ Time.parse(self[:updated_at])
34
+ rescue
35
+ self[:updated_at]
36
+ end
37
+ end
17
38
 
18
39
  # declare needed overloaded methods here
19
40
  def self.find_by_id(project_id, ticket_id, id)
@@ -22,7 +43,7 @@ module TicketMaster::Provider
22
43
 
23
44
  def self.find_by_attributes(project_id, ticket_id, attributes = {})
24
45
  warn "Github API only gets all comments"
25
- self::API.find_all(Project.find(:first, [project_id]), ticket_id).collect {|comment| self.new comment}
46
+ self::API.find_all(Project.find(:first, [project_id]), ticket_id).collect {|comment| self.new comment, project_id, ticket_id}
26
47
  end
27
48
 
28
49
  def self.search(project_id, ticket_id, options = {}, limit = 1000)
@@ -12,6 +12,7 @@ module TicketMaster::Provider
12
12
  def initialize(*object)
13
13
  if object.first
14
14
  object = object.first
15
+ @system_data = {:client => object}
15
16
  hash = {'description' => object.description,
16
17
  'url' => object.url,
17
18
  'forks' => object.forks,
@@ -12,6 +12,7 @@ module TicketMaster::Provider
12
12
  def initialize(*object)
13
13
  if object.first
14
14
  object = object.first
15
+ @system_data = {:client => object}
15
16
  unless object.is_a? Hash
16
17
  hash = {:repository => object.repository.name,
17
18
  :user => object.user,
@@ -23,7 +24,13 @@ module TicketMaster::Provider
23
24
  :closed_at => object.closed_at,
24
25
  :labels => object.labels,
25
26
  :state => object.state,
26
- :created_at => object.created_at
27
+ :created_at => object.created_at,
28
+ :id => object.number,
29
+ :project_id => object.repository.name,
30
+ :description => object.body,
31
+ :status => object.state,
32
+ :resolution => (object.state == 'closed' ? 'closed' : nil),
33
+ :requestor => object.user
27
34
  }
28
35
  else
29
36
  hash = object
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ticketmaster-github}
8
- s.version = "0.1.4"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["HybridGroup"]
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: 19
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 4
10
- version: 0.1.4
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - HybridGroup