starting_blocks 1.2.0 → 1.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1462b26d4b584409f66efc4d657de2a05ecf0e0d
4
- data.tar.gz: cd075e1c73f7c8d7ce013624679675b6b2a670d0
3
+ metadata.gz: 19a0a1f6a480f8b3044b50341b17c467084eb6ae
4
+ data.tar.gz: 2747ea5cb18050cbaddcaeea8966505fc982958c
5
5
  SHA512:
6
- metadata.gz: 76503a6ffbd9583c06bedfdc11a9f0ea02f70ec14130c773041864e5e7e1694909f5033232e313f9482085d8855ab801d4178f0e7b97fc3e2eced3b815ecc36d
7
- data.tar.gz: 26fef9f5f5a0dda1c8861ff7fe20bf443465bfa28ce77780ed6dbc29989a07049078370fe217d0b30835be7b5e49b3827a2c27814fa36f8ef5b30265fe538d8f
6
+ metadata.gz: e986d863dc89b7ce661f682d76eff623f171b6e41039de3dda2004244a86b22643619d4ad3ffcfa9a143b43229a997846159e447ae7306f99a227b26db497ea9
7
+ data.tar.gz: 8d84ed1409a3ec70f5d8fb75264255ec575a53de22995ed6d5d3c1aaab58b3379806654d9a9bdc1d1c436f29f4324ae7424d46c986e80b40ec40c3cb4d951bbd
@@ -1,3 +1,3 @@
1
1
  module StartingBlocks
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -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 { |clue| file_without_path.include? clue }
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.0
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-26 00:00:00.000000000 Z
11
+ date: 2014-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler