From 04d52a862b6d34bde344a1d4362387849cf4bde2 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Wed, 5 Feb 2025 10:34:37 -0800 Subject: [PATCH] Fix misc setup and comment typos Improve the output of the setup a bit. Signed-off-by: Tim Smith --- lib/net/scp.rb | 4 ++-- lib/net/scp/download.rb | 2 +- setup.rb | 38 +++++++++++++++++++------------------- test/test_scp.rb | 4 ++-- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/net/scp.rb b/lib/net/scp.rb index 1bb4333..47358b8 100644 --- a/lib/net/scp.rb +++ b/lib/net/scp.rb @@ -64,7 +64,7 @@ module Net # puts "#{name}: #{sent}/#{total}" # end # - # Whenever a new chunk of data is recieved for or sent to a file, the callback + # Whenever a new chunk of data is received for or sent to a file, the callback # will be invoked, indicating the name of the file (local for downloads, # remote for uploads), the number of bytes that have been sent or received # so far for the file, and the size of the file. @@ -368,7 +368,7 @@ def start_command(mode, local, remote, options={}, &callback) raise Net::SCP::Error, 'SCP did not finish successfully ' \ "(#{channel[:exit]}): #{channel[:error_string]}" end - # We may get no exit-status at all as returning a status is only RECOMENDED + # We may get no exit-status at all as returning a status is only RECOMMENDED # in RFC4254. But if our state is not :finish, something went wrong if channel[:exit].nil? && channel[:state] != :finish raise Net::SCP::Error, 'SCP did not finish successfully ' \ diff --git a/lib/net/scp/download.rb b/lib/net/scp/download.rb index 22aced3..fcceafd 100644 --- a/lib/net/scp/download.rb +++ b/lib/net/scp/download.rb @@ -73,7 +73,7 @@ def read_data_state(channel) # Finishes off the read, sets the times for the file (if any), and then # jumps to either #finish_state (for single-file downloads) or # #read_directive_state (for recursive downloads). A 0-byte is sent to the - # server to indicate that the file was recieved successfully. + # server to indicate that the file was received successfully. def finish_read_state(channel) channel[:io].close unless channel[:io] == channel[:local] diff --git a/setup.rb b/setup.rb index 1549b3f..a629496 100644 --- a/setup.rb +++ b/setup.rb @@ -120,7 +120,7 @@ class ConfigTable ((major == 1) and ((minor >= 5) or ((minor == 4) and (teeny >= 4))))) - + subprefix = lambda {|path| path.sub(/\A#{Regexp.quote(c['prefix'])}/o, '$prefix') } @@ -172,7 +172,7 @@ class ConfigTable 'the directory for ruby scripts' ] ], [ 'so-dir', [ sodir, 'path', - 'the directory for ruby extentions' ] ], + 'the directory for ruby extensions' ] ], [ 'data-dir', [ '$prefix/share', 'path', 'the directory for shared data' ] ], @@ -184,10 +184,10 @@ class ConfigTable 'the ruby program using for installation' ] ], [ 'make-prog', [ makeprog, 'name', - 'the make program to compile ruby extentions' ] ], + 'the make program to compile ruby extensions' ] ], [ 'without-ext', [ 'no', 'yes/no', - 'does not compile/install ruby extentions' ] ] + 'does not compile/install ruby extensions' ] ] ] multipackage_descripters = [ [ 'with', [ '', @@ -303,7 +303,7 @@ def []=(k, v) unless ConfigTable.config_key?(k) @table[k] = v end - + def [](key) return nil unless @table[key] @table[key].gsub(%r<\$([^/]+)>) { self[$1] } @@ -479,7 +479,7 @@ def command(str) def ruby(str) command config('ruby-prog') + ' ' + str end - + def make(task = '') command config('make-prog') + ' ' + task end @@ -572,7 +572,7 @@ def srcexist?(path) def srcdirectory?(path) File.dir?(srcfile(path)) end - + def srcfile?(path) File.file? srcfile(path) end @@ -606,10 +606,10 @@ class ToplevelInstaller TASKS = [ [ 'config', 'saves your configurations' ], [ 'show', 'shows current configuration' ], - [ 'setup', 'compiles ruby extentions and others' ], + [ 'setup', 'compiles ruby extensions and others' ], [ 'install', 'installs files' ], - [ 'clean', "does `make clean' for each extention" ], - [ 'distclean',"does `make distclean' for each extention" ] + [ 'clean', "does `make clean' for each extension" ], + [ 'distclean',"does `make distclean' for each extension" ] ] def ToplevelInstaller.invoke @@ -708,7 +708,7 @@ def parsearg_global when '-v', '--version' puts "#{File.basename($0)} version #{Version}" exit 0 - + when '--copyright' puts Copyright exit 0 @@ -911,7 +911,7 @@ def extract_selection(list) def print_usage(f) super - f.puts 'Inluded packages:' + f.puts 'Included packages:' f.puts ' ' + @packages.sort.join(' ') f.puts end @@ -1146,7 +1146,7 @@ def install_dir_lib(rel) def install_dir_ext(rel) return unless extdir?(curr_srcdir()) - install_files ruby_extentions('.'), + install_files ruby_extensions('.'), "#{config('so-dir')}/#{File.dirname(rel)}", 0555 end @@ -1165,9 +1165,9 @@ def install_files(list, dest, mode) def ruby_scripts collect_filenames_auto().select {|n| /\.rb\z/ =~ n || "module.yml" == n } end - + # picked up many entries from cvs-1.11.1/src/ignore.c - reject_patterns = %w( + reject_patterns = %w( core RCSLOG tags TAGS .make.state .nse_depinfo #* .#* cvslog.* ,* .del-* *.olb *~ *.old *.bak *.BAK *.orig *.rej _$* *$ @@ -1212,14 +1212,14 @@ def mapdir(filelist) } end - def ruby_extentions(dir) - _ruby_extentions(dir) or - raise InstallError, "no ruby extention exists: 'ruby #{$0} setup' first" + def ruby_extensions(dir) + _ruby_extensions(dir) or + raise InstallError, "no ruby extension exists: 'ruby #{$0} setup' first" end DLEXT = /\.#{ ::Config::CONFIG['DLEXT'] }\z/ - def _ruby_extentions(dir) + def _ruby_extensions(dir) Dir.open(dir) {|d| return d.select {|fname| DLEXT =~ fname } } diff --git a/test/test_scp.rb b/test/test_scp.rb index 4fd4504..2ae702d 100644 --- a/test/test_scp.rb +++ b/test/test_scp.rb @@ -32,7 +32,7 @@ def test_start_with_block_should_yield_scp_and_close_ssh_session assert yielded end - def test_self_upload_should_instatiate_scp_and_invoke_synchronous_upload + def test_self_upload_should_instantiate_scp_and_invoke_synchronous_upload scp = stub('scp') scp.expects(:upload!).with("/path/to/local", "/path/to/remote", { :recursive => true }) @@ -44,7 +44,7 @@ def test_self_upload_should_instatiate_scp_and_invoke_synchronous_upload { :ssh => { :password => "foo" }, :recursive => true }) end - def test_self_download_should_instatiate_scp_and_invoke_synchronous_download + def test_self_download_should_instantiate_scp_and_invoke_synchronous_download scp = stub('scp') scp.expects(:download!).with("/path/to/remote", "/path/to/local", { :recursive => true }).returns(:result)