cmd_executable 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -1
- data/lib/cmd_executable.rb +4 -0
- data/lib/cmd_executable/runner.rb +1 -1
- data/lib/cmd_executable/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9eb46221d3ed8c07d273bc3d2590dc588d9b647821aa30878570aab30e95f583
|
4
|
+
data.tar.gz: 85e9a6bf88a681af1a74edc1974f6eb10d786f8973a54197d9824b74179de5da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b07679a1c1e9f161962c932347d855363416274276a993d55d03eec1242b98e92a3c9f98f1cf3583a2dcb401fc9de68930d8e6e9181d4932ca64662b7c8d44b0
|
7
|
+
data.tar.gz: '087e5ddeb2a3a923097c5b9c28cf86a5355df624c7a5b48dce0b970d6e712a3a447f4bf9d77b600b67c5ce0f276d0cdf87ab9eee8624ae0c64b590cf082d8a88'
|
data/README.md
CHANGED
@@ -21,7 +21,7 @@ Or install it yourself as:
|
|
21
21
|
`$ gem install cmd_executable`
|
22
22
|
|
23
23
|
## Usage
|
24
|
-
### as Module
|
24
|
+
### as Module (include)
|
25
25
|
```
|
26
26
|
require 'cmd_executable'
|
27
27
|
|
@@ -36,6 +36,14 @@ class Klass
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
```
|
39
|
+
### as Module method
|
40
|
+
```
|
41
|
+
CmdExecutable.executable?('/bin/ls')
|
42
|
+
CmdExecutable.executable?('ls')
|
43
|
+
CmdExecutable.executable?(:ls)
|
44
|
+
CmdExecutable.executable?('./bin/setup')
|
45
|
+
```
|
46
|
+
|
39
47
|
### as CLI
|
40
48
|
Check executable? :
|
41
49
|
|
data/lib/cmd_executable.rb
CHANGED
@@ -43,6 +43,10 @@ module CmdExecutable
|
|
43
43
|
class CmdExecutableError < StandardError; end
|
44
44
|
|
45
45
|
def executable?(command)
|
46
|
+
CmdExecutable.executable?(command)
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.executable?(command)
|
46
50
|
parsed = CmdExecutable::Parser.new(command)
|
47
51
|
raise ArgumentError unless parsed.validate?
|
48
52
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cmd_executable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toshiki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|