io-extra 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +5 -0
- data/README +5 -1
- data/Rakefile +40 -17
- data/ext/io/extra.c +2 -2
- data/io-extra.gemspec +5 -5
- data/test/test_io_extra.rb +1 -1
- metadata +15 -8
data/CHANGES
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
== 1.2.3 - 25-Oct-2010
|
2
|
+
* Documentation updates to the README.
|
3
|
+
* Updates to the Rakefile, including archive tasks, a default task, and
|
4
|
+
tweaks to the clean task.
|
5
|
+
|
1
6
|
== 1.2.2 - 1-May-2010
|
2
7
|
* Added the IO.writev method which allows you to write arrays without
|
3
8
|
requiring an Array#join call, i.e. "gather write". Thanks go to Eric
|
data/README
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
= Description
|
2
2
|
The io-extra library provides a few extra IO methods that you may find
|
3
|
-
handy. They are IO.closefrom, IO.fdwalk, IO
|
3
|
+
handy. They are IO.closefrom, IO.fdwalk, IO.pread, IO.pread_ptr, IO.pwrite,
|
4
|
+
IO.writev, IO#directio? and IO#directio=.
|
4
5
|
|
5
6
|
This library is not supported on MS Windows.
|
6
7
|
|
@@ -22,6 +23,9 @@
|
|
22
23
|
p handle.fileno
|
23
24
|
}
|
24
25
|
|
26
|
+
# Write an array to an IO object efficiently
|
27
|
+
IO.writev(fh.fileno, %w[a b c])
|
28
|
+
|
25
29
|
= Developer's Notes
|
26
30
|
You might be wondering what the difference is between my implementation of
|
27
31
|
IO.closefrom and a pure Ruby version that looks something like this:
|
data/Rakefile
CHANGED
@@ -10,16 +10,17 @@ end
|
|
10
10
|
|
11
11
|
desc "Clean the build files for the io-extra source"
|
12
12
|
task :clean do
|
13
|
-
|
13
|
+
Dir['*.gem'].each{ |f| File.delete(f) }
|
14
|
+
Dir['**/*.rbc'].each{ |f| File.delete(f) } # Rubinius
|
15
|
+
rm_rf('io') if File.exists?('io')
|
16
|
+
|
14
17
|
Dir.chdir('ext') do
|
15
18
|
sh 'make distclean' if File.exists?('extra.o')
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
+
rm_rf('extra/extra.c') if File.exists?('extra.c')
|
20
|
+
rm_rf('conftest.dSYM') if File.exists?('conftest.dSYM') # OS X
|
19
21
|
build_file = File.join(Dir.pwd, 'io', 'extra.' + Config::CONFIG['DLEXT'])
|
20
22
|
File.delete(build_file) if File.exists?(build_file)
|
21
23
|
end
|
22
|
-
Dir['*.gem'].each{ |f| File.delete(f) }
|
23
24
|
end
|
24
25
|
|
25
26
|
desc "Build the io-extra library (but don't install it)"
|
@@ -33,16 +34,9 @@ task :build => [:clean] do
|
|
33
34
|
end
|
34
35
|
end
|
35
36
|
|
36
|
-
desc "Install the io-extra library (non-gem)"
|
37
|
-
task :install => [:build] do
|
38
|
-
Dir.chdir('ext') do
|
39
|
-
sh 'make install'
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
37
|
namespace :gem do
|
44
38
|
desc 'Create the io-extra gem'
|
45
|
-
task :create do
|
39
|
+
task :create => [:clean] do
|
46
40
|
spec = eval(IO.read('io-extra.gemspec'))
|
47
41
|
Gem::Builder.new(spec).build
|
48
42
|
end
|
@@ -54,14 +48,43 @@ namespace :gem do
|
|
54
48
|
end
|
55
49
|
end
|
56
50
|
|
51
|
+
namespace :archive do
|
52
|
+
spec = eval(IO.read('io-extra.gemspec'))
|
53
|
+
file = "io-extra-#{spec.version}"
|
54
|
+
|
55
|
+
desc 'Create an io-extra tarball.'
|
56
|
+
task :tar do
|
57
|
+
file = file + ".tar"
|
58
|
+
cmd = "git archive --format=tar --prefix=#{file}/ -o #{file} HEAD"
|
59
|
+
sh cmd
|
60
|
+
end
|
61
|
+
|
62
|
+
desc 'Create a gzipped tarball for io-extra'
|
63
|
+
task :gz => [:tar] do
|
64
|
+
sh "gzip #{file}"
|
65
|
+
end
|
66
|
+
|
67
|
+
desc 'Create a bzip2 tarball for io-extra'
|
68
|
+
task :bz2 => [:tar] do
|
69
|
+
sh "bzip2 #{file}"
|
70
|
+
end
|
71
|
+
|
72
|
+
desc 'Create a zipped tarball for io-extra'
|
73
|
+
task :zip do
|
74
|
+
sh "git archive --format=zip --prefix=#{file}/ -o #{file}.zip HEAD"
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
57
78
|
desc "Run the example io-extra program"
|
58
79
|
task :example => [:build] do
|
59
80
|
ruby '-Iext examples/example_io_extra.rb'
|
60
81
|
end
|
61
82
|
|
62
83
|
Rake::TestTask.new do |t|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
84
|
+
task :test => :build
|
85
|
+
t.libs << 'ext'
|
86
|
+
t.verbose = true
|
87
|
+
t.warning = true
|
67
88
|
end
|
89
|
+
|
90
|
+
task :default => :test
|
data/ext/io/extra.c
CHANGED
@@ -544,6 +544,6 @@ void Init_extra(){
|
|
544
544
|
rb_define_singleton_method(rb_cIO, "writev", s_io_writev, 2);
|
545
545
|
#endif
|
546
546
|
|
547
|
-
/* 1.2.
|
548
|
-
rb_define_const(rb_cIO, "EXTRA_VERSION", rb_str_new2("1.2.
|
547
|
+
/* 1.2.3: The version of this library. This a string. */
|
548
|
+
rb_define_const(rb_cIO, "EXTRA_VERSION", rb_str_new2("1.2.3"));
|
549
549
|
}
|
data/io-extra.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
end
|
9
9
|
|
10
10
|
spec.name = 'io-extra'
|
11
|
-
spec.version = '1.2.
|
11
|
+
spec.version = '1.2.3'
|
12
12
|
spec.author = 'Daniel J. Berger'
|
13
13
|
spec.license = 'Artistic 2.0'
|
14
14
|
spec.email = 'djberg96@gmail.com'
|
@@ -28,11 +28,11 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.rubyforge_project = 'shards'
|
29
29
|
spec.required_ruby_version = '>= 1.8.6'
|
30
30
|
|
31
|
-
spec.add_development_dependency('test-unit', '>= 2.
|
31
|
+
spec.add_development_dependency('test-unit', '>= 2.1.1')
|
32
32
|
|
33
33
|
spec.description = <<-EOF
|
34
|
-
Adds the IO.closefrom, IO.fdwalk, IO.pread, IO.pread_ptr,
|
35
|
-
|
36
|
-
methods (for those platforms that support them).
|
34
|
+
Adds the IO.closefrom, IO.fdwalk, IO.pread, IO.pread_ptr, IO.pwrite, and
|
35
|
+
IO.writev singleton methods as well as the IO#directio and IO#directio?
|
36
|
+
instance methods (for those platforms that support them).
|
37
37
|
EOF
|
38
38
|
end
|
data/test/test_io_extra.rb
CHANGED
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: io-extra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 1
|
7
8
|
- 2
|
8
|
-
-
|
9
|
-
version: 1.2.
|
9
|
+
- 3
|
10
|
+
version: 1.2.3
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Daniel J. Berger
|
@@ -14,24 +15,26 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-10-25 00:00:00 -06:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: test-unit
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 9
|
27
30
|
segments:
|
28
31
|
- 2
|
29
|
-
-
|
30
|
-
-
|
31
|
-
version: 2.
|
32
|
+
- 1
|
33
|
+
- 1
|
34
|
+
version: 2.1.1
|
32
35
|
type: :development
|
33
36
|
version_requirements: *id001
|
34
|
-
description: " Adds the IO.closefrom, IO.fdwalk, IO.pread, IO.pread_ptr,
|
37
|
+
description: " Adds the IO.closefrom, IO.fdwalk, IO.pread, IO.pread_ptr, IO.pwrite, and\n IO.writev singleton methods as well as the IO#directio and IO#directio?\n instance methods (for those platforms that support them).\n"
|
35
38
|
email: djberg96@gmail.com
|
36
39
|
executables: []
|
37
40
|
|
@@ -63,25 +66,29 @@ rdoc_options: []
|
|
63
66
|
require_paths:
|
64
67
|
- lib
|
65
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
66
70
|
requirements:
|
67
71
|
- - ">="
|
68
72
|
- !ruby/object:Gem::Version
|
73
|
+
hash: 59
|
69
74
|
segments:
|
70
75
|
- 1
|
71
76
|
- 8
|
72
77
|
- 6
|
73
78
|
version: 1.8.6
|
74
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
75
81
|
requirements:
|
76
82
|
- - ">="
|
77
83
|
- !ruby/object:Gem::Version
|
84
|
+
hash: 3
|
78
85
|
segments:
|
79
86
|
- 0
|
80
87
|
version: "0"
|
81
88
|
requirements: []
|
82
89
|
|
83
90
|
rubyforge_project: shards
|
84
|
-
rubygems_version: 1.3.
|
91
|
+
rubygems_version: 1.3.7
|
85
92
|
signing_key:
|
86
93
|
specification_version: 3
|
87
94
|
summary: Adds extra methods to the IO class.
|