finder 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.ruby CHANGED
@@ -39,7 +39,7 @@ load_path:
39
39
  revision: 0
40
40
  name: finder
41
41
  title: Finder
42
- version: 0.1.0
42
+ version: 0.1.1
43
43
  summary: Robust library file locator
44
44
  created: '2009-11-24'
45
45
  description: Finder is a general purpose file finder for Ruby. Finder can search RubyGems,
data/HISTORY.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # RELEASE HISTORY
2
2
 
3
+ ## 0.1.1 / 2012-02-11
4
+
5
+ Fixes a few oversites in last release.
6
+
7
+ Changes:
8
+
9
+ * Fix Find.data_path arguments.
10
+ * Add Roll.data_path method.
11
+
12
+
3
13
  ## 0.1.0 / 2012-02-11
4
14
 
5
15
  Finder is a new library built from the ashes of the old Plugin gem.
@@ -3,7 +3,7 @@ require 'finder/find'
3
3
  module Finder
4
4
 
5
5
  # Current version.
6
- VERSION = '0.1.0'
6
+ VERSION = '0.1.1'
7
7
 
8
8
  # Clean module that can be included elsewhere, to proved #path, #load_path
9
9
  # and #data_path methods without including the Gem, Roll, and Site constants.
@@ -58,7 +58,7 @@ module Finder
58
58
  # @example
59
59
  # Find.data_path('bar/*')
60
60
  #
61
- def data_path(glob)
61
+ def data_path(match, options={})
62
62
  found = []
63
63
  systems.each do |system|
64
64
  found.concat system.data_path(match, options)
@@ -81,6 +81,21 @@ module Finder
81
81
  # ::Library.find_files(match)
82
82
  #end
83
83
 
84
+ def data_path(match, options={})
85
+ matches = []
86
+ ::Library.ledger.each do |name, lib|
87
+ list = []
88
+ lib = lib.sort.first if Array===lib
89
+ find = File.join(lib.location, 'data', match)
90
+ list = Dir.glob(find)
91
+ list = list.map{ |d| d.chomp('/') }
92
+ matches.concat(list)
93
+ # activate the library if activate flag
94
+ lib.activate if options[:activate] && !list.empty?
95
+ end
96
+ matches
97
+ end
98
+
84
99
  end
85
100
 
86
101
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: detroit
16
- requirement: &20870760 !ruby/object:Gem::Requirement
16
+ requirement: &18914200 !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: *20870760
24
+ version_requirements: *18914200
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: qed
27
- requirement: &20870140 !ruby/object:Gem::Requirement
27
+ requirement: &18913660 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *20870140
35
+ version_requirements: *18913660
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: ae
38
- requirement: &20869620 !ruby/object:Gem::Requirement
38
+ requirement: &18913160 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *20869620
46
+ version_requirements: *18913160
47
47
  description: Finder is a general purpose file finder for Ruby. Finder can search RubyGems,
48
48
  Roll libraries and Ruby's standard $LOAD_PATH and system data directory for the
49
49
  active or the most current library files. It is especially useful for implementing