diff options
Diffstat (limited to 'lib/shell/command-processor.rb')
| -rw-r--r-- | lib/shell/command-processor.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/shell/command-processor.rb b/lib/shell/command-processor.rb index 8a9ab55e73..08ea5c874c 100644 --- a/lib/shell/command-processor.rb +++ b/lib/shell/command-processor.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false # # shell/command-controller.rb - # $Release Version: 0.7 $ @@ -10,7 +11,6 @@ # require "e2mmap" -require "thread" require "shell/error" require "shell/filter" @@ -24,7 +24,6 @@ class Shell # Alternatively, you can execute any command via # Shell::CommandProcessor#system even if it is not defined. class CommandProcessor -# include Error # # initialize of Shell and related classes. @@ -54,8 +53,9 @@ class Shell # include run file. # def self.run_config + rc = "~/.rb_shell" begin - load File.expand_path("~/.rb_shell") if ENV.key?("HOME") + load File.expand_path(rc) if ENV.key?("HOME") rescue LoadError, Errno::ENOENT rescue print "load error: #{rc}\n" @@ -121,11 +121,10 @@ class Shell end f else - f = File.open(path, mode, perm, &b) + File.open(path, mode, perm, &b) end end end - # public :open # call-seq: # unlink(path) @@ -181,6 +180,9 @@ class Shell top_level_test(command, file1) end else + unless FileTest.methods(false).include?(command.to_sym) + raise "unsupported command: #{ command }" + end if file2 FileTest.send(command, file1, file2) else @@ -650,7 +652,6 @@ class Shell ["mtime", ["FILENAME"]], ["readlink", ["FILENAME"]], ["rename", ["FILENAME_FROM", "FILENAME_TO"]], - # ["size", ["FILENAME"]], ["split", ["pathname"]], ["stat", ["FILENAME"]], ["symlink", ["FILENAME_O", "FILENAME_N"]], |
