ticketmaster-jira 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
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: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Charles Lowell
@@ -45,7 +45,7 @@ dependencies:
45
45
  requirement: *id002
46
46
  prerelease: false
47
47
  type: :runtime
48
- name: jira4r
48
+ name: jira4r-jh
49
49
  - !ruby/object:Gem::Dependency
50
50
  version_requirements: &id003 !ruby/object:Gem::Requirement
51
51
  none: false
@@ -71,24 +71,8 @@ extensions: []
71
71
 
72
72
  extra_rdoc_files: []
73
73
 
74
- files:
75
- - .gitignore
76
- - .rvmrc
77
- - Gemfile
78
- - Gemfile.lock
79
- - Rakefile
80
- - lib/jira/version.rb
81
- - lib/provider/comment.rb
82
- - lib/provider/jira.rb
83
- - lib/provider/project.rb
84
- - lib/provider/ticket.rb
85
- - lib/ticketmaster-jira.rb
86
- - spec/comment_spec.rb
87
- - spec/project_spec.rb
88
- - spec/spec_helper.rb
89
- - spec/ticket_spec.rb
90
- - spec/ticketmaster-jira_spec.rb
91
- - ticketmaster-jira.gemspec
74
+ files: []
75
+
92
76
  has_rdoc: true
93
77
  homepage: http://github.com/cowboyd/ticketmaster-jira
94
78
  licenses: []
@@ -123,9 +107,5 @@ rubygems_version: 1.6.1
123
107
  signing_key:
124
108
  specification_version: 3
125
109
  summary: TicketMaster binding for JIRA
126
- test_files:
127
- - spec/comment_spec.rb
128
- - spec/project_spec.rb
129
- - spec/spec_helper.rb
130
- - spec/ticket_spec.rb
131
- - spec/ticketmaster-jira_spec.rb
110
+ test_files: []
111
+
data/.gitignore DELETED
@@ -1,2 +0,0 @@
1
- .bundle
2
- pkg/
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm 1.8.7@ticketmaster-jira --create
data/Gemfile DELETED
@@ -1,9 +0,0 @@
1
- source :rubygems
2
-
3
- gem 'ticketmaster'
4
- gem 'jira4r-jh'
5
-
6
- group :development do
7
- gem "rspec"
8
- end
9
-
@@ -1,51 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- activemodel (3.0.7)
5
- activesupport (= 3.0.7)
6
- builder (~> 2.1.2)
7
- i18n (~> 0.5.0)
8
- activeresource (3.0.7)
9
- activemodel (= 3.0.7)
10
- activesupport (= 3.0.7)
11
- activesupport (3.0.7)
12
- builder (2.1.2)
13
- diff-lcs (1.1.2)
14
- git (1.2.5)
15
- hashie (1.0.0)
16
- httpclient (2.2.0.2)
17
- i18n (0.5.0)
18
- jeweler (1.6.0)
19
- bundler (~> 1.0.0)
20
- git (>= 1.2.5)
21
- rake
22
- jira4r-jh (0.4.0)
23
- soap4r
24
- soap4r
25
- rake (0.8.7)
26
- rspec (2.6.0)
27
- rspec-core (~> 2.6.0)
28
- rspec-expectations (~> 2.6.0)
29
- rspec-mocks (~> 2.6.0)
30
- rspec-core (2.6.0)
31
- rspec-expectations (2.6.0)
32
- diff-lcs (~> 1.1.2)
33
- rspec-mocks (2.6.0)
34
- soap4r (1.5.8)
35
- httpclient (>= 2.1.1)
36
- ticketmaster (0.5.6)
37
- activeresource
38
- activeresource (>= 2.3.2)
39
- activesupport
40
- activesupport (>= 2.3.2)
41
- hashie (= 1.0.0)
42
- hashie
43
- jeweler
44
-
45
- PLATFORMS
46
- ruby
47
-
48
- DEPENDENCIES
49
- jira4r-jh
50
- rspec
51
- ticketmaster
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- require 'bundler/setup'
2
- Bundler::GemHelper.install_tasks
3
-
4
- task :default => :spec
5
-
6
- desc "run specs"
7
- task :spec do
8
- sh "bundle exec rspec --color spec/"
9
- end
10
-
@@ -1,5 +0,0 @@
1
- class TicketMaster
2
- module Jira
3
- VERSION = "0.0.2"
4
- end
5
- end
@@ -1,46 +0,0 @@
1
- module TicketMaster::Provider
2
- module Jira
3
- # The comment class for ticketmaster-jira
4
- #
5
- # Do any mapping between Ticketmaster and your system's comment model here
6
- # versions of the ticket.
7
- #
8
- class Comment < TicketMaster::Provider::Base::Comment
9
- #API = Jira::Comment # The class to access the api's comments
10
- # declare needed overloaded methods here
11
-
12
- def initialize(*object)
13
- if object.first
14
- object = object.first
15
- unless object.is_a? Hash
16
- @system_data = {:client => object}
17
- hash = {:id => object.id,
18
- :author => object.author,
19
- :body => object.body,
20
- :created_at => object.created,
21
- :updated_at => object.updated,
22
- :ticket_id => object.ticket_id,
23
- :project_id => object.project_id}
24
- else
25
- hash = object
26
- end
27
- super(hash)
28
- end
29
- end
30
-
31
- def self.find(project_id, ticket_id, *options)
32
- if options.first.empty?
33
- self.find_all(project_id, ticket_id)
34
- end
35
- end
36
-
37
- def self.find_all(project_id, ticket_id)
38
- begin
39
- $jira.getComments(ticket_id).map { |comment| self.new comment }
40
- rescue
41
- [TicketMaster::Provider::Jira::Comment]
42
- end
43
- end
44
- end
45
- end
46
- end
@@ -1,34 +0,0 @@
1
- module TicketMaster::Provider
2
- # This is the Jira Provider for ticketmaster
3
- module Jira
4
- include TicketMaster::Provider::Base
5
- #TICKET_API = Jira::Ticket # The class to access the api's tickets
6
- #PROJECT_API = Jira::Project # The class to access the api's projects
7
-
8
- # This is for cases when you want to instantiate using TicketMaster::Provider::Jira.new(auth)
9
- def self.new(auth = {})
10
- TicketMaster.new(:jira, auth)
11
- end
12
-
13
- # Providers must define an authorize method. This is used to initialize and set authentication
14
- # parameters to access the API
15
- def authorize(auth = {})
16
- @authentication ||= TicketMaster::Authenticator.new(auth)
17
- $jira = Jira4R::JiraTool.new(2,@authentication.url)
18
- $jira.login(@authentication.username, @authentication.password)
19
- # Set authentication parameters for whatever you're using to access the API
20
- end
21
-
22
- # declare needed overloaded methods here
23
-
24
- def project(*options)
25
- if options.first.is_a? Fixnum
26
- Project.find_by_id(options.first)
27
- elsif options.first.is_a? Hash
28
- Project.find_by_attributes(options.first).first
29
- end
30
- end
31
- end
32
- end
33
-
34
-
@@ -1,66 +0,0 @@
1
- module TicketMaster::Provider
2
- module Jira
3
- # Project class for ticketmaster-jira
4
- #
5
- #
6
- class Project < TicketMaster::Provider::Base::Project
7
- #API = Jira::Project # The class to access the api's projects
8
- # declare needed overloaded methods here
9
- # copy from this.copy(that) copies that into this
10
- def initialize(*object)
11
- if object.first
12
- object = object.first
13
- unless object.is_a? Hash
14
- @system_data = {:client => object}
15
- hash = {:id => object.id.to_i,
16
- :name => object.name,
17
- :description => object.description}
18
- else
19
- hash = object
20
- end
21
- super(hash)
22
- end
23
- end
24
-
25
- def copy(project)
26
- project.tickets.each do |ticket|
27
- copy_ticket = self.ticket!(:title => ticket.title, :description => ticket.description)
28
- ticket.comments.each do |comment|
29
- copy_ticket.comment!(:body => comment.body)
30
- sleep 1
31
- end
32
- end
33
- end
34
-
35
- def self.find(*options)
36
- jira_projects = self.find_all
37
- if options.first.is_a? Array
38
- jira_projects.select do |project|
39
- project if options.first.any? { |id| project.id == id }
40
- end
41
- elsif options.first.is_a? Hash
42
- find_by_attributes(options.first)
43
- else
44
- jira_projects
45
- end
46
- end
47
-
48
- def self.find_by_attributes(attributes = {})
49
- search_by_attribute(self.find_all, attributes)
50
- end
51
-
52
- def self.find_all
53
- $jira.getProjectsNoSchemes().map do |project|
54
- Project.new project
55
- end
56
- end
57
-
58
- def self.find_by_id(id)
59
- self.find_all.select { |project| project.id == id }.first
60
- end
61
-
62
- end
63
- end
64
- end
65
-
66
-
@@ -1,69 +0,0 @@
1
- module TicketMaster::Provider
2
- module Jira
3
- # Ticket class for ticketmaster-jira
4
- #
5
-
6
- class Ticket < TicketMaster::Provider::Base::Ticket
7
- #API = Jira::Ticket # The class to access the api's tickets
8
- # declare needed overloaded methods here
9
- def initialize(*object)
10
- if object.first
11
- object = object.first
12
- unless object.is_a? Hash
13
- @system_data = {:client => object}
14
- hash = {:id => object.id.to_i,
15
- :status => object.status,
16
- :priority => object.priority,
17
- :title => object.summary,
18
- :resolution => object.resolution,
19
- :created_at => object.created,
20
- :updated_at => object.updated,
21
- :description => object.description,
22
- :assignee => object.assignee,
23
- :requestor => object.reporter}
24
- else
25
- hash = object
26
- end
27
- super(hash)
28
- end
29
- end
30
-
31
- def updated_at
32
- normalize_datetime(self[:updated_at])
33
- end
34
-
35
- def created_at
36
- normalize_datetime(self[:created_at])
37
- end
38
-
39
- def self.find_by_attributes(project_id, attributes = {})
40
- search_by_attribute(self.find_all(project_id), attributes)
41
- end
42
-
43
- def self.find_by_id(project_id, id)
44
- self.find_all(project_id).select { |ticket| ticket.id == id }.first
45
- end
46
-
47
- def self.find_all(project_id)
48
- $jira.getIssuesFromJqlSearch("project = #{project_id}", 200).map do |ticket|
49
- self.new ticket
50
- end
51
- end
52
-
53
- def comments(*options)
54
- []
55
- end
56
-
57
- def comment(*options)
58
- nil
59
- end
60
-
61
- private
62
- def normalize_datetime(datetime)
63
- Time.mktime(datetime.year, datetime.month, datetime.day, datetime.hour, datetime.min, datetime.sec)
64
- end
65
-
66
- end
67
-
68
- end
69
- end
@@ -1,6 +0,0 @@
1
- require 'ticketmaster'
2
- require 'jira4r/jira_tool'
3
-
4
- %w{ jira ticket project comment }.each do |f|
5
- require File.dirname(__FILE__) + '/provider/' + f + '.rb';
6
- end
@@ -1,40 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe "TicketMaster::Provider::Jira::Comment" do
4
- before(:each) do
5
- @url = "some_url"
6
- @fj = FakeJiraTool.new
7
- @project_jira = Struct.new(:id, :name, :description).new(1, 'project', 'project description')
8
- @ticket = Struct.new(:id,
9
- :status,
10
- :priority,
11
- :summary,
12
- :resolution,
13
- :created,
14
- :updated,
15
- :description, :assignee, :reporter).new(1,'open','high', 'ticket 1', 'none', Time.now, Time.now, 'description', 'myself', 'yourself')
16
- @comment = Struct.new(:id, :author, :body, :created, :updated, :ticket_id, :project_id).new(1,
17
- 'myself',
18
- 'body',
19
- Time.now,
20
- Time.now,
21
- 1,
22
- 1)
23
- Jira4R::JiraTool.stub!(:new).with(2, @url).and_return(@fj)
24
- @fj.stub!(:getProjectsNoSchemes).and_return([@project_jira, @project_jira])
25
- @fj.stub!(:getProjectById).and_return(@project_jira)
26
- @fj.stub!(:getIssuesFromJqlSearch).and_return([@ticket])
27
- @fj.stub!(:getComments).and_return([@comment])
28
- @tm = TicketMaster.new(:jira, :username => 'testuser', :password => 'testuser', :url => @url)
29
- @ticket = @tm.projects.first.tickets.first
30
- @klass = TicketMaster::Provider::Jira::Comment
31
- end
32
-
33
- it "should be able to load all comments" do
34
- pending
35
- @ticket.comments.should be_an_instance_of(Array)
36
- @ticket.comments.first.should be_an_instance_of(@klass)
37
- end
38
-
39
- it "should be able to create a comment"
40
- end
@@ -1,39 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe "TicketMaster::Provider::Jira::Project" do
4
- before(:each) do
5
- @url = "some_url"
6
- @fj = FakeJiraTool.new
7
- @project = Struct.new(:id, :name, :description).new(1,
8
- 'project',
9
- 'project description')
10
- Jira4R::JiraTool.stub!(:new).with(2, @url).and_return(@fj)
11
- @fj.stub!(:getProjectsNoSchemes).and_return([@project, @project])
12
- @fj.stub!(:getProjectByKey).and_return(@project)
13
- @tm = TicketMaster.new(:jira, :username => 'testuser', :password => 'testuser', :url => @url)
14
- @klass = TicketMaster::Provider::Jira::Project
15
- end
16
-
17
- it "should be able to load all projects" do
18
- @tm.projects.should be_an_instance_of(Array)
19
- @tm.projects.first.should be_an_instance_of(@klass)
20
- end
21
-
22
- it "should be able to load all projects based on an array of id's" do
23
- @tm.projects([1]).should be_an_instance_of(Array)
24
- @tm.projects.first.should be_an_instance_of(@klass)
25
- @tm.projects.first.id.should == 1
26
- end
27
-
28
- it "should be able to load a single project based on id" do
29
- project = @tm.project(1)
30
- project.should be_an_instance_of(@klass)
31
- project.name.should == 'project'
32
- end
33
-
34
- it "should be able to load a single project by attributes" do
35
- project = @tm.project(:id => 1)
36
- project.should be_an_instance_of(@klass)
37
- project.name.should == 'project'
38
- end
39
- end
@@ -1,22 +0,0 @@
1
- $:.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
2
- require 'ticketmaster-jira'
3
- require 'rspec/expectations'
4
-
5
- class FakeJiraTool
6
- attr_accessor :call_stack, :returns
7
-
8
- def initialize
9
- @call_stack = []
10
- @returns = {}
11
- end
12
-
13
- def method_missing *args
14
- @call_stack << args
15
- @returns.delete(args.first) if @returns.key?(args.first)
16
- end
17
- end
18
-
19
- RSpec.configure do |config|
20
- config.mock_framework = :rspec
21
- end
22
-
@@ -1,49 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe "TicketMaster::Provider::Jira::Ticket" do
4
- before(:each) do
5
- @url = "some_url"
6
- @fj = FakeJiraTool.new
7
- @project_jira = Struct.new(:id, :name, :description).new(1, 'project', 'project description')
8
- @ticket = Struct.new(:id,
9
- :status,
10
- :priority,
11
- :summary,
12
- :resolution,
13
- :created,
14
- :updated,
15
- :description, :assignee, :reporter).new(1,'open','high', 'ticket 1', 'none', Time.now, Time.now, 'description', 'myself', 'yourself')
16
- Jira4R::JiraTool.stub!(:new).with(2, @url).and_return(@fj)
17
- @fj.stub!(:getProjectsNoSchemes).and_return([@project_jira, @project_jira])
18
- @fj.stub!(:getProjectById).and_return(@project_jira)
19
- @fj.stub!(:getIssuesFromJqlSearch).and_return([@ticket])
20
- @tm = TicketMaster.new(:jira, :username => 'testuser', :password => 'testuser', :url => @url)
21
- @project_tm = @tm.projects.first
22
- @klass = TicketMaster::Provider::Jira::Ticket
23
- end
24
-
25
- it "should be able to load all tickets" do
26
- @project_tm.tickets.should be_an_instance_of(Array)
27
- @project_tm.tickets.first.should be_an_instance_of(@klass)
28
- end
29
-
30
- it "should be able to load all tickets based on array of id's" do
31
- tickets = @project_tm.tickets([1])
32
- tickets.should be_an_instance_of(Array)
33
- tickets.first.should be_an_instance_of(@klass)
34
- tickets.first.id.should == 1
35
- end
36
-
37
- it "should be able to load a single ticket based on id" do
38
- ticket = @project_tm.ticket(1)
39
- ticket.should be_an_instance_of(@klass)
40
- ticket.id.should == 1
41
- end
42
-
43
- it "should be able to load a single ticket based on attributes" do
44
- ticket = @project_tm.ticket(:id => 1)
45
- ticket.should be_an_instance_of(@klass)
46
- ticket.id.should == 1
47
- end
48
-
49
- end
@@ -1,15 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe "TicketMaster::Provider::Jira" do
4
- before(:each) do
5
- @url = "some_url"
6
- @fj = FakeJiraTool.new
7
- Jira4R::JiraTool.stub!(:new).with(2, @url).and_return(@fj)
8
- end
9
-
10
- it "should be able to instantiate a new ticketmaster instance" do
11
- @tm = TicketMaster.new(:jira, :username => 'testing', :password => 'testing', :url => @url)
12
- @tm.should be_an_instance_of(TicketMaster)
13
- @tm.should be_a_kind_of(TicketMaster::Provider::Jira)
14
- end
15
- end
@@ -1,21 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "lib/jira/version"
4
-
5
- Gem::Specification.new do |s|
6
- s.name = "ticketmaster-jira"
7
- s.version = TicketMaster::Jira::VERSION
8
- s.platform = Gem::Platform::RUBY
9
- s.authors = ["Charles Lowell"]
10
- s.email = ["cowboyd@thefrontside.net"]
11
- s.homepage = "http://github.com/cowboyd/ticketmaster-jira"
12
- s.summary = %q{TicketMaster binding for JIRA}
13
- s.description = %q{Interact with Atlassian JIRA ticketing system from ruby}
14
- s.add_dependency "ticketmaster"
15
- s.add_dependency "jira4r"
16
- s.add_development_dependency "rspec", ">= 2.0.0"
17
- s.files = `git ls-files`.split("\n")
18
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
- s.require_paths = ["lib"]
21
- end