ticketmaster-jira 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  class TicketMaster
2
2
  module Jira
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -28,6 +28,10 @@ module TicketMaster::Provider
28
28
  Project.find_by_attributes(options.first).first
29
29
  end
30
30
  end
31
+
32
+ def projects(*options)
33
+ Project.find(options)
34
+ end
31
35
  end
32
36
  end
33
37
 
@@ -35,15 +35,14 @@ module TicketMaster::Provider
35
35
  end
36
36
 
37
37
  def self.find(*options)
38
- jira_projects = self.find_all
39
- if options.first.is_a? Array
40
- jira_projects.select do |project|
38
+ if options[0].first.is_a? Array
39
+ self.find_all.select do |project|
41
40
  project if options.first.any? { |id| project.id == id }
42
41
  end
43
- elsif options.first.is_a? Hash
44
- find_by_attributes(options.first)
42
+ elsif options[0].first.is_a? Hash
43
+ find_by_attributes(options[0].first)
45
44
  else
46
- jira_projects
45
+ self.find_all
47
46
  end
48
47
  end
49
48
 
@@ -25,6 +25,13 @@ describe "TicketMaster::Provider::Jira::Project" do
25
25
  @tm.projects.first.id.should == 1
26
26
  end
27
27
 
28
+ it "should be load all projects based on attributes" do
29
+ projects = @tm.projects(:id => 1)
30
+ projects.should be_an_instance_of(Array)
31
+ projects.first.should be_an_instance_of(@klass)
32
+ projects.first.id.should == 1
33
+ end
34
+
28
35
  it "should be able to load a single project based on id" do
29
36
  project = @tm.project(1)
30
37
  project.should be_an_instance_of(@klass)
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: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
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-23 00:00:00 -04:00
19
+ date: 2011-05-25 00:00:00 -04:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency