iop 0.1.0

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.
@@ -0,0 +1,39 @@
1
+ require 'test/unit'
2
+ require 'fake_ftp'
3
+ require 'iop/file'
4
+ require 'iop/net/ftp'
5
+
6
+ class NetFtpTest < Test::Unit::TestCase
7
+
8
+ include IOP
9
+
10
+ Server = FakeFtp::Server.new(10000, 10001)
11
+ Server.start
12
+
13
+ def _test_write
14
+ (FileReader.new(__FILE__) | FTPFileWriter.new('127.0.0.1', 10000)).process!
15
+ end
16
+
17
+ def _test_put
18
+ ftp = Net::FTP.new
19
+ ftp.connect('127.0.0.1', 10000)
20
+ ftp.login('user', 'password')
21
+ ftp.passive = false
22
+ ftp.put(__FILE__)
23
+ ftp.close
24
+ end
25
+
26
+ def _test_get
27
+ ftp = Net::FTP.new
28
+ ftp.connect('127.0.0.1', 10000)
29
+ ftp.login('user', 'password')
30
+ ftp.passive = true
31
+ ftp.get('out')
32
+ ftp.close
33
+ end
34
+
35
+ def test_read_file
36
+ (FTPFileReader.new('ftp.gnu.org', '/pub/README', size: 1024, offset: 1024)).process!
37
+ end
38
+
39
+ end
@@ -0,0 +1,16 @@
1
+ require 'test/unit'
2
+
3
+ require 'iop/string'
4
+ require 'iop/securerandom'
5
+
6
+
7
+ class SecureRandomTest < Test::Unit::TestCase
8
+
9
+ include IOP
10
+
11
+ def test_securerandom
12
+ (SecureRandomGenerator.new(size = 1024, block_size: 100) | (s = StringMerger.new)).process!
13
+ assert_equal size, s.to_s.size
14
+ end
15
+
16
+ end
@@ -0,0 +1,17 @@
1
+ require 'test/unit'
2
+
3
+ require 'iop/string'
4
+
5
+ class StringTest < Test::Unit::TestCase
6
+
7
+ include IOP
8
+
9
+ def test_small
10
+ t = '123456789'
11
+ (1..10).each do |i|
12
+ (StringSplitter.new(t, block_size: i) | (s = StringMerger.new)).process!
13
+ assert_equal t, s.to_s
14
+ end
15
+ end
16
+
17
+ end
metadata ADDED
@@ -0,0 +1,70 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: iop
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Oleg A. Khlybov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-04-18 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: |2
14
+ Allows to construct data and file processing pipelines in a manner of UNIX shell pipes.
15
+ Implemented features:
16
+ - String splitting/merging
17
+ - IO or local file reading/writing
18
+ - FTP file reading/writing
19
+ - Digest computing
20
+ - GZip/Zlib (de)compression
21
+ - Zstd (de)compression
22
+ - Symmetric cipher (de,en)cryption
23
+ - Random data generation
24
+ email:
25
+ - fougas@mail.ru
26
+ executables: []
27
+ extensions: []
28
+ extra_rdoc_files: []
29
+ files:
30
+ - CHANGES.md
31
+ - README.md
32
+ - lib/iop.rb
33
+ - lib/iop/digest.rb
34
+ - lib/iop/file.rb
35
+ - lib/iop/net/ftp.rb
36
+ - lib/iop/openssl.rb
37
+ - lib/iop/securerandom.rb
38
+ - lib/iop/string.rb
39
+ - lib/iop/zlib.rb
40
+ - lib/iop/zstdlib.rb
41
+ - test/digest_test.rb
42
+ - test/io_test.rb
43
+ - test/net_ftp_test.rb
44
+ - test/secureransom_test.rb
45
+ - test/string_test.rb
46
+ homepage: https://bitbucket.org/fougas/iop
47
+ licenses:
48
+ - BSD-3-Clause
49
+ metadata: {}
50
+ post_install_message:
51
+ rdoc_options: []
52
+ require_paths:
53
+ - lib
54
+ required_ruby_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: '2.3'
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ requirements: []
65
+ rubyforge_project:
66
+ rubygems_version: 2.7.9
67
+ signing_key:
68
+ specification_version: 4
69
+ summary: I/O pipeline construction framework
70
+ test_files: []