net-ftp 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 144a4e8100ca6ae408868765924fa87dafc243da7672297d9f8830b28c676fde
4
- data.tar.gz: 2247f4f98c0322f4e4f163863f0a2f4439a652d1c50a3f2ec6cfd4479b9205a1
3
+ metadata.gz: ba4ad76088a26b22d04b1c904c98d47d064d69c9ec06cb1c29d5f81d604963b7
4
+ data.tar.gz: 2416f84cfc9b309026a027af2f44629119fa19a1cd2fb45a306d8aeae1653115
5
5
  SHA512:
6
- metadata.gz: 39025652132d9af7af55c0f67bb9d28b1e9645c0949dc5886e490d579e67fd51ce72b74c3d41a7255e328c706fd32cb94a415a7ef09b1e82f4f41f20050e0f9c
7
- data.tar.gz: e5c3e151dca8fb1a06208e8f0f945d81b48a8ee18ce93dd69206988268c7a38ffc97786b6404485265f4445088364d42def0dac88370ee4853a86fe4a8f32468
6
+ metadata.gz: 59a15adc74781c2720af162360e9f05768b91d0a5b1937faf6ee2d04679feabdb1b9e892ea6c56f48fc06c2487506461935ee67163335b2700dd53c3c7f591c3
7
+ data.tar.gz: 8b08d23da6ad3126d18c2efd7711d2b95a7df621399e73548596e27cd5e159ea3e195181ba83e3cedebd4dff4b43853ad74ed88fe644ea648dc44713cb6026a5
@@ -0,0 +1,22 @@
1
+ Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions
5
+ are met:
6
+ 1. Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
8
+ 2. Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22
+ SUCH DAMAGE.
@@ -85,6 +85,7 @@ module Net
85
85
  end
86
86
 
87
87
  # :stopdoc:
88
+ VERSION = "0.1.1"
88
89
  FTP_PORT = 21
89
90
  CRLF = "\r\n"
90
91
  DEFAULT_BLOCKSIZE = BufferedIO::BUFSIZE
@@ -182,16 +183,16 @@ module Net
182
183
  # The available options are:
183
184
  #
184
185
  # port:: Port number (default value is 21)
185
- # ssl:: If options[:ssl] is true, then an attempt will be made
186
+ # ssl:: If +options+[:ssl] is true, then an attempt will be made
186
187
  # to use SSL (now TLS) to connect to the server. For this
187
188
  # to work OpenSSL [OSSL] and the Ruby OpenSSL [RSSL]
188
- # extensions need to be installed. If options[:ssl] is a
189
+ # extensions need to be installed. If +options+[:ssl] is a
189
190
  # hash, it's passed to OpenSSL::SSL::SSLContext#set_params
190
191
  # as parameters.
191
192
  # private_data_connection:: If true, TLS is used for data connections.
192
- # Default: +true+ when options[:ssl] is true.
193
- # username:: Username for login. If options[:username] is the string
194
- # "anonymous" and the options[:password] is +nil+,
193
+ # Default: +true+ when +options+[:ssl] is true.
194
+ # username:: Username for login. If +options+[:username] is the string
195
+ # "anonymous" and the +options+[:password] is +nil+,
195
196
  # "anonymous@" is used as a password.
196
197
  # password:: Password for login.
197
198
  # account:: Account information for ACCT.
@@ -634,9 +635,9 @@ module Net
634
635
  while data = conn.read(blocksize)
635
636
  yield(data)
636
637
  end
637
- conn.shutdown(Socket::SHUT_WR)
638
+ conn.shutdown(Socket::SHUT_WR) rescue nil
638
639
  conn.read_timeout = 1
639
- conn.read
640
+ conn.read rescue nil
640
641
  ensure
641
642
  conn.close if conn
642
643
  end
@@ -659,9 +660,9 @@ module Net
659
660
  while line = conn.gets
660
661
  yield(line.sub(/\r?\n\z/, ""), !line.match(/\n\z/).nil?)
661
662
  end
662
- conn.shutdown(Socket::SHUT_WR)
663
+ conn.shutdown(Socket::SHUT_WR) rescue nil
663
664
  conn.read_timeout = 1
664
- conn.read
665
+ conn.read rescue nil
665
666
  ensure
666
667
  conn.close if conn
667
668
  end
@@ -688,9 +689,9 @@ module Net
688
689
  conn.write(buf)
689
690
  yield(buf) if block_given?
690
691
  end
691
- conn.shutdown(Socket::SHUT_WR)
692
+ conn.shutdown(Socket::SHUT_WR) rescue nil
692
693
  conn.read_timeout = 1
693
- conn.read
694
+ conn.read rescue nil
694
695
  ensure
695
696
  conn.close if conn
696
697
  end
@@ -724,9 +725,9 @@ module Net
724
725
  conn.write(buf)
725
726
  yield(buf) if block_given?
726
727
  end
727
- conn.shutdown(Socket::SHUT_WR)
728
+ conn.shutdown(Socket::SHUT_WR) rescue nil
728
729
  conn.read_timeout = 1
729
- conn.read
730
+ conn.read rescue nil
730
731
  ensure
731
732
  conn.close if conn
732
733
  end
@@ -1048,7 +1049,7 @@ module Net
1048
1049
  raise FTPProtoError, "invalid time-val: #{value}"
1049
1050
  end
1050
1051
  usec = fractions.to_i * 10 ** (6 - fractions.to_s.size)
1051
- Time.send(local ? :local : :utc, year, month, day, hour, min, sec, usec)
1052
+ Time.public_send(local ? :local : :utc, year, month, day, hour, min, sec, usec)
1052
1053
  }
1053
1054
  FACT_PARSERS = Hash.new(CASE_DEPENDENT_PARSER)
1054
1055
  FACT_PARSERS["size"] = DECIMAL_PARSER
@@ -1,12 +1,15 @@
1
- begin
2
- require_relative 'lib/net/ftp/version'
3
- rescue LoadError # Fallback to load version file in ruby core repository
4
- require_relative "version"
1
+ # frozen_string_literal: true
2
+
3
+ name = File.basename(__FILE__, ".gemspec")
4
+ version = ["lib", Array.new(name.count("-"), "..").join("/")].find do |dir|
5
+ break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line|
6
+ /^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
7
+ end rescue nil
5
8
  end
6
9
 
7
10
  Gem::Specification.new do |spec|
8
- spec.name = "net-ftp"
9
- spec.version = Net::Ftp::VERSION
11
+ spec.name = name
12
+ spec.version = version
10
13
  spec.authors = ["Shugo Maeda"]
11
14
  spec.email = ["shugo@ruby-lang.org"]
12
15
 
@@ -14,6 +17,7 @@ Gem::Specification.new do |spec|
14
17
  spec.description = %q{Support for the File Transfer Protocol.}
15
18
  spec.homepage = "https://github.com/ruby/net-ftp"
16
19
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
20
+ spec.licenses = ["Ruby", "BSD-2-Clause"]
17
21
 
18
22
  spec.metadata["homepage_uri"] = spec.homepage
19
23
  spec.metadata["source_code_uri"] = spec.homepage
@@ -21,9 +25,12 @@ Gem::Specification.new do |spec|
21
25
  # Specify which files should be added to the gem when it is released.
22
26
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
27
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
24
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
28
+ `git ls-files -z 2>/dev/null`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
29
  end
26
30
  spec.bindir = "exe"
27
31
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
32
  spec.require_paths = ["lib"]
33
+
34
+ spec.add_dependency "net-protocol"
35
+ spec.add_dependency "time"
29
36
  end
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-ftp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shugo Maeda
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-01 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2020-12-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: net-protocol
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
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: time
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
13
41
  description: Support for the File Transfer Protocol.
14
42
  email:
15
43
  - shugo@ruby-lang.org
@@ -21,19 +49,21 @@ files:
21
49
  - ".gitignore"
22
50
  - Gemfile
23
51
  - Gemfile.lock
52
+ - LICENSE.txt
24
53
  - README.md
25
54
  - Rakefile
26
55
  - bin/console
27
56
  - bin/setup
28
57
  - lib/net/ftp.rb
29
- - lib/net/ftp/version.rb
30
58
  - net-ftp.gemspec
31
59
  homepage: https://github.com/ruby/net-ftp
32
- licenses: []
60
+ licenses:
61
+ - Ruby
62
+ - BSD-2-Clause
33
63
  metadata:
34
64
  homepage_uri: https://github.com/ruby/net-ftp
35
65
  source_code_uri: https://github.com/ruby/net-ftp
36
- post_install_message:
66
+ post_install_message:
37
67
  rdoc_options: []
38
68
  require_paths:
39
69
  - lib
@@ -48,8 +78,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
48
78
  - !ruby/object:Gem::Version
49
79
  version: '0'
50
80
  requirements: []
51
- rubygems_version: 3.2.0.pre1
52
- signing_key:
81
+ rubygems_version: 3.2.2
82
+ signing_key:
53
83
  specification_version: 4
54
84
  summary: Support for the File Transfer Protocol.
55
85
  test_files: []
@@ -1,5 +0,0 @@
1
- module Net
2
- module Ftp
3
- VERSION = "0.1.0"
4
- end
5
- end