win32-nio 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d829b0d7823000b4e8c3ce911a129328e0d72db8
4
- data.tar.gz: 3a23c84c020ac5a28f76623a4768c4882723ce7c
3
+ metadata.gz: 77c6864cd5b2e73814911152bfa2e49e4ff8c88c
4
+ data.tar.gz: f7f9caebe80964c90536d5bb16a94f5120637af4
5
5
  SHA512:
6
- metadata.gz: 564ff3198da3309c3ed9a6d2ec2136a499e093f71728643b2f397f8805abeb18ddbe60ea6e4a51f1dbc5600d82310a4b8606b3a52cd29c1e6d644817df82203d
7
- data.tar.gz: 9c4dedc035094a63824032d57675d90fea431bdb740fccaa7297e3bbb9a08105efdeab023ca91513c319b95bccf636f665d480578dfa20489a2cc6dfd5e0df6a
6
+ metadata.gz: 044a653819623b0f04ffea465486191d7d4c91fdf5924b9ea90ce032d2433184e75a43ed72c70a286b05feb894adba08b94db8c00d5af8e9b476ccc926170113
7
+ data.tar.gz: 5b5e8ad7859a13d2dd344e05188b6ea522fdcdd2bd0627bc6b68165cefb5d57f30c532f02cf24e44e37bac022db316c2ce29503579dc92666a4608e1fad95b86
@@ -0,0 +1,3 @@
1
+ O�'9wzmR�5YRnh ��h�)sC��԰9�+�.��6�e�'|Y&�oQ/�0n�*��^�M���" _mn77=u��e�!�I��yY��� �@%�}�+�4��S
2
+ ܐF"p���b'�u�Iܴ��`�a�B����8h�S����Mygn��|�\�:�I$Q�`2T ,��jG)-Z�� �� �D�|�KGAT]*�粞�B�o_�
3
+ �k�׀'e����[^��z>C�V\M�NW���
@@ -0,0 +1,2 @@
1
+ .��Ʋqm����+^��O���A��.�T7n#�¤%+��Vk�>`�S`�W��!��F�mk ;�� z��Nr�1� U��ʣN���`��sd3���
2
+ �J4ٶ�.�D u֝�{6D�f�2���itt �CX_��l�/-L�ehm;b��U<����:�T41�'���-��l�?]?g���O`�
data/CHANGES CHANGED
@@ -1,41 +1,46 @@
1
- == 0.2.1 - 21-Jun-2015
2
- * Fixed some build warnings on mingw32.
3
-
4
- == 0.2.0 - 30-Mar-2015
5
- * Converted to C code for performance.
6
- * The NIO.readlines method now accepts an optional event object as
7
- an argument.
8
- * A negative offset value will now raise an ArgumentError.
9
- * Some documentation updates.
10
-
11
- == 0.1.3 - 21-Oct-2013
12
- * Fixed INVALID_HANDLE_VALUE for 64-bit versions of Ruby.
13
- * Added Rake as a development dependency.
14
-
15
- == 0.1.2 - 20-Oct-2013
16
- * Fixed the underlying data types for the OVERLAPPED FFI struct. This
17
- affected 64-bit versions of Ruby.
18
- * Updated gem:create task for Rubygems 2.x.
19
- * Removed unnecessary require in test suite.
20
-
21
- == 0.1.1 - 10-Apr-2013
22
- * Updated the HANDLE type in the underlying FFI code. This affects
23
- 64 bit versions of Ruby.
24
-
25
- == 0.1.0 - 12-Jul-2012
26
- * Changed from win32-api to FFI.
27
- * Now requires Ruby 1.9 or later.
28
-
29
- == 0.0.3 - 24-Apr-2010
30
- * Removed inline gem building from the gemspec. That's now handled by a
31
- Rakefile task.
32
- * Rafactored the Rakefile, removed an old install task and added new
33
- gem tasks.
34
-
35
- == 0.0.2 - 6-Aug-2009
36
- * License changed to Artistic 2.0.
37
- * Some gemspec updates, including adding win32-event as a dependency and
38
- test-unit as a development dependency.
39
-
40
- == 0.0.1 - 28-Nov-2008
41
- * Initial release
1
+ == 0.2.2 - 18-Nov-2015
2
+ * This gem is now signed.
3
+ * Added an appveyor.yml file for the MS continuous integration service.
4
+ * Some Rakefile updates.
5
+
6
+ == 0.2.1 - 21-Jun-2015
7
+ * Fixed some build warnings on mingw32.
8
+
9
+ == 0.2.0 - 30-Mar-2015
10
+ * Converted to C code for performance.
11
+ * The NIO.readlines method now accepts an optional event object as
12
+ an argument.
13
+ * A negative offset value will now raise an ArgumentError.
14
+ * Some documentation updates.
15
+
16
+ == 0.1.3 - 21-Oct-2013
17
+ * Fixed INVALID_HANDLE_VALUE for 64-bit versions of Ruby.
18
+ * Added Rake as a development dependency.
19
+
20
+ == 0.1.2 - 20-Oct-2013
21
+ * Fixed the underlying data types for the OVERLAPPED FFI struct. This
22
+ affected 64-bit versions of Ruby.
23
+ * Updated gem:create task for Rubygems 2.x.
24
+ * Removed unnecessary require in test suite.
25
+
26
+ == 0.1.1 - 10-Apr-2013
27
+ * Updated the HANDLE type in the underlying FFI code. This affects
28
+ 64 bit versions of Ruby.
29
+
30
+ == 0.1.0 - 12-Jul-2012
31
+ * Changed from win32-api to FFI.
32
+ * Now requires Ruby 1.9 or later.
33
+
34
+ == 0.0.3 - 24-Apr-2010
35
+ * Removed inline gem building from the gemspec. That's now handled by a
36
+ Rakefile task.
37
+ * Rafactored the Rakefile, removed an old install task and added new
38
+ gem tasks.
39
+
40
+ == 0.0.2 - 6-Aug-2009
41
+ * License changed to Artistic 2.0.
42
+ * Some gemspec updates, including adding win32-event as a dependency and
43
+ test-unit as a development dependency.
44
+
45
+ == 0.0.1 - 28-Nov-2008
46
+ * Initial release
data/MANIFEST CHANGED
@@ -1,10 +1,12 @@
1
- * CHANGES
2
- * MANIFEST
3
- * Rakefile
4
- * README
5
- * win32-nio.gemspec
6
- * benchmarks/win32_nio_benchmarks.rb
7
- * ext/extconf.rb
8
- * ext/win32/nio.c
9
- * test/test_win32_nio_read.rb
10
- * test/test_win32_nio_readlines.rb
1
+ * appveyor.yml
2
+ * CHANGES
3
+ * MANIFEST
4
+ * Rakefile
5
+ * README
6
+ * win32-nio.gemspec
7
+ * benchmarks/win32_nio_benchmarks.rb
8
+ * certs/djberg96_pub.pem
9
+ * ext/extconf.rb
10
+ * ext/win32/nio.c
11
+ * test/test_win32_nio_read.rb
12
+ * test/test_win32_nio_readlines.rb
data/README CHANGED
@@ -1,86 +1,86 @@
1
- = Description
2
- Native IO for Windows. This class matches and extends the current Ruby
3
- IO class API, using native Windows functions underneath the hood.
4
-
5
- = Installation
6
- gem install win32-nio
7
-
8
- = Synopsis
9
- require 'win32/nio'
10
- include Win32
11
-
12
- # Similar to Ruby
13
- p NIO.read('some_file.text')
14
- p NIO.read('some_file.text', 50)
15
- p NIO.read('some_file.text', 50, 5)
16
-
17
- p NIO.readlines('some_file.txt')
18
- p NIO.readlines('some_file.txt', '')
19
-
20
- # With events
21
- event = Win32::Event.new
22
-
23
- NIO.read('some_big_file.txt', nil, nil, event)
24
- p event.signaled? # => true
25
-
26
- # With blocks
27
- NIO.read('some_big_file.txt'){ puts "Finished" }
28
-
29
- = Proof of Concept
30
- This code was originally written to see if using pure Windows functions
31
- to implement MRI methods would offer any practical advantage. The answer
32
- is a definite maybe.
33
-
34
- Functionally, this library does offer something the MRI methods do not,
35
- which is the ability to provide a block or event object that is called
36
- when a read is finished.
37
-
38
- In terms of speed, I've found the NIO.read method to be almost twice as
39
- fast as Ruby 2.2, while the NIO.readlines method was about the same speed.
40
- In most cases the NIO.readlines method offers no practical advantage, but
41
- see the documentation for details.
42
-
43
- = Benchmarks
44
-
45
- Using my current laptop running Windows 7 I saw these results, which were
46
- typical in repeated runs:
47
-
48
- IO.read(small) 0.000000 0.016000 0.016000 ( 0.020342)
49
- NIO.read(small) 0.000000 0.000000 0.000000 ( 0.008140)
50
- IO.read(medium) 0.187000 0.047000 0.234000 ( 0.230579)
51
- NIO.read(medium) 0.015000 0.093000 0.108000 ( 0.122542)
52
- IO.read(large) 1.654000 0.593000 2.247000 ( 2.355478)
53
- NIO.read(large) 0.343000 0.765000 1.108000 ( 1.222567)
54
-
55
- IO.readlines(small) 0.125000 0.000000 0.125000 ( 0.119982)
56
- NIO.readlines(small) 0.094000 0.015000 0.109000 ( 0.132461)
57
- IO.readlines(medium) 1.419000 0.234000 1.653000 ( 1.764216)
58
- NIO.readlines(medium) 1.092000 0.109000 1.201000 ( 1.537593)
59
- IO.readlines(large) 12.714000 0.874000 13.588000 ( 13.798494)
60
- NIO.readlines(large) 9.719000 0.468000 10.187000 ( 13.437217)
61
-
62
- Your results may vary.
63
-
64
- = JRuby
65
- As of version 0.2.0 this code was written as a C extension, and
66
- does not support JRuby. However, JRuby users can continue to use
67
- the 0.1.x branch.
68
-
69
- = Known Bugs
70
- None that I know of. Please log any other bug reports on the RubyForge
71
- project page at https://github.com/djberg96/win32-nio.
72
-
73
- = License
74
- Artistic 2.0
75
-
76
- = Copyright
77
- (C) 2008-2015 Daniel J. Berger, All Rights Reserved
78
-
79
- = Warranty
80
- This package is provided "as is" and without any express or
81
- implied warranties, including, without limitation, the implied
82
- warranties of merchantability and fitness for a particular purpose.
83
-
84
- = Author(s)
85
- Daniel Berger
86
- Park Heesob
1
+ = Description
2
+ Native IO for Windows. This class matches and extends the current Ruby
3
+ IO class API, using native Windows functions underneath the hood.
4
+
5
+ = Installation
6
+ gem install win32-nio
7
+
8
+ = Synopsis
9
+ require 'win32/nio'
10
+ include Win32
11
+
12
+ # Similar to Ruby
13
+ p NIO.read('some_file.text')
14
+ p NIO.read('some_file.text', 50)
15
+ p NIO.read('some_file.text', 50, 5)
16
+
17
+ p NIO.readlines('some_file.txt')
18
+ p NIO.readlines('some_file.txt', '')
19
+
20
+ # With events
21
+ event = Win32::Event.new
22
+
23
+ NIO.read('some_big_file.txt', nil, nil, event)
24
+ p event.signaled? # => true
25
+
26
+ # With blocks
27
+ NIO.read('some_big_file.txt'){ puts "Finished" }
28
+
29
+ = Proof of Concept
30
+ This code was originally written to see if using pure Windows functions
31
+ to implement MRI methods would offer any practical advantage. The answer
32
+ is a definite maybe.
33
+
34
+ Functionally, this library does offer something the MRI methods do not,
35
+ which is the ability to provide a block or event object that is called
36
+ when a read is finished.
37
+
38
+ In terms of speed, I've found the NIO.read method to be almost twice as
39
+ fast as Ruby 2.2, while the NIO.readlines method was about the same speed.
40
+ In most cases the NIO.readlines method offers no practical advantage, but
41
+ see the documentation for details.
42
+
43
+ = Benchmarks
44
+
45
+ Using my current laptop running Windows 7 I saw these results, which were
46
+ typical in repeated runs:
47
+
48
+ IO.read(small) 0.000000 0.016000 0.016000 ( 0.020342)
49
+ NIO.read(small) 0.000000 0.000000 0.000000 ( 0.008140)
50
+ IO.read(medium) 0.187000 0.047000 0.234000 ( 0.230579)
51
+ NIO.read(medium) 0.015000 0.093000 0.108000 ( 0.122542)
52
+ IO.read(large) 1.654000 0.593000 2.247000 ( 2.355478)
53
+ NIO.read(large) 0.343000 0.765000 1.108000 ( 1.222567)
54
+
55
+ IO.readlines(small) 0.125000 0.000000 0.125000 ( 0.119982)
56
+ NIO.readlines(small) 0.094000 0.015000 0.109000 ( 0.132461)
57
+ IO.readlines(medium) 1.419000 0.234000 1.653000 ( 1.764216)
58
+ NIO.readlines(medium) 1.092000 0.109000 1.201000 ( 1.537593)
59
+ IO.readlines(large) 12.714000 0.874000 13.588000 ( 13.798494)
60
+ NIO.readlines(large) 9.719000 0.468000 10.187000 ( 13.437217)
61
+
62
+ Your results may vary.
63
+
64
+ = JRuby
65
+ As of version 0.2.0 this code was written as a C extension, and
66
+ does not support JRuby. However, JRuby users can continue to use
67
+ the 0.1.x branch.
68
+
69
+ = Known Bugs
70
+ None that I know of. Please log any other bug reports on the RubyForge
71
+ project page at https://github.com/djberg96/win32-nio.
72
+
73
+ = License
74
+ Artistic 2.0
75
+
76
+ = Copyright
77
+ (C) 2008-2015 Daniel J. Berger, All Rights Reserved
78
+
79
+ = Warranty
80
+ This package is provided "as is" and without any express or
81
+ implied warranties, including, without limitation, the implied
82
+ warranties of merchantability and fitness for a particular purpose.
83
+
84
+ = Author(s)
85
+ Daniel Berger
86
+ Park Heesob
data/Rakefile CHANGED
@@ -1,83 +1,84 @@
1
- require 'rake'
2
- require 'rake/clean'
3
- require 'rake/testtask'
4
- include RbConfig
5
-
6
- CLEAN.include(
7
- '**/*.gem', # Gem files
8
- '**/*.txt', # Benchmark files
9
- '**/*.rbc', # Rubinius
10
- '**/*.o', # C object file
11
- '**/*.log', # Ruby extension build log
12
- '**/Makefile', # C Makefile
13
- '**/*.def', # Definition files
14
- '**/*.exp',
15
- '**/*.lib',
16
- '**/*.pdb',
17
- '**/*.obj',
18
- '**/*.stackdump', # Junk that can happen on Windows
19
- "**/*.#{CONFIG['DLEXT']}" # C shared object
20
- )
21
-
22
- desc "Build the win32-nio library"
23
- task :build => [:clean] do
24
- if RbConfig::CONFIG['host_os'] =~ /mingw|cygwn/i
25
- require 'devkit'
26
- make_cmd = "make"
27
- else
28
- make_cmd = "nmake"
29
- end
30
- Dir.chdir('ext') do
31
- ruby "extconf.rb"
32
- sh make_cmd
33
- cp 'nio.so', 'win32' # For testing
34
- end
35
- end
36
-
37
- namespace 'gem' do
38
- desc 'Create the win32-nio gem'
39
- task :create => [:clean] do
40
- require 'rubygems/package'
41
- spec = eval(IO.read('win32-nio.gemspec'))
42
- Gem::Package.build(spec)
43
- end
44
-
45
- desc 'Install the win32-nio gem'
46
- task :install => [:create] do
47
- file = Dir['*.gem'].first
48
- sh "gem install #{file}"
49
- end
50
- end
51
-
52
- desc 'Run the benchmark suite'
53
- task :bench => [:build] do
54
- sh "ruby -Iext benchmarks/win32_nio_benchmarks.rb"
55
- end
56
-
57
- namespace :test do
58
- Rake::TestTask.new(:read) do |t|
59
- task :read => [:build]
60
- t.libs << 'ext'
61
- t.verbose = true
62
- t.warning = true
63
- t.test_files = FileList['test/test_win32_nio_read.rb']
64
- end
65
-
66
- Rake::TestTask.new(:readlines) do |t|
67
- task :readlines => [:build]
68
- t.libs << 'ext'
69
- t.verbose = true
70
- t.warning = true
71
- t.test_files = FileList['test/test_win32_nio_readlines.rb']
72
- end
73
-
74
- Rake::TestTask.new(:all) do |t|
75
- task :all => [:build]
76
- t.libs << 'ext'
77
- t.verbose = true
78
- t.warning = true
79
- t.test_files = FileList['test/test*.rb']
80
- end
81
- end
82
-
83
- task :default => 'test:all'
1
+ require 'rake'
2
+ require 'rake/clean'
3
+ require 'rake/testtask'
4
+ include RbConfig
5
+
6
+ CLEAN.include(
7
+ '**/*.gem', # Gem files
8
+ '**/*.txt', # Benchmark files
9
+ '**/*.rbc', # Rubinius
10
+ '**/*.o', # C object file
11
+ '**/*.log', # Ruby extension build log
12
+ '**/Makefile', # C Makefile
13
+ '**/*.def', # Definition files
14
+ '**/*.exp',
15
+ '**/*.lib',
16
+ '**/*.pdb',
17
+ '**/*.obj',
18
+ '**/*.stackdump', # Junk that can happen on Windows
19
+ "**/*.#{CONFIG['DLEXT']}" # C shared object
20
+ )
21
+
22
+ desc "Build the win32-nio library"
23
+ task :build => [:clean] do
24
+ if RbConfig::CONFIG['host_os'] =~ /mingw|cygwn/i
25
+ require 'devkit'
26
+ make_cmd = "make"
27
+ else
28
+ make_cmd = "nmake"
29
+ end
30
+ Dir.chdir('ext') do
31
+ ruby "extconf.rb"
32
+ sh make_cmd
33
+ cp 'nio.so', 'win32' # For testing
34
+ end
35
+ end
36
+
37
+ namespace 'gem' do
38
+ desc 'Create the win32-nio gem'
39
+ task :create => [:clean] do
40
+ require 'rubygems/package'
41
+ spec = eval(IO.read('win32-nio.gemspec'))
42
+ spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
43
+ Gem::Package.build(spec, true)
44
+ end
45
+
46
+ desc 'Install the win32-nio gem'
47
+ task :install => [:create] do
48
+ file = Dir['*.gem'].first
49
+ sh "gem install -l #{file}"
50
+ end
51
+ end
52
+
53
+ desc 'Run the benchmark suite'
54
+ task :bench => [:build] do
55
+ sh "ruby -Iext benchmarks/win32_nio_benchmarks.rb"
56
+ end
57
+
58
+ namespace :test do
59
+ Rake::TestTask.new(:read) do |t|
60
+ task :read => [:build]
61
+ t.libs << 'ext'
62
+ t.verbose = true
63
+ t.warning = true
64
+ t.test_files = FileList['test/test_win32_nio_read.rb']
65
+ end
66
+
67
+ Rake::TestTask.new(:readlines) do |t|
68
+ task :readlines => [:build]
69
+ t.libs << 'ext'
70
+ t.verbose = true
71
+ t.warning = true
72
+ t.test_files = FileList['test/test_win32_nio_readlines.rb']
73
+ end
74
+
75
+ Rake::TestTask.new(:all) do |t|
76
+ task :all => [:build]
77
+ t.libs << 'ext'
78
+ t.verbose = true
79
+ t.warning = true
80
+ t.test_files = FileList['test/test*.rb']
81
+ end
82
+ end
83
+
84
+ task :default => 'test:all'