shell 0.7 → 0.8.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
  SHA256:
3
- metadata.gz: 5731c5319990a3fb1a02db2a135c057bf853ded268b98b586776f6fdcce1df85
4
- data.tar.gz: f2dd57578ebed9655e3b0ba674f3cb927eb721de212758e3c5b1c937e67ad375
3
+ metadata.gz: 725ac86ca2cf108dc844a20dfc8816628e8ee18380359c8f436c0ed4ebed178c
4
+ data.tar.gz: 57036ed1e2570f4dd0cfda11de47c669aa303c4c7274ca9da46c7ab9d1adbba5
5
5
  SHA512:
6
- metadata.gz: bd1c3a801a915e3392865852e362a5809acc51d6e68244e381074f62b50dcb046f3b2963808e48382b2b3f0eb54aa0cb3fba65f0eb04fac5f4899aa048643d99
7
- data.tar.gz: 1261e7aa66a6d488588332d83c5ea9a7d93bbe30344cd01abc838fb811d3fabb4758dfdb98c679c4090322c4982f811bc76a07c9c6e006b3cd6de141351a6d28
6
+ metadata.gz: 3624a4a880f078d3f1cff41266660e4093ffe3dd15f96afa21862587395953197fd22d0e31f10bd182ca73c44027941a95e68326c820950014eab8bb1a9029c6
7
+ data.tar.gz: 495b7578bbb8e91ae22310c8cae0081f9bc68e40138c856c492097ff1f5f2f42c7e50a7d2b21454c06086262a5674e9da7ba4d1e6482f45124f90071bf7a4370
data/Gemfile CHANGED
@@ -2,5 +2,10 @@ source "https://rubygems.org"
2
2
 
3
3
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
- # Specify your gem's dependencies in shell.gemspec
6
5
  gemspec
6
+
7
+ group :development do
8
+ gem "bundler"
9
+ gem "rake"
10
+ gem "test-unit"
11
+ end
data/Rakefile CHANGED
@@ -2,8 +2,8 @@ require "bundler/gem_tasks"
2
2
  require "rake/testtask"
3
3
 
4
4
  Rake::TestTask.new(:test) do |t|
5
- t.libs << "test" << "test/lib"
6
- t.libs << "lib"
5
+ t.libs << "test/lib"
6
+ t.ruby_opts << "-rhelper"
7
7
  t.test_files = FileList["test/**/test_*.rb"]
8
8
  end
9
9
 
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 iterator?
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 iterator?
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 iterator?
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 iterator?
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 iterator?
443
+ if block_given?
441
444
  @alias_map[ali.intern] = proc
442
445
 
443
446
  eval((d = %Q[def #{ali}(*opts)
@@ -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 iterator?
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
@@ -11,7 +11,7 @@
11
11
  #
12
12
 
13
13
  class Shell # :nodoc:
14
- VERSION = "0.7"
14
+ VERSION = "0.8.0"
15
15
  @RELEASE_VERSION = VERSION
16
16
  @LAST_UPDATE_DATE = "07/03/20"
17
17
  end
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 = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "lib/shell.rb", "lib/shell/builtin-command.rb", "lib/shell/command-processor.rb", "lib/shell/error.rb", "lib/shell/filter.rb", "lib/shell/process-controller.rb", "lib/shell/system-command.rb", "lib/shell/version.rb", "shell.gemspec"]
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: '0.7'
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: 2018-12-04 00:00:00.000000000 Z
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
- rubyforge_project:
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
@@ -1,8 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.5.1
5
- - ruby-head
6
- before_install: gem install bundler -v 1.16.2