scudco-taglob 1.1.0 → 1.1.1
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.
- data/History.txt +4 -0
- data/lib/taglob.rb +1 -1
- data/lib/taglob/extensions/dir.rb +3 -5
- data/spec/taglob_spec.rb +7 -0
- metadata +2 -2
data/History.txt
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
=== 1.1.1 / 2008-11-25
|
|
2
|
+
* Minor Changes
|
|
3
|
+
* Dir.taglob will now act like a regular glob if tags passed in is nil
|
|
4
|
+
|
|
1
5
|
=== 1.1.0 / 2008-11-17
|
|
2
6
|
* New Feature
|
|
3
7
|
* TagHtmlFormatter opens up the RSpec HTML Formatter to print the tags environment variable which useful if you do something like:
|
data/lib/taglob.rb
CHANGED
|
@@ -10,11 +10,9 @@ class Dir
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def self.taglob(pattern,tags)
|
|
13
|
-
if
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Dir.tag_and(pattern,*tags.split(','))
|
|
17
|
-
end
|
|
13
|
+
return glob(pattern) if tags.nil?
|
|
14
|
+
return Dir.tag_or(pattern,*tags.split('|')) if tags.include?('|')
|
|
15
|
+
Dir.tag_and(pattern,*tags.split(','))
|
|
18
16
|
end
|
|
19
17
|
|
|
20
18
|
def self.tag_and(pattern, *tags)
|
data/spec/taglob_spec.rb
CHANGED
|
@@ -41,6 +41,13 @@ describe Dir do
|
|
|
41
41
|
tagged_files.should include('spec/tagged_files/epic_lulz.rb')
|
|
42
42
|
end
|
|
43
43
|
|
|
44
|
+
it "should act like a regular glob if tags are nil" do
|
|
45
|
+
pattern = 'spec/tagged_files/*.rb'
|
|
46
|
+
globbed_files = Dir.glob(pattern)
|
|
47
|
+
tagged_files = Dir.taglob('spec/tagged_files/*.rb',nil)
|
|
48
|
+
(tagged_files - globbed_files).should be_empty
|
|
49
|
+
end
|
|
50
|
+
|
|
44
51
|
end
|
|
45
52
|
|
|
46
53
|
describe File do
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: scudco-taglob
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adam Anderson
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2008-11-
|
|
12
|
+
date: 2008-11-25 00:00:00 -08:00
|
|
13
13
|
default_executable: taglob
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|