ftpmock 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +13 -5
- data/CHANGELOG.md +98 -0
- data/Gemfile.lock +4 -7
- data/README.md +3 -1
- data/ftpmock.gemspec +2 -3
- data/lib/ftpmock.rb +20 -5
- data/lib/ftpmock/{core/configuration.rb → configuration.rb} +0 -0
- data/lib/ftpmock/proxies/net_ftp_proxy.rb +7 -1
- data/lib/ftpmock/version.rb +2 -1
- metadata +9 -22
- data/images/ftpmock.png +0 -0
- data/images/ruby.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9b6670577400d027dac927d04fc08223385984ca536a1543708682bf796b709
|
4
|
+
data.tar.gz: a2a48e846903a0d34c9479aead03182ec69dc907f12fcee540204d5329154b8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 576b16811824f5bcd2976a1010971512c93e6f2ac327a1a08544e15d96addbd6cc84313073e09610589ac8354a5cb317d429aa8d8e0e5a59d9c3b6ebd0e45803
|
7
|
+
data.tar.gz: 78310be4486a6aab833b1f97c7cfcb1d9bbecfdf5ce6c98b2669b0a9452b22498b031a88b20d1ebdf33363d635527270b2b695eefed92890f9d6be5e05888f4a
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ftpmock-gemset
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.1
|
data/.travis.yml
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
sudo: false
|
3
3
|
language: ruby
|
4
4
|
|
5
|
+
env:
|
6
|
+
global:
|
7
|
+
- CC_TEST_REPORTER_ID=e91dbff92783b09f531028ccb33b372a03b8ee2ec0b15bf8e250359c80e06838
|
8
|
+
|
5
9
|
rvm:
|
6
10
|
- 2.3
|
7
11
|
- 2.4
|
@@ -16,9 +20,13 @@ cache:
|
|
16
20
|
- bundler
|
17
21
|
- apt
|
18
22
|
|
19
|
-
|
20
|
-
|
21
|
-
|
23
|
+
before_script:
|
24
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
25
|
+
- chmod +x ./cc-test-reporter
|
26
|
+
- ./cc-test-reporter before-build
|
27
|
+
|
28
|
+
script:
|
29
|
+
- bundle exec rspec
|
22
30
|
|
23
|
-
|
24
|
-
-
|
31
|
+
after_script:
|
32
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
|
8
|
+
<!-- -->
|
9
|
+
|
10
|
+
|
11
|
+
## [Unreleased]
|
12
|
+
### Added
|
13
|
+
- .
|
14
|
+
|
15
|
+
### Changed
|
16
|
+
- .
|
17
|
+
|
18
|
+
### Deprecated
|
19
|
+
- .
|
20
|
+
|
21
|
+
### Removed
|
22
|
+
- .
|
23
|
+
|
24
|
+
### Fixed
|
25
|
+
- .
|
26
|
+
|
27
|
+
### Security
|
28
|
+
- .
|
29
|
+
|
30
|
+
|
31
|
+
<!-- -->
|
32
|
+
|
33
|
+
|
34
|
+
## [0.1.1] - 2020-08-11
|
35
|
+
### Added
|
36
|
+
- Added CHANGELOG.
|
37
|
+
|
38
|
+
### Changed
|
39
|
+
- Ruby loading - Replacing preload with autoload.
|
40
|
+
|
41
|
+
### Deprecated
|
42
|
+
- .
|
43
|
+
|
44
|
+
### Removed
|
45
|
+
- Gem build - Remove image files.
|
46
|
+
|
47
|
+
### Fixed
|
48
|
+
- NetFtpProxy - #login raises Ftpmock::CodeError if called before #connect.
|
49
|
+
- Errors - Reparenting an error class.
|
50
|
+
|
51
|
+
### Security
|
52
|
+
- Dependencies - rake 13.
|
53
|
+
|
54
|
+
|
55
|
+
<!-- -->
|
56
|
+
|
57
|
+
|
58
|
+
## [0.1.0] - 2020-02-25
|
59
|
+
### First Release
|
60
|
+
- Added README Documentation.
|
61
|
+
- Added README Instructions.
|
62
|
+
- Added TravisCI & CodeClimate.
|
63
|
+
- NetFtpProxy - added support for more initializer signatures.
|
64
|
+
- NetFtpProxy - Adding directions to implement methods.
|
65
|
+
- Cache#list/get/put - Added Verbose Alerts.
|
66
|
+
- Cache#put & NetFtpProxy#put.
|
67
|
+
- Cache#get & NetFtpProxy#get.
|
68
|
+
- Cache#list & NetFtpProxy#list.
|
69
|
+
- NetFtpProxy#chdir/pwd/getdir & Cache#chdir.
|
70
|
+
- Cache & NetFtpProxy connectivity.
|
71
|
+
- NetFtpProxy#method_missing & Configuration#verbose.
|
72
|
+
- Basic stubs for gem 'net-sftp'.
|
73
|
+
- Basic stub of Net::FTP as Ftpmock::NetFtpProxy.
|
74
|
+
- Rubocop 0.80.0 - February 18, 2020.
|
75
|
+
- First commit.
|
76
|
+
|
77
|
+
|
78
|
+
<!-- -->
|
79
|
+
|
80
|
+
|
81
|
+
## [0.0.0] - 2019-11-01
|
82
|
+
### Added
|
83
|
+
- .
|
84
|
+
|
85
|
+
### Changed
|
86
|
+
- .
|
87
|
+
|
88
|
+
### Deprecated
|
89
|
+
- .
|
90
|
+
|
91
|
+
### Removed
|
92
|
+
- .
|
93
|
+
|
94
|
+
### Fixed
|
95
|
+
- .
|
96
|
+
|
97
|
+
### Security
|
98
|
+
- .
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ftpmock (0.1.
|
4
|
+
ftpmock (0.1.1)
|
5
5
|
diffy (~> 3.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
10
|
ast (2.4.0)
|
11
|
-
codeclimate-test-reporter (1.0.9)
|
12
|
-
simplecov (<= 0.13)
|
13
11
|
diff-lcs (1.3)
|
14
12
|
diffy (3.3.0)
|
15
13
|
docile (1.1.5)
|
@@ -22,7 +20,7 @@ GEM
|
|
22
20
|
parser (2.7.0.2)
|
23
21
|
ast (~> 2.4.0)
|
24
22
|
rainbow (3.0.0)
|
25
|
-
rake (
|
23
|
+
rake (13.0.1)
|
26
24
|
rexml (3.2.4)
|
27
25
|
rspec (3.9.0)
|
28
26
|
rspec-core (~> 3.9.0)
|
@@ -58,13 +56,12 @@ PLATFORMS
|
|
58
56
|
|
59
57
|
DEPENDENCIES
|
60
58
|
bundler (~> 2.0)
|
61
|
-
codeclimate-test-reporter
|
62
59
|
ftpmock!
|
63
60
|
net-sftp
|
64
|
-
rake (~>
|
61
|
+
rake (~> 13.0)
|
65
62
|
rspec (~> 3.0)
|
66
63
|
rubocop (= 0.80.0)
|
67
64
|
simplecov
|
68
65
|
|
69
66
|
BUNDLED WITH
|
70
|
-
2.
|
67
|
+
2.1.4
|
data/README.md
CHANGED
@@ -100,7 +100,7 @@ To install this gem onto your local machine, run `bundle exec rake install`.
|
|
100
100
|
|
101
101
|
## Documentation
|
102
102
|
|
103
|
-
![Chart](./images/
|
103
|
+
![Chart](./images/ftpmock1.png)
|
104
104
|
|
105
105
|
- Core
|
106
106
|
- [x] Stubber
|
@@ -158,6 +158,8 @@ links: [lib/ftpmock/proxies/net_sftp_proxy.rb](./lib/ftpmock/proxies/net_sftp_pr
|
|
158
158
|
|
159
159
|
Bug reports and pull requests are welcome on GitHub at https://github.com/thejamespinto/ftpmock.
|
160
160
|
|
161
|
+
Changelog can be found at [CHANGELOG.md](./CHANGELOG.md)
|
162
|
+
|
161
163
|
## License
|
162
164
|
|
163
165
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/ftpmock.gemspec
CHANGED
@@ -24,16 +24,15 @@ Gem::Specification.new do |spec|
|
|
24
24
|
# that have been added into git.
|
25
25
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
26
26
|
`git ls-files -z`.split("\x0")
|
27
|
-
.reject { |f| f.match(%r{^(test|spec|features)/}) }
|
27
|
+
.reject { |f| f.match(%r{^(images|test|spec|features)/}) }
|
28
28
|
end
|
29
29
|
spec.bindir = 'exe'
|
30
30
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
31
|
spec.require_paths = ['lib']
|
32
32
|
|
33
33
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
34
|
-
spec.add_development_dependency 'codeclimate-test-reporter'
|
35
34
|
spec.add_development_dependency 'net-sftp'
|
36
|
-
spec.add_development_dependency 'rake', '~>
|
35
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
37
36
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
38
37
|
spec.add_development_dependency 'simplecov'
|
39
38
|
|
data/lib/ftpmock.rb
CHANGED
@@ -1,16 +1,31 @@
|
|
1
1
|
require 'pathname'
|
2
|
-
require 'ftpmock/version'
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
end
|
3
|
+
require 'ftpmock/configuration'
|
4
|
+
require 'ftpmock/version'
|
7
5
|
|
8
6
|
module Ftpmock
|
9
7
|
class Error < StandardError; end
|
10
|
-
class
|
8
|
+
class CodeError < Error; end
|
9
|
+
class GetNotFetched < Error; end
|
11
10
|
class PutFileNotFound < Error; end
|
12
11
|
class PutLocalDiffersFromCache < Error; end
|
13
12
|
|
13
|
+
autoload :Cache, 'ftpmock/core/cache'
|
14
|
+
# autoload :Configuration, 'ftpmock/core/configuration'
|
15
|
+
|
16
|
+
autoload :GetHelper, 'ftpmock/helpers/get_helper'
|
17
|
+
autoload :ListHelper, 'ftpmock/helpers/list_helper'
|
18
|
+
autoload :PathHelper, 'ftpmock/helpers/path_helper'
|
19
|
+
autoload :PutHelper, 'ftpmock/helpers/put_helper'
|
20
|
+
|
21
|
+
autoload :NetFtpProxy, 'ftpmock/proxies/net_ftp_proxy'
|
22
|
+
autoload :NetSftpProxy, 'ftpmock/proxies/net_sftp_proxy'
|
23
|
+
autoload :MethodMissingMixin, 'ftpmock/proxies/method_missing_mixin'
|
24
|
+
|
25
|
+
autoload :ColorUtils, 'ftpmock/utils/color_utils'
|
26
|
+
autoload :StringUtils, 'ftpmock/utils/string_utils'
|
27
|
+
autoload :VerboseUtils, 'ftpmock/utils/verbose_utils'
|
28
|
+
|
14
29
|
def self.on!(&block)
|
15
30
|
NetFtpProxy.on! do
|
16
31
|
NetSftpProxy.on!(&block)
|
File without changes
|
@@ -92,7 +92,8 @@ module Ftpmock
|
|
92
92
|
true
|
93
93
|
end
|
94
94
|
|
95
|
-
def login(username, password)
|
95
|
+
def login(username = '', password = '')
|
96
|
+
@cache_connected || _raise_code_error_connect_before_login
|
96
97
|
@cache = nil
|
97
98
|
@real_logged = false
|
98
99
|
@username = username
|
@@ -104,6 +105,11 @@ module Ftpmock
|
|
104
105
|
true
|
105
106
|
end
|
106
107
|
|
108
|
+
def _raise_code_error_connect_before_login
|
109
|
+
raise CodeError,
|
110
|
+
'please call ftp.connect(args) before calling ftp.login(args)'
|
111
|
+
end
|
112
|
+
|
107
113
|
def _real_connect_and_login
|
108
114
|
@cache_connected || _raise_not_connected
|
109
115
|
@cache_logged || _raise_not_connected
|
data/lib/ftpmock/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ftpmock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Pinto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: codeclimate-test-reporter
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: net-sftp
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +44,14 @@ dependencies:
|
|
58
44
|
requirements:
|
59
45
|
- - "~>"
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
47
|
+
version: '13.0'
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
54
|
+
version: '13.0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: rspec
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -119,7 +105,10 @@ files:
|
|
119
105
|
- ".rspec"
|
120
106
|
- ".rubocop.yml"
|
121
107
|
- ".rubocop_todo.yml"
|
108
|
+
- ".ruby-gemset"
|
109
|
+
- ".ruby-version"
|
122
110
|
- ".travis.yml"
|
111
|
+
- CHANGELOG.md
|
123
112
|
- Gemfile
|
124
113
|
- Gemfile.lock
|
125
114
|
- LICENSE.txt
|
@@ -128,11 +117,9 @@ files:
|
|
128
117
|
- bin/console
|
129
118
|
- bin/setup
|
130
119
|
- ftpmock.gemspec
|
131
|
-
- images/ftpmock.png
|
132
|
-
- images/ruby.png
|
133
120
|
- lib/ftpmock.rb
|
121
|
+
- lib/ftpmock/configuration.rb
|
134
122
|
- lib/ftpmock/core/cache.rb
|
135
|
-
- lib/ftpmock/core/configuration.rb
|
136
123
|
- lib/ftpmock/helpers/get_helper.rb
|
137
124
|
- lib/ftpmock/helpers/list_helper.rb
|
138
125
|
- lib/ftpmock/helpers/path_helper.rb
|
@@ -164,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
151
|
- !ruby/object:Gem::Version
|
165
152
|
version: '0'
|
166
153
|
requirements: []
|
167
|
-
rubygems_version: 3.
|
154
|
+
rubygems_version: 3.1.2
|
168
155
|
signing_key:
|
169
156
|
specification_version: 4
|
170
157
|
summary: Test your FTP calls offline.
|
data/images/ftpmock.png
DELETED
Binary file
|
data/images/ruby.png
DELETED
Binary file
|