slaskis-fleakr 0.5.3 → 0.5.4

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.
@@ -41,7 +41,7 @@ module Fleakr
41
41
  c.sets = e.search("//set").map{|s| Fleakr::Objects::Set.new(s)} || []
42
42
  c.collections = recurse_collections(e.search("//collection"))
43
43
  end
44
- return collections
44
+ collections
45
45
  end
46
46
 
47
47
  end
@@ -94,13 +94,14 @@ module Fleakr
94
94
  def collection_by_id(id)
95
95
  response = Fleakr::Api::MethodRequest.with_response!('collections.getTree', :user_id => self.id)
96
96
  doc = response.body
97
- (doc/"//collection").map do |e|
98
- if e[:id] =~ /^\d*-?#{id}$/
97
+ collections = (doc/"//collection").map do |e|
98
+ if e[:id] =~ /^(?:\d*-)?#{id}$/
99
99
  Collection.new(e)
100
100
  else
101
101
  nil
102
102
  end
103
- end.compact!.first
103
+ end.compact
104
+ collections.first
104
105
  end
105
106
 
106
107
  end
@@ -3,7 +3,7 @@ module Fleakr
3
3
 
4
4
  MAJOR = 0
5
5
  MINOR = 5
6
- TINY = 3
6
+ TINY = 4
7
7
 
8
8
  def self.to_s
9
9
  [MAJOR, MINOR, TINY].join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slaskis-fleakr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Reagan
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-19 00:00:00 -07:00
12
+ date: 2009-08-21 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency