ticketmaster-jira 0.0.8 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +8 -8
- data/lib/jira/version.rb +1 -1
- data/lib/provider/comment.rb +6 -6
- data/lib/provider/jira.rb +12 -3
- data/lib/provider/ticket.rb +1 -1
- data/spec/comment_spec.rb +0 -1
- data/spec/ticketmaster-jira_spec.rb +5 -1
- metadata +4 -4
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.
|
16
|
+
httpclient (2.2.1)
|
17
17
|
i18n (0.5.0)
|
18
|
-
jeweler (1.6.
|
19
|
-
bundler (~> 1.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.
|
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.
|
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.
|
36
|
+
ticketmaster (0.6.6)
|
37
37
|
activeresource
|
38
38
|
activeresource (>= 2.3.2)
|
39
|
-
activesupport
|
40
39
|
activesupport (>= 2.3.2)
|
41
|
-
|
40
|
+
activesupport
|
42
41
|
hashie
|
42
|
+
hashie (= 1.0.0)
|
43
43
|
jeweler
|
44
44
|
|
45
45
|
PLATFORMS
|
data/lib/jira/version.rb
CHANGED
data/lib/provider/comment.rb
CHANGED
@@ -28,17 +28,17 @@ module TicketMaster::Provider
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
def self.find(
|
31
|
+
def self.find(ticket_id, *options)
|
32
32
|
if options.first.empty?
|
33
|
-
self.find_all(
|
33
|
+
self.find_all(ticket_id)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
def self.find_all(
|
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
|
-
[
|
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
|
-
|
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
|
|
data/lib/provider/ticket.rb
CHANGED
data/spec/comment_spec.rb
CHANGED
@@ -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:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 1
|
9
9
|
- 8
|
10
|
-
version: 0.
|
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
|
19
|
+
date: 2011-06-05 00:00:00 -04:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|