rya 0.6.1 → 0.6.2

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: d17c0c0ca582101d0d745d17097eb04f045220df
4
- data.tar.gz: 5a77af9402db8fc782d80aed266fbbe208eeb858
3
+ metadata.gz: e8d27865a1d6cb8ca8975bb7f3f72aac8c0d9038
4
+ data.tar.gz: adc52e9ecdaa29ea6c86262d395597071b9fda07
5
5
  SHA512:
6
- metadata.gz: 52fa718c1d7aefae67bf71f9e747fae67716f199b32c95576e76c69524409146ebf0314de829878167beff7308d2121f50817da6ccb5d1b24fdc1f18d838937b
7
- data.tar.gz: 2d5e9bbe8e3a484c1103ea4e984b2c7ebf2a4db6ec34917b2e31144ad14bbae2055e19dcdbaeac934252ccaaa5321b5ba412cbaf4105b6818df12985d2910312
6
+ metadata.gz: 86a3ebcee9b3de4b4ccc74c1dc9c75a5642c1cf2bf5d3490762c77aa9d977a907e9743598959a3502a088e0f74dfba9437e1cc1860ddb8f477040497f50e94b8
7
+ data.tar.gz: ee0f780156d40e913de737f4c8632f02e4a2906d035305c25def61b797cf87a7eae01f75453b21a0735843d96fb4c719272d354ec782dd344d212aff70be70b4
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rya (0.6.1)
4
+ rya (0.6.2)
5
5
  abort_if (~> 0.2.0)
6
6
  systemu (~> 2.6, >= 2.6.5)
7
7
 
@@ -22,18 +22,21 @@ module Rya
22
22
  module File
23
23
  # Check if a string specifies an executable command on the PATH.
24
24
  #
25
- # @param cmd The name of a command to check.
25
+ # @param cmd The name of a command to check, or a path to an actual executable binary.
26
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
27
+ # @return nil if the cmd is not executable or it is not on the PATH.
28
+ # @return [String] /path/to/cmd if the cmd is executable or is on the PATH.
29
29
  #
30
30
  # @example
31
31
  # File.extend Rya::CoreExtensions::File
32
- # File.command? "ls" #=> /bin/ls
32
+ # File.command? "ls" #=> "/bin/ls"
33
33
  # File.command? "arstoien" #=> nil
34
+ # File.command? "/bin/ls" #=> "/bin/ls"
34
35
  #
35
36
  # @note See https://stackoverflow.com/questions/2108727.
36
37
  def command? cmd
38
+ return cmd if Object::File.executable? cmd
39
+
37
40
  exts = ENV["PATHEXT"] ? ENV["PATHEXT"].split(";") : [""]
38
41
 
39
42
  ENV["PATH"].split(Object::File::PATH_SEPARATOR).each do |path|
@@ -260,4 +263,3 @@ module Rya
260
263
  STRING = Class.new.extend(Rya::CoreExtensions::String)
261
264
  end
262
265
  end
263
-
@@ -1,3 +1,3 @@
1
1
  module Rya
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
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.6.1
4
+ version: 0.6.2
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-10-11 00:00:00.000000000 Z
11
+ date: 2020-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler