rya 0.5.1 → 0.6.0

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: bf9524f52eed6ef23fe2c1daa8fc469d277b6629
4
- data.tar.gz: 1669d34968985088a961d34e52bce72abae57f0b
3
+ metadata.gz: 8eb2fd69948270d6e98f44081e99ca387451f9d8
4
+ data.tar.gz: e37122a07b4a149e0b96b7bd8be1b7de2efd4e8c
5
5
  SHA512:
6
- metadata.gz: b5442858e73036f02e934dd2f8c410dd5670cf8852f565e7b6a842b240aaf829a0106feb52e05e438b30ae6f99349a87202e084ae73de736081f1d8977ff3537
7
- data.tar.gz: a74f3b9c016b3578828f248154dee3ffd5a90579d2bfd69685f886b332bddbea68ff301a9a84f1a32572cf20c61eae4b28444a102b0fa6e2536cb0edfc02257d
6
+ metadata.gz: 0d664d9d6e4fc3ac2c9e2194f4beca9bfadf2396936f7efe8e41e8944f883f34cbf13602dd98bd94c411f6a22ca65d9aa5d1e57ac2be6dbbe83c7ddd49d3e9e5
7
+ data.tar.gz: 9df918880d832efdd5c9821a2f660efa6c51c33d8c250f7ab3f33a6ea56278f291f9d9c3e141bcbf075dc297493922e97b862bdc33bc81ed2fc29a5213da7aa7
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rya (0.5.1)
4
+ rya (0.6.0)
5
5
  abort_if (~> 0.2.0)
6
6
  systemu (~> 2.6, >= 2.6.5)
7
7
 
@@ -19,6 +19,35 @@ module Rya
19
19
  end
20
20
  end
21
21
 
22
+ module File
23
+ # Check if a string specifies an executable command on the PATH.
24
+ #
25
+ # @param cmd The name of a command to check.
26
+ #
27
+ # @return nil if the cmd is not on the PATH and executable
28
+ # @return [String] /path/to/cmd if the cmd is on the PATH and executable
29
+ #
30
+ # @example
31
+ # File.extend Rya::CoreExtensions::File
32
+ # File.command? "ls" #=> /bin/ls
33
+ # File.command? "arstoien" #=> nil
34
+ #
35
+ # @note See https://stackoverflow.com/questions/2108727.
36
+ def command? cmd
37
+ exts = ENV["PATHEXT"] ? ENV["PATHEXT"].split(";") : [""]
38
+
39
+ ENV["PATH"].split(Object::File::PATH_SEPARATOR).each do |path|
40
+ exts.each do |ext|
41
+ exe = Object::File.join path, "#{cmd}#{ext}"
42
+
43
+ return exe if Object::File.executable?(exe) && !Object::File.directory?(exe)
44
+ end
45
+ end
46
+
47
+ nil
48
+ end
49
+ end
50
+
22
51
  module Math
23
52
  def scale val, old_min, old_max, new_min, new_max
24
53
  # This can happen if you use the mean across non-zero samples.
@@ -1,3 +1,3 @@
1
1
  module Rya
2
- VERSION = "0.5.1"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rya
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Moore
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-12 00:00:00.000000000 Z
11
+ date: 2019-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler