ticketmaster-redmine 0.1.4 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm 1.8.7@ticketmaster-redmine --create
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.2.4
@@ -6,7 +6,7 @@ module TicketMaster::Provider
6
6
  class Project < TicketMaster::Provider::Base::Project
7
7
  # declare needed overloaded methods here
8
8
  API = RedmineAPI::Project
9
-
9
+
10
10
  # copy from this.copy(that) copies that into this
11
11
  def copy(project)
12
12
  project.tickets.each do |ticket|
@@ -28,14 +28,14 @@ module TicketMaster::Provider
28
28
 
29
29
  def tickets(*options)
30
30
  begin
31
- if options.first.is_a? Hash
32
- options[0].merge!(:params => {:project_id => id})
33
- super(*options)
34
- elsif options.empty?
35
- issues = RedmineAPI::Issue.find(:all, :params => {:project_id => id}).collect { |issue| TicketMaster::Provider::Redmine::Ticket.new issue }
36
- else
37
- super(*options)
38
- end
31
+ if options.first.is_a? Hash
32
+ options[0].merge!(:params => {:project_id => id})
33
+ super(*options)
34
+ elsif options.empty?
35
+ issues = RedmineAPI::Issue.find(:all, :params => {:project_id => id}).collect { |issue| TicketMaster::Provider::Redmine::Ticket.new issue }
36
+ else
37
+ super(*options)
38
+ end
39
39
  rescue
40
40
  []
41
41
  end
@@ -20,5 +20,12 @@ module TicketMaster::Provider
20
20
  RedmineAPI.authenticate(auth.server, auth.username, auth.password)
21
21
  end
22
22
 
23
+ def valid?
24
+ begin
25
+ RedmineAPI::Project.find(:all).size >= 0
26
+ rescue
27
+ false
28
+ end
29
+ end
23
30
  end
24
31
  end
@@ -25,6 +25,22 @@ module TicketMaster::Provider
25
25
  end
26
26
  end
27
27
 
28
+ def self.find(*options)
29
+ begin
30
+ if options.first.is_a? Hash
31
+ options[0].merge!(:params => {:project_id => id})
32
+ super(*options)
33
+ elsif options.empty?
34
+ issues = RedmineAPI::Issue.find(:all, :params => {:project_id => id}).collect { |issue| TicketMaster::Provider::Redmine::Ticket.new issue }
35
+ else
36
+ super(*options)
37
+ end
38
+ rescue
39
+ []
40
+ end
41
+ end
42
+
43
+
28
44
  def self.find_by_id(project_id, ticket_id)
29
45
  self.new API.find(ticket_id)
30
46
  end
@@ -1,11 +1,23 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  describe "Ticketmaster::Provider::Redmine" do
4
-
4
+
5
+ before(:each) do
6
+ headers = {'Authorization' => 'Basic Y29yZWQ6YWZkZA==', 'Accept' => 'application/xml'}
7
+ ActiveResource::HttpMock.respond_to do |mock|
8
+ mock.get '/projects.xml', headers, fixture_for('projects'), 200
9
+ end
10
+ end
11
+
5
12
  it "should be able to instantiate a new instance" do
6
13
  @ticketmaster = TicketMaster.new(:redmine, {:server => 'http://redmine.server', :username => 'cored', :password => 'afdd'})
7
14
  @ticketmaster.should be_an_instance_of(TicketMaster)
8
15
  @ticketmaster.should be_a_kind_of(TicketMaster::Provider::Redmine)
9
16
  end
10
-
17
+
18
+ it "should implmement the valid method" do
19
+ @ticketmaster = TicketMaster.new(:redmine, {:server => 'http://redmine.server', :username => 'cored', :password => 'afdd'})
20
+ @ticketmaster.valid?.should be_true
21
+ end
22
+
11
23
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ticketmaster-redmine}
8
- s.version = "0.1.4"
8
+ s.version = "0.2.4"
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"]
12
- s.date = %q{2011-07-11}
12
+ s.date = %q{2011-07-28}
13
13
  s.description = %q{Allows ticketmaster to interact with Your System.}
14
14
  s.email = %q{rafael@hybridgroup.com}
15
15
  s.extra_rdoc_files = [
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
17
17
  "README.md"
18
18
  ]
19
19
  s.files = [
20
+ ".rvmrc",
20
21
  "LICENSE",
21
22
  "README.md",
22
23
  "Rakefile",
@@ -43,13 +44,6 @@ Gem::Specification.new do |s|
43
44
  s.require_paths = ["lib"]
44
45
  s.rubygems_version = %q{1.6.1}
45
46
  s.summary = %q{Ticketmaster Provider for Redmine}
46
- s.test_files = [
47
- "spec/comments_spec.rb",
48
- "spec/projects_spec.rb",
49
- "spec/spec_helper.rb",
50
- "spec/ticketmaster-redmine_spec.rb",
51
- "spec/tickets_spec.rb"
52
- ]
53
47
 
54
48
  if s.respond_to? :specification_version then
55
49
  s.specification_version = 3
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ticketmaster-redmine
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
8
+ - 2
9
9
  - 4
10
- version: 0.1.4
10
+ version: 0.2.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rafael George
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-11 00:00:00 -04:00
18
+ date: 2011-07-28 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -108,6 +108,7 @@ extra_rdoc_files:
108
108
  - LICENSE
109
109
  - README.md
110
110
  files:
111
+ - .rvmrc
111
112
  - LICENSE
112
113
  - README.md
113
114
  - Rakefile
@@ -163,9 +164,5 @@ rubygems_version: 1.6.1
163
164
  signing_key:
164
165
  specification_version: 3
165
166
  summary: Ticketmaster Provider for Redmine
166
- test_files:
167
- - spec/comments_spec.rb
168
- - spec/projects_spec.rb
169
- - spec/spec_helper.rb
170
- - spec/ticketmaster-redmine_spec.rb
171
- - spec/tickets_spec.rb
167
+ test_files: []
168
+