Skip to content

Fix misc setup and comment typos #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/net/scp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 ' \
Expand Down
2 changes: 1 addition & 1 deletion lib/net/scp/download.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
38 changes: 19 additions & 19 deletions setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down Expand Up @@ -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' ] ],
Expand All @@ -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', [ '',
Expand Down Expand Up @@ -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] }
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -572,7 +572,7 @@ def srcexist?(path)
def srcdirectory?(path)
File.dir?(srcfile(path))
end

def srcfile?(path)
File.file? srcfile(path)
end
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -708,7 +708,7 @@ def parsearg_global
when '-v', '--version'
puts "#{File.basename($0)} version #{Version}"
exit 0

when '--copyright'
puts Copyright
exit 0
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 _$* *$
Expand Down Expand Up @@ -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 }
}
Expand Down
4 changes: 2 additions & 2 deletions test/test_scp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 })

Expand All @@ -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)

Expand Down
Loading