rindle 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -45,7 +45,15 @@ class Rindle
45
45
  end
46
46
 
47
47
  def find_by_name name
48
- find(:first, :named => name)
48
+ Rindle.collections.values.each do |col|
49
+ case name
50
+ when String
51
+ return col if col.name == name
52
+ when Regexp
53
+ return col if col.name =~ name
54
+ end
55
+ end
56
+ nil
49
57
  end
50
58
 
51
59
  def create name, options = {}
@@ -71,14 +71,12 @@ class Rindle
71
71
 
72
72
  def find_by_name name
73
73
  Rindle.index.values.each do |doc|
74
- return doc if doc.filename =~ /#{name.is_a?(String) ? Regexp.escape(name) : name}/
75
- end
76
- nil
77
- end
78
-
79
- def find_by_path path
80
- Rindle.index.values.each do |doc|
81
- return doc if doc.path =~ /#{path.is_a?(String) ? Regexp.escape(path) : path}/
74
+ case name
75
+ when String
76
+ return doc if doc.filename == name
77
+ when Regexp
78
+ return doc if doc.filename =~ name
79
+ end
82
80
  end
83
81
  nil
84
82
  end
@@ -1,3 +1,3 @@
1
1
  class Rindle
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rindle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-05-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &23927160 !ruby/object:Gem::Requirement
16
+ requirement: &23945440 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *23927160
24
+ version_requirements: *23945440
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: guard-rspec
27
- requirement: &23926480 !ruby/object:Gem::Requirement
27
+ requirement: &23944920 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *23926480
35
+ version_requirements: *23944920
36
36
  description: The Rindle gem provides an object-oriented way to manage kindle collection
37
37
  data.
38
38
  email:
@@ -87,7 +87,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  segments:
89
89
  - 0
90
- hash: 3492335425062927248
90
+ hash: -3426703601713118136
91
91
  required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  none: false
93
93
  requirements:
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  version: '0'
97
97
  segments:
98
98
  - 0
99
- hash: 3492335425062927248
99
+ hash: -3426703601713118136
100
100
  requirements: []
101
101
  rubyforge_project:
102
102
  rubygems_version: 1.8.17