Promote net-ftp to the bundled gems
This commit is contained in:
parent
454a36794f
commit
e49c998d1e
Notes:
git
2021-05-27 14:42:38 +09:00
@ -154,10 +154,6 @@ Yukihiro Matsumoto (matz)
|
|||||||
Keiju ISHITSUKA (keiju)
|
Keiju ISHITSUKA (keiju)
|
||||||
https://github.com/ruby/mutex_m
|
https://github.com/ruby/mutex_m
|
||||||
https://rubygems.org/gems/mutex_m
|
https://rubygems.org/gems/mutex_m
|
||||||
[lib/net/ftp.rb]
|
|
||||||
Shugo Maeda (shugo)
|
|
||||||
https://github.com/ruby/net-ftp
|
|
||||||
https://rubygems.org/gems/net-ftp
|
|
||||||
[lib/net/http.rb, lib/net/https.rb]
|
[lib/net/http.rb, lib/net/https.rb]
|
||||||
NARUSE, Yui (naruse)
|
NARUSE, Yui (naruse)
|
||||||
https://github.com/ruby/net-http
|
https://github.com/ruby/net-http
|
||||||
@ -391,6 +387,8 @@ Yukihiro Matsumoto (matz)
|
|||||||
https://github.com/ruby/rexml
|
https://github.com/ruby/rexml
|
||||||
[rss]
|
[rss]
|
||||||
https://github.com/ruby/rss
|
https://github.com/ruby/rss
|
||||||
|
[net-ftp]
|
||||||
|
https://github.com/ruby/net-ftp
|
||||||
[matrix]
|
[matrix]
|
||||||
https://github.com/ruby/matrix
|
https://github.com/ruby/matrix
|
||||||
[prime]
|
[prime]
|
||||||
|
@ -46,7 +46,6 @@ IRB:: Interactive Ruby command-line tool for REPL (Read Eval Print Loop)
|
|||||||
OptionParser:: Ruby-oriented class for command-line option analysis
|
OptionParser:: Ruby-oriented class for command-line option analysis
|
||||||
Logger:: Provides a simple logging utility for outputting messages
|
Logger:: Provides a simple logging utility for outputting messages
|
||||||
Mutex_m:: Mixin to extend objects to be handled like a Mutex
|
Mutex_m:: Mixin to extend objects to be handled like a Mutex
|
||||||
Net::FTP:: Support for the File Transfer Protocol
|
|
||||||
Net::HTTP:: HTTP client api for Ruby
|
Net::HTTP:: HTTP client api for Ruby
|
||||||
Net::IMAP:: Ruby client api for Internet Message Access Protocol
|
Net::IMAP:: Ruby client api for Internet Message Access Protocol
|
||||||
Net::POP3:: Ruby client library for POP3
|
Net::POP3:: Ruby client library for POP3
|
||||||
@ -109,6 +108,7 @@ Rake:: Ruby build program with capabilities similar to make
|
|||||||
Test::Unit:: A compatibility layer for MiniTest
|
Test::Unit:: A compatibility layer for MiniTest
|
||||||
REXML:: An XML toolkit for Ruby
|
REXML:: An XML toolkit for Ruby
|
||||||
RSS:: Family of libraries that support various formats of XML "feeds"
|
RSS:: Family of libraries that support various formats of XML "feeds"
|
||||||
|
Net::FTP:: Support for the File Transfer Protocol
|
||||||
Matrix:: Represents a mathematical matrix.
|
Matrix:: Represents a mathematical matrix.
|
||||||
Prime:: Prime numbers and factorization library
|
Prime:: Prime numbers and factorization library
|
||||||
RBS:: RBS is a language to describe the structure of Ruby programs
|
RBS:: RBS is a language to describe the structure of Ruby programs
|
||||||
|
@ -5,6 +5,7 @@ rake 13.0.3 https://github.com/ruby/rake
|
|||||||
test-unit 3.4.1 https://github.com/test-unit/test-unit 3.4.1
|
test-unit 3.4.1 https://github.com/test-unit/test-unit 3.4.1
|
||||||
rexml 3.2.5 https://github.com/ruby/rexml
|
rexml 3.2.5 https://github.com/ruby/rexml
|
||||||
rss 0.2.9 https://github.com/ruby/rss 0.2.9
|
rss 0.2.9 https://github.com/ruby/rss 0.2.9
|
||||||
|
net-ftp 0.1.2 https://github.com/ruby/net-ftp
|
||||||
matrix 0.4.1 https://github.com/ruby/matrix
|
matrix 0.4.1 https://github.com/ruby/matrix
|
||||||
prime 0.1.2 https://github.com/ruby/prime
|
prime 0.1.2 https://github.com/ruby/prime
|
||||||
typeprof 0.14.1 https://github.com/ruby/typeprof
|
typeprof 0.14.1 https://github.com/ruby/typeprof
|
||||||
|
1544
lib/net/ftp.rb
1544
lib/net/ftp.rb
File diff suppressed because it is too large
Load Diff
@ -1,36 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
name = File.basename(__FILE__, ".gemspec")
|
|
||||||
version = ["lib", Array.new(name.count("-"), "..").join("/")].find do |dir|
|
|
||||||
break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line|
|
|
||||||
/^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
|
|
||||||
end rescue nil
|
|
||||||
end
|
|
||||||
|
|
||||||
Gem::Specification.new do |spec|
|
|
||||||
spec.name = name
|
|
||||||
spec.version = version
|
|
||||||
spec.authors = ["Shugo Maeda"]
|
|
||||||
spec.email = ["shugo@ruby-lang.org"]
|
|
||||||
|
|
||||||
spec.summary = %q{Support for the File Transfer Protocol.}
|
|
||||||
spec.description = %q{Support for the File Transfer Protocol.}
|
|
||||||
spec.homepage = "https://github.com/ruby/net-ftp"
|
|
||||||
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
|
||||||
spec.licenses = ["Ruby", "BSD-2-Clause"]
|
|
||||||
|
|
||||||
spec.metadata["homepage_uri"] = spec.homepage
|
|
||||||
spec.metadata["source_code_uri"] = spec.homepage
|
|
||||||
|
|
||||||
# Specify which files should be added to the gem when it is released.
|
|
||||||
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
||||||
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
|
||||||
`git ls-files -z 2>/dev/null`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
||||||
end
|
|
||||||
spec.bindir = "exe"
|
|
||||||
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
||||||
spec.require_paths = ["lib"]
|
|
||||||
|
|
||||||
spec.add_dependency "net-protocol"
|
|
||||||
spec.add_dependency "time"
|
|
||||||
end
|
|
@ -79,7 +79,6 @@ DEFAULT_GEM_LIBS = %w[
|
|||||||
irb
|
irb
|
||||||
logger
|
logger
|
||||||
mutex_m
|
mutex_m
|
||||||
net-ftp
|
|
||||||
net-http
|
net-http
|
||||||
net-imap
|
net-imap
|
||||||
net-pop
|
net-pop
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
require "net/ftp"
|
|
||||||
require "test/unit"
|
|
||||||
require "ostruct"
|
|
||||||
require "stringio"
|
|
||||||
|
|
||||||
class BufferedSocketTest < Test::Unit::TestCase
|
|
||||||
def test_gets_empty
|
|
||||||
sock = create_buffered_socket("")
|
|
||||||
assert_equal(nil, sock.gets)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_gets_one_line
|
|
||||||
sock = create_buffered_socket("foo\n")
|
|
||||||
assert_equal("foo\n", sock.gets)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_gets_one_line_without_term
|
|
||||||
sock = create_buffered_socket("foo")
|
|
||||||
assert_equal("foo", sock.gets)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_gets_two_lines
|
|
||||||
sock = create_buffered_socket("foo\nbar\n")
|
|
||||||
assert_equal("foo\n", sock.gets)
|
|
||||||
assert_equal("bar\n", sock.gets)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_gets_two_lines_without_term
|
|
||||||
sock = create_buffered_socket("foo\nbar")
|
|
||||||
assert_equal("foo\n", sock.gets)
|
|
||||||
assert_equal("bar", sock.gets)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_read_nil
|
|
||||||
sock = create_buffered_socket("foo\nbar")
|
|
||||||
assert_equal("foo\nbar", sock.read)
|
|
||||||
assert_equal("", sock.read)
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def create_buffered_socket(s)
|
|
||||||
io = StringIO.new(s)
|
|
||||||
return Net::FTP::BufferedSocket.new(io)
|
|
||||||
end
|
|
||||||
end
|
|
File diff suppressed because it is too large
Load Diff
@ -1,98 +0,0 @@
|
|||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
require "net/ftp"
|
|
||||||
require "test/unit"
|
|
||||||
require "ostruct"
|
|
||||||
require "stringio"
|
|
||||||
|
|
||||||
class MLSxEntryTest < Test::Unit::TestCase
|
|
||||||
def test_file?
|
|
||||||
assert_equal(true, Net::FTP::MLSxEntry.new({"type"=>"file"}, "foo").file?)
|
|
||||||
assert_equal(false, Net::FTP::MLSxEntry.new({"type"=>"dir"}, "foo").file?)
|
|
||||||
assert_equal(false, Net::FTP::MLSxEntry.new({"type"=>"cdir"}, "foo").file?)
|
|
||||||
assert_equal(false, Net::FTP::MLSxEntry.new({"type"=>"pdir"}, "foo").file?)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_directory?
|
|
||||||
assert_equal(false,
|
|
||||||
Net::FTP::MLSxEntry.new({"type"=>"file"}, "foo").directory?)
|
|
||||||
assert_equal(true,
|
|
||||||
Net::FTP::MLSxEntry.new({"type"=>"dir"}, "foo").directory?)
|
|
||||||
assert_equal(true,
|
|
||||||
Net::FTP::MLSxEntry.new({"type"=>"cdir"}, "foo").directory?)
|
|
||||||
assert_equal(true,
|
|
||||||
Net::FTP::MLSxEntry.new({"type"=>"pdir"}, "foo").directory?)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_appendable?
|
|
||||||
assert_equal(true,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>"a"}, "foo").appendable?)
|
|
||||||
assert_equal(false,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>""}, "foo").appendable?)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_creatable?
|
|
||||||
assert_equal(true,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>"c"}, "foo").creatable?)
|
|
||||||
assert_equal(false,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>""}, "foo").creatable?)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_deletable?
|
|
||||||
assert_equal(true,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>"d"}, "foo").deletable?)
|
|
||||||
assert_equal(false,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>""}, "foo").deletable?)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_enterable?
|
|
||||||
assert_equal(true,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>"e"}, "foo").enterable?)
|
|
||||||
assert_equal(false,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>""}, "foo").enterable?)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_renamable?
|
|
||||||
assert_equal(true,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>"f"}, "foo").renamable?)
|
|
||||||
assert_equal(false,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>""}, "foo").renamable?)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_listable?
|
|
||||||
assert_equal(true,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>"l"}, "foo").listable?)
|
|
||||||
assert_equal(false,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>""}, "foo").listable?)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_directory_makable?
|
|
||||||
assert_equal(true,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>"m"}, "foo").
|
|
||||||
directory_makable?)
|
|
||||||
assert_equal(false,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>""}, "foo").
|
|
||||||
directory_makable?)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_purgeable?
|
|
||||||
assert_equal(true,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>"p"}, "foo").purgeable?)
|
|
||||||
assert_equal(false,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>""}, "foo").purgeable?)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_readable?
|
|
||||||
assert_equal(true,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>"r"}, "foo").readable?)
|
|
||||||
assert_equal(false,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>""}, "foo").readable?)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_writable?
|
|
||||||
assert_equal(true,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>"w"}, "foo").writable?)
|
|
||||||
assert_equal(false,
|
|
||||||
Net::FTP::MLSxEntry.new({"perm"=>""}, "foo").writable?)
|
|
||||||
end
|
|
||||||
end
|
|
@ -52,7 +52,6 @@ REPOSITORIES = {
|
|||||||
English: "ruby/English",
|
English: "ruby/English",
|
||||||
"net-protocol": "ruby/net-protocol",
|
"net-protocol": "ruby/net-protocol",
|
||||||
"net-imap": "ruby/net-imap",
|
"net-imap": "ruby/net-imap",
|
||||||
"net-ftp": "ruby/net-ftp",
|
|
||||||
"net-http": "ruby/net-http",
|
"net-http": "ruby/net-http",
|
||||||
bigdecimal: "ruby/bigdecimal",
|
bigdecimal: "ruby/bigdecimal",
|
||||||
optparse: "ruby/optparse",
|
optparse: "ruby/optparse",
|
||||||
@ -267,11 +266,6 @@ def sync_default_gems(gem)
|
|||||||
cp_r("#{upstream}/lib/net/imap", "lib/net")
|
cp_r("#{upstream}/lib/net/imap", "lib/net")
|
||||||
cp_r("#{upstream}/test/net/imap", "test/net")
|
cp_r("#{upstream}/test/net/imap", "test/net")
|
||||||
cp_r("#{upstream}/net-imap.gemspec", "lib/net/imap")
|
cp_r("#{upstream}/net-imap.gemspec", "lib/net/imap")
|
||||||
when "net-ftp"
|
|
||||||
rm_rf(%w[lib/net/ftp.rb lib/net/net-ftp.gemspec test/net/ftp])
|
|
||||||
cp_r("#{upstream}/lib/net/ftp.rb", "lib/net")
|
|
||||||
cp_r("#{upstream}/test/net/ftp", "test/net")
|
|
||||||
cp_r("#{upstream}/net-ftp.gemspec", "lib/net")
|
|
||||||
when "net-http"
|
when "net-http"
|
||||||
rm_rf(%w[lib/net/http.rb lib/net/http test/net/http])
|
rm_rf(%w[lib/net/http.rb lib/net/http test/net/http])
|
||||||
cp_r("#{upstream}/lib/net/http.rb", "lib/net")
|
cp_r("#{upstream}/lib/net/http.rb", "lib/net")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user