starting_blocks 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/starting_blocks/version.rb +1 -1
- data/lib/starting_blocks/watcher.rb +7 -1
- data/spec/starting_blocks/watcher_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19a0a1f6a480f8b3044b50341b17c467084eb6ae
|
4
|
+
data.tar.gz: 2747ea5cb18050cbaddcaeea8966505fc982958c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e986d863dc89b7ce661f682d76eff623f171b6e41039de3dda2004244a86b22643619d4ad3ffcfa9a143b43229a997846159e447ae7306f99a227b26db497ea9
|
7
|
+
data.tar.gz: 8d84ed1409a3ec70f5d8fb75264255ec575a53de22995ed6d5d3c1aaab58b3379806654d9a9bdc1d1c436f29f4324ae7424d46c986e80b40ec40c3cb4d951bbd
|
@@ -17,12 +17,18 @@ module StartingBlocks
|
|
17
17
|
def self.filter_files_by_file_clues files, clues
|
18
18
|
files.select do |file|
|
19
19
|
file_without_path = file.split('/')[-1]
|
20
|
-
matches = clues.select { |
|
20
|
+
matches = clues.select { |c| the_clue_and_the_file_match c, file }
|
21
21
|
matches.count > 0
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
class << self
|
26
|
+
|
27
|
+
def the_clue_and_the_file_match clue, file
|
28
|
+
file_without_extension = file.split('.')[0]
|
29
|
+
file_without_extension.end_with?(clue) || file_without_extension.start_with?(clue)
|
30
|
+
end
|
31
|
+
|
26
32
|
def start_watching(dir, options)
|
27
33
|
StartingBlocks.display("Start watching #{dir.getwd} with #{options.inspect}")
|
28
34
|
set_up_the_runner options
|
@@ -46,6 +46,12 @@ describe StartingBlocks::Watcher do
|
|
46
46
|
[
|
47
47
|
['another', 'two_spec.txt', 'three_test.txt'], ['_spec', '_test'], ['two_spec.txt', 'three_test.txt'],
|
48
48
|
],
|
49
|
+
[
|
50
|
+
['another', 'two_spec_something_else.txt', 'three_test.txt'], ['_spec', '_test'], ['three_test.txt'],
|
51
|
+
],
|
52
|
+
[
|
53
|
+
['ttest_two_spec_something_else.txt', 'test_three.txt'], ['_spec', 'test_'], ['test_three.txt'],
|
54
|
+
],
|
49
55
|
].map { |x| Struct.new(:files, :clues, :expected).new(*x) }.each do |example|
|
50
56
|
|
51
57
|
describe "multiple examples" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: starting_blocks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darren Cauthon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|