ticketmaster-jira 0.0.8 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -13,33 +13,33 @@ GEM
13
13
  diff-lcs (1.1.2)
14
14
  git (1.2.5)
15
15
  hashie (1.0.0)
16
- httpclient (2.2.0.2)
16
+ httpclient (2.2.1)
17
17
  i18n (0.5.0)
18
- jeweler (1.6.0)
19
- bundler (~> 1.0.0)
18
+ jeweler (1.6.2)
19
+ bundler (~> 1.0)
20
20
  git (>= 1.2.5)
21
21
  rake
22
22
  jira4r-jh (0.4.0)
23
23
  soap4r
24
24
  soap4r
25
- rake (0.8.7)
25
+ rake (0.9.1)
26
26
  rspec (2.6.0)
27
27
  rspec-core (~> 2.6.0)
28
28
  rspec-expectations (~> 2.6.0)
29
29
  rspec-mocks (~> 2.6.0)
30
- rspec-core (2.6.0)
30
+ rspec-core (2.6.3)
31
31
  rspec-expectations (2.6.0)
32
32
  diff-lcs (~> 1.1.2)
33
33
  rspec-mocks (2.6.0)
34
34
  soap4r (1.5.8)
35
35
  httpclient (>= 2.1.1)
36
- ticketmaster (0.5.6)
36
+ ticketmaster (0.6.6)
37
37
  activeresource
38
38
  activeresource (>= 2.3.2)
39
- activesupport
40
39
  activesupport (>= 2.3.2)
41
- hashie (= 1.0.0)
40
+ activesupport
42
41
  hashie
42
+ hashie (= 1.0.0)
43
43
  jeweler
44
44
 
45
45
  PLATFORMS
data/lib/jira/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class TicketMaster
2
2
  module Jira
3
- VERSION = "0.0.8"
3
+ VERSION = "0.1.8"
4
4
  end
5
5
  end
@@ -28,17 +28,17 @@ module TicketMaster::Provider
28
28
  end
29
29
  end
30
30
 
31
- def self.find(project_id, ticket_id, *options)
31
+ def self.find(ticket_id, *options)
32
32
  if options.first.empty?
33
- self.find_all(project_id, ticket_id)
33
+ self.find_all(ticket_id)
34
34
  end
35
35
  end
36
36
 
37
- def self.find_all(project_id, ticket_id)
38
- begin
39
- $jira.getComments(ticket_id).map { |comment| self.new comment }
37
+ def self.find_all(ticket_id)
38
+ begin
39
+ $jira.getComments("#{ticket_id}").map { |comment| self.new comment }
40
40
  rescue
41
- [TicketMaster::Provider::Jira::Comment]
41
+ []
42
42
  end
43
43
  end
44
44
  end
data/lib/provider/jira.rb CHANGED
@@ -15,12 +15,17 @@ module TicketMaster::Provider
15
15
  def authorize(auth = {})
16
16
  @authentication ||= TicketMaster::Authenticator.new(auth)
17
17
  $jira = Jira4R::JiraTool.new(2,@authentication.url)
18
- $jira.login(@authentication.username, @authentication.password)
18
+ begin
19
+ $jira.login(@authentication.username, @authentication.password)
20
+ @valid_auth = true
21
+ rescue
22
+ @valid_auth = false
23
+ end
19
24
  # Set authentication parameters for whatever you're using to access the API
20
25
  end
21
-
26
+
22
27
  # declare needed overloaded methods here
23
-
28
+
24
29
  def project(*options)
25
30
  if options.first.is_a? String
26
31
  options[0] = options[0].to_i
@@ -35,6 +40,10 @@ module TicketMaster::Provider
35
40
  def projects(*options)
36
41
  Project.find(options)
37
42
  end
43
+
44
+ def valid?
45
+ @valid_auth
46
+ end
38
47
  end
39
48
  end
40
49
 
@@ -55,7 +55,7 @@ module TicketMaster::Provider
55
55
  end
56
56
 
57
57
  def comments(*options)
58
- []
58
+ Comment.find(self.id, options)
59
59
  end
60
60
 
61
61
  def comment(*options)
data/spec/comment_spec.rb CHANGED
@@ -31,7 +31,6 @@ describe "TicketMaster::Provider::Jira::Comment" do
31
31
  end
32
32
 
33
33
  it "should be able to load all comments" do
34
- pending
35
34
  @ticket.comments.should be_an_instance_of(Array)
36
35
  @ticket.comments.first.should be_an_instance_of(@klass)
37
36
  end
@@ -5,11 +5,15 @@ describe "TicketMaster::Provider::Jira" do
5
5
  @url = "some_url"
6
6
  @fj = FakeJiraTool.new
7
7
  Jira4R::JiraTool.stub!(:new).with(2, @url).and_return(@fj)
8
+ @tm = TicketMaster.new(:jira, :username => 'testing', :password => 'testing', :url => @url)
8
9
  end
9
10
 
10
11
  it "should be able to instantiate a new ticketmaster instance" do
11
- @tm = TicketMaster.new(:jira, :username => 'testing', :password => 'testing', :url => @url)
12
12
  @tm.should be_an_instance_of(TicketMaster)
13
13
  @tm.should be_a_kind_of(TicketMaster::Provider::Jira)
14
14
  end
15
+
16
+ it "should validate authentication with the valid method" do
17
+ @tm.valid?.should be_true
18
+ end
15
19
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ticketmaster-jira
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 0
8
+ - 1
9
9
  - 8
10
- version: 0.0.8
10
+ version: 0.1.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Charles Lowell
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-05-27 00:00:00 -04:00
19
+ date: 2011-06-05 00:00:00 -04:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency