script-runner 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5adc86a5ade412404f97da960195285a5cd9c9d5
4
- data.tar.gz: b4ce5c7742f04412fb7df809b1d6a676547b9d3b
3
+ metadata.gz: d4ccdd0bfb2424e55fe11f826fda04d61d38db04
4
+ data.tar.gz: 1f030b5880415acaefb2a22f8fc6d6354478d342
5
5
  SHA512:
6
- metadata.gz: 1cffb8d33edaa322fb331e1b91cc73bb2b47cd6fd15e2ccfa6fedad39bfa26d7ac2bf2911e062f0bd69101eb0e9b14e14fbcf0d903fcbf224e5068648bea88b2
7
- data.tar.gz: db92f171a17303b7bddb6a679bafbc5f621ea27a677331863c42caddd045a27373f7dc58574f468f4f9559251e1ca54b8036f3be625b522295d37d4c314562a4
6
+ metadata.gz: d8e3e16899803cd30a2abcf7e874aa1a7cf0ea6a0e28261669ba887fe14d9185923b84c395f64a0c070740bcc3674502a1a1572e82f82bcbd9940a2089371e0e
7
+ data.tar.gz: 5e4a3458687747e5e94c435f6d4fde640e21cd8d9730f146fcb0c313ebc86aca52f88e51f1af73c2bf29959b613a1f94a7ad182079dd2f89b6e21fa012e5936d
data/README.md CHANGED
@@ -46,6 +46,7 @@ Note: for each root_path, all files under are invoked in alphabetical order
46
46
 
47
47
 
48
48
  ### Changelog
49
+ 0.0.5 - only set env if there are scripts to run
49
50
  0.0.4 - fixed dependency on logging
50
51
  0.0.3 - Added logging
51
52
  0.0.2 - Added mit license
@@ -19,13 +19,18 @@ module ScriptRunner
19
19
  # @block - a block to handle the output of the script if non is given it is sent to the console
20
20
  def run( paths, env_vars, error_handler = nil, &block)
21
21
 
22
- set_env(env_vars)
23
22
  all_paths = all_files(paths).select{ |p| File.file? p }
23
+
24
24
  @logger.debug all_paths
25
+
25
26
  runnable = all_paths.select{ |p| File.executable? p }
27
+
28
+ set_env(env_vars) if runnable.length > 0
29
+
26
30
  non_runnable = all_paths - runnable
27
- @logger.debug "non_runnable: #{non_runnable}"
31
+
28
32
  @logger.debug "runnable: #{runnable}"
33
+
29
34
  non_runnable.each{ |nr|
30
35
  @logger.warn "#{nr} is not runnable - skipping"
31
36
  }
@@ -1,4 +1,4 @@
1
1
  module ScriptRunner
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: script-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - ed.eustace