shell 0.7 → 0.8.0
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 +4 -4
- data/Gemfile +6 -1
- data/Rakefile +2 -2
- data/lib/shell.rb +3 -3
- data/lib/shell/command-processor.rb +5 -2
- data/lib/shell/system-command.rb +1 -1
- data/lib/shell/version.rb +1 -1
- data/shell.gemspec +17 -4
- metadata +4 -35
- data/.gitignore +0 -8
- data/.travis.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 725ac86ca2cf108dc844a20dfc8816628e8ee18380359c8f436c0ed4ebed178c
|
4
|
+
data.tar.gz: 57036ed1e2570f4dd0cfda11de47c669aa303c4c7274ca9da46c7ab9d1adbba5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3624a4a880f078d3f1cff41266660e4093ffe3dd15f96afa21862587395953197fd22d0e31f10bd182ca73c44027941a95e68326c820950014eab8bb1a9029c6
|
7
|
+
data.tar.gz: 495b7578bbb8e91ae22310c8cae0081f9bc68e40138c856c492097ff1f5f2f42c7e50a7d2b21454c06086262a5674e9da7ba4d1e6482f45124f90071bf7a4370
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/lib/shell.rb
CHANGED
@@ -263,7 +263,7 @@ class Shell
|
|
263
263
|
def chdir(path = nil, verbose = @verbose)
|
264
264
|
check_point
|
265
265
|
|
266
|
-
if
|
266
|
+
if block_given?
|
267
267
|
notify("chdir(with block) #{path}") if verbose
|
268
268
|
cwd_old = @cwd
|
269
269
|
begin
|
@@ -297,7 +297,7 @@ class Shell
|
|
297
297
|
def pushdir(path = nil, verbose = @verbose)
|
298
298
|
check_point
|
299
299
|
|
300
|
-
if
|
300
|
+
if block_given?
|
301
301
|
notify("pushdir(with block) #{path}") if verbose
|
302
302
|
pushdir(path, nil)
|
303
303
|
begin
|
@@ -446,7 +446,7 @@ class Shell
|
|
446
446
|
_head = true
|
447
447
|
STDERR.print opts.collect{|mes|
|
448
448
|
mes = mes.dup
|
449
|
-
yield mes if
|
449
|
+
yield mes if block_given?
|
450
450
|
if _head
|
451
451
|
_head = false
|
452
452
|
prefix + mes
|
@@ -180,6 +180,9 @@ class Shell
|
|
180
180
|
top_level_test(command, file1)
|
181
181
|
end
|
182
182
|
else
|
183
|
+
unless FileTest.methods(false).include?(command.to_sym)
|
184
|
+
raise "unsupported command: #{ command }"
|
185
|
+
end
|
183
186
|
if file2
|
184
187
|
FileTest.send(command, file1, file2)
|
185
188
|
else
|
@@ -343,7 +346,7 @@ class Shell
|
|
343
346
|
# %pwd, %cwd -> @pwd
|
344
347
|
def notify(*opts)
|
345
348
|
Shell.notify(*opts) {|mes|
|
346
|
-
yield mes if
|
349
|
+
yield mes if block_given?
|
347
350
|
|
348
351
|
mes.gsub!("%pwd", "#{@cwd}")
|
349
352
|
mes.gsub!("%cwd", "#{@cwd}")
|
@@ -437,7 +440,7 @@ class Shell
|
|
437
440
|
ali = ali.id2name if ali.kind_of?(Symbol)
|
438
441
|
command = command.id2name if command.kind_of?(Symbol)
|
439
442
|
begin
|
440
|
-
if
|
443
|
+
if block_given?
|
441
444
|
@alias_map[ali.intern] = proc
|
442
445
|
|
443
446
|
eval((d = %Q[def #{ali}(*opts)
|
data/lib/shell/system-command.rb
CHANGED
@@ -147,7 +147,7 @@ class Shell
|
|
147
147
|
# yorn: Boolean(@shell.debug? or @shell.verbose?)
|
148
148
|
def notify(*opts)
|
149
149
|
@shell.notify(*opts) do |mes|
|
150
|
-
yield mes if
|
150
|
+
yield mes if block_given?
|
151
151
|
|
152
152
|
mes.gsub!("%id", "#{@command}:##{@pid}")
|
153
153
|
mes.gsub!("%name", "#{@command}")
|
data/lib/shell/version.rb
CHANGED
data/shell.gemspec
CHANGED
@@ -16,11 +16,24 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.homepage = "https://github.com/ruby/shell"
|
17
17
|
spec.license = "BSD-2-Clause"
|
18
18
|
|
19
|
-
spec.files = [
|
19
|
+
spec.files = [
|
20
|
+
"Gemfile",
|
21
|
+
"LICENSE.txt",
|
22
|
+
"README.md",
|
23
|
+
"Rakefile",
|
24
|
+
"bin/console",
|
25
|
+
"bin/setup",
|
26
|
+
"lib/shell.rb",
|
27
|
+
"lib/shell/builtin-command.rb",
|
28
|
+
"lib/shell/command-processor.rb",
|
29
|
+
"lib/shell/error.rb",
|
30
|
+
"lib/shell/filter.rb",
|
31
|
+
"lib/shell/process-controller.rb",
|
32
|
+
"lib/shell/system-command.rb",
|
33
|
+
"lib/shell/version.rb",
|
34
|
+
"shell.gemspec",
|
35
|
+
]
|
20
36
|
spec.bindir = "exe"
|
21
37
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
38
|
spec.require_paths = ["lib"]
|
23
|
-
|
24
|
-
spec.add_development_dependency "bundler"
|
25
|
-
spec.add_development_dependency "rake"
|
26
39
|
end
|
metadata
CHANGED
@@ -1,43 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keiju ISHITSUKA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
11
|
+
date: 2019-10-01 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
41
13
|
description: An idiomatic Ruby interface for common UNIX shell commands.
|
42
14
|
email:
|
43
15
|
- keiju@ruby-lang.org
|
@@ -45,8 +17,6 @@ executables: []
|
|
45
17
|
extensions: []
|
46
18
|
extra_rdoc_files: []
|
47
19
|
files:
|
48
|
-
- ".gitignore"
|
49
|
-
- ".travis.yml"
|
50
20
|
- Gemfile
|
51
21
|
- LICENSE.txt
|
52
22
|
- README.md
|
@@ -81,8 +51,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
51
|
- !ruby/object:Gem::Version
|
82
52
|
version: '0'
|
83
53
|
requirements: []
|
84
|
-
|
85
|
-
rubygems_version: 2.7.6
|
54
|
+
rubygems_version: 3.0.3
|
86
55
|
signing_key:
|
87
56
|
specification_version: 4
|
88
57
|
summary: An idiomatic Ruby interface for common UNIX shell commands.
|
data/.gitignore
DELETED