automated-commands 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,8 +11,9 @@ module AutomatedCommands
11
11
 
12
12
  path = input.gets # e.g. test/unit/some_test.rb
13
13
 
14
+ reload!
14
15
  if path =~ /test\/(.*)\/.*\.rb/
15
- p "test '#{$1}'"
16
+ # p "test '#{$1}'"
16
17
  test $1
17
18
  end
18
19
  rescue => e
@@ -1,3 +1,3 @@
1
1
  module AutomatedCommands
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/tasks/watch.rake CHANGED
@@ -5,16 +5,26 @@ namespace :automated_commands do
5
5
  require 'pathname'
6
6
 
7
7
  %x[mkfifo ./test_pipe]
8
- at_exit {
9
- %x[rm ./test_pipe]
10
- }
8
+ at_exit { %x[rm ./test_pipe] }
11
9
 
12
- Listen.to('test', :filter => /.*_test\.rb$/, :latency => 0.2) do |modified, added, removed|
10
+ p "listening for changes in your tests"
11
+
12
+ Listen.to('test', filter: /.*_test\.rb$/, latency: 0.2) do |modified, added, removed|
13
13
  output = open("test_pipe", "w+")
14
- path = Pathname.new(modified.first)
15
14
 
16
- output.puts path.relative_path_from(Pathname.pwd)
17
- output.flush
15
+ (modified || []).each do |modified_file|
16
+ path = Pathname.new(modified_file)
17
+
18
+ output.puts path.relative_path_from(Pathname.pwd)
19
+ output.flush
20
+ end
21
+
22
+ (added || []).each do |added_file|
23
+ path = Pathname.new(added_file)
24
+
25
+ output.puts path.relative_path_from(Pathname.pwd)
26
+ output.flush
27
+ end
18
28
  end
19
29
  end
20
30
  end
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: automated-commands
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Raphael Randschau
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-11 00:00:00.000000000 Z
12
+ date: 2013-02-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  version_requirements: !ruby/object:Gem::Requirement