progressive_io 1.0.0 → 2.0.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b644b242893003aa43e9f2c9ec382abc77ed6f08aef0acf13612fd8c01af6109
4
+ data.tar.gz: 9ceb2436e366cb6cc823fd1e1600a07d99f7ea3aa07ca299647050b410eab9e7
5
+ SHA512:
6
+ metadata.gz: 800ce4c7128151cdf980f61fb50e2aa7c4811f0bad753535ee438fc2925b3d84018a176f633a18d27783af158dc8667b18623261ab8cccc460364b50f5958cae
7
+ data.tar.gz: 7cf60a1881e77bd39f2bf0dcff6cb9252c72130a24f1daaf2ede3fa62b9c90239a5d2d6a01f9d838b8f4ed79114e8811619c4f8955969a200b1e0e52152e4013
data/CHANGELOG.md ADDED
@@ -0,0 +1,20 @@
1
+ ## 2.0.0
2
+
3
+ * Added comprehensive documentation with examples
4
+ * Added progress block support for tracking read operations
5
+ * Added support for StringIO and other IO-like objects
6
+ * Added each_byte method for byte-by-byte iteration with progress tracking
7
+ * Added getc method for single character reading with progress tracking
8
+ * Added gets method for line reading with progress tracking
9
+ * Modernized gem structure and build process
10
+ * Switched to Bundler for gem management
11
+ * Added Minitest test suite
12
+ * Increased minimum Ruby version requirement to 1.8.7
13
+
14
+ ## 1.0.1
15
+
16
+ * Use Jeweler for build management
17
+
18
+ ## 1.0.0
19
+
20
+ * First release
@@ -1,30 +1,58 @@
1
- = progressive_io
1
+ # progressive_io
2
2
 
3
3
  * http://github.com/julik/progressive_io
4
4
 
5
- == DESCRIPTION:
5
+ ## DESCRIPTION
6
6
 
7
- A wrapper for IO objects that allows a callback to be set which is called when an object is read from
7
+ A wrapper for IO objects that allows a callback to be set which is called when an object is read from.
8
8
 
9
- == FEATURES/PROBLEMS:
9
+ ## FEATURES/PROBLEMS
10
10
 
11
11
  * Wraps any IO
12
12
 
13
- == SYNOPSIS:
13
+ ## SYNOPSIS
14
14
 
15
- io = ProgressiveIO.new(File.open("/bigfile.dat")) do | pos, total_size |
16
- puts "Read %d bytes of %d" % [ pos, total_size ]
17
- end
15
+ ```ruby
16
+ require "progressive_io"
18
17
 
19
- == REQUIREMENTS:
18
+ io = ProgressiveIO.new(File.open("/bigfile.dat")) do | pos |
19
+ puts "Read %d bytes" % [ pos ]
20
+ end
21
+
22
+ # Then, elsewhere deep in the calling code...
23
+ io.each do | line | # Each yielded line will call the callback block
24
+ # Do stuff
25
+ end
26
+ ```
27
+
28
+ For example, you can make any IO a provider for a [progressbar](http://rubygems.org/gem/progressbar):
29
+
30
+ ```ruby
31
+ require "progressive_io"
32
+ require "progressbar"
33
+
34
+ # If you know the total size, you can create a progress bar
35
+ total_size = File.size("/bigfile.dat")
36
+ pbar = Progressbar.new("Pumping data", total_size)
37
+ io_with_progress = ProgressiveIO.new(File.open("/bigfile.dat")) { |pos| pbar.set(pos) }
38
+
39
+ # Then, elsewhere deep in the calling code...
40
+ io_with_progress.each do | line | # Each yielded line will call the callback block
41
+ # Each read operation will properly advance the progressbar
42
+ end
43
+ ```
44
+
45
+ ## REQUIREMENTS
20
46
 
21
47
  * Ruby 1.8.6+
22
48
 
23
- == INSTALL:
49
+ ## INSTALL
24
50
 
25
- * gem install progressive_io
51
+ ```bash
52
+ gem install progressive_io
53
+ ```
26
54
 
27
- == LICENSE:
55
+ ## LICENSE
28
56
 
29
57
  (The MIT License)
30
58
 
@@ -47,4 +75,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
47
75
  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
48
76
  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
49
77
  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
50
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
78
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile CHANGED
@@ -1,14 +1,11 @@
1
- # -*- ruby -*-
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
2
3
 
3
- require 'rubygems'
4
- require 'hoe'
5
-
6
- Hoe.spec 'progressive_io' do | p |
7
- p.developer('Julik Tarkhanov', 'me@ujulik.nl')
8
- p.readme_file = 'README.rdoc'
9
- p.extra_rdoc_files = FileList['*.rdoc'] + FileList['*.txt']
10
- p.extra_dev_deps = {"flexmock" => "~> 0.8"}
11
- p.clean_globs = File.read(File.dirname(__FILE__) + "/.gitignore").split(/\s/).to_a
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.pattern = "test/test_*.rb"
8
+ t.verbose = true
12
9
  end
13
10
 
14
- # vim: syntax=ruby
11
+ task :default => :test
@@ -1,86 +1,196 @@
1
- require "delegate"
1
+ # frozen_string_literal: true
2
2
 
3
- class ProgressiveIO < DelegateClass(IO)
4
- VERSION = '1.0.0'
3
+ # A wrapper class that provides progress tracking for IO operations.
4
+ #
5
+ # This class wraps an IO object and calls a progress block whenever data is read,
6
+ # allowing you to track reading progress for operations like file uploads or downloads.
7
+ #
8
+ # @example Basic usage with a file
9
+ # file = File.open('large_file.txt')
10
+ # progress_io = ProgressiveIO.new(file) do |current_pos|
11
+ # puts "Read #{current_pos} bytes"
12
+ # end
13
+ #
14
+ # progress_io.each_line do |line|
15
+ # # Process each line
16
+ # end
17
+ #
18
+ # @example Usage with a StringIO
19
+ # string_io = StringIO.new("Hello\nWorld\n")
20
+ # progress_io = ProgressiveIO.new(string_io) do |current_pos|
21
+ # puts "Read #{current_pos} bytes"
22
+ # end
23
+ #
24
+ # content = progress_io.read
25
+ #
26
+ # @since 2.0.0
27
+ class ProgressiveIO
28
+ # The version of the ProgressiveIO library
29
+ VERSION = '2.0.0'
5
30
 
6
- # Get or set the total size of the contained IO. If the passed IO is a File object
7
- # the size will be preset automatically
8
- attr_accessor :total_size
31
+ # @return [Proc, nil] The progress callback block that will be called when data is read
32
+ # The block receives one parameter: current position
9
33
  attr_accessor :progress_block
10
34
 
11
- # The constructor accepts an IO object and the block that will be called when the IO is read.
12
- # If the passed IO is a File-like object that responds to #stat then the size will be computed
13
- # automatically
35
+ # Creates a new ProgressiveIO wrapper around an IO object.
36
+ #
37
+ # @param with_io [IO] The IO object to wrap (File, StringIO, etc.)
38
+ # @param blk [Proc, nil] Optional block that will be called when data is read
39
+ # The block receives one parameter: current position
40
+ # @yield [current_pos] The progress callback
41
+ # @yieldparam current_pos [Integer] The current position in the IO stream
42
+ #
43
+ # @example
44
+ # file = File.open('data.txt')
45
+ # progress_io = ProgressiveIO.new(file) do |pos|
46
+ # puts "Read #{pos} bytes"
47
+ # end
14
48
  def initialize(with_io, &blk)
15
- __setobj__(with_io)
16
- @total_size = with_io.stat.size if with_io.respond_to?(:stat)
49
+ @io = with_io
17
50
  @progress_block = blk.to_proc if blk
18
51
  end
19
52
 
20
- # Report offset at each line
53
+ # Iterates over the IO stream line by line, calling the progress block for each line.
54
+ #
55
+ # @param sep_string [String] The line separator (defaults to $/)
56
+ # @yield [line] Each line from the IO stream
57
+ # @yieldparam line [String] A line from the IO stream
58
+ # @return [Enumerator] An enumerator if no block is given
59
+ #
60
+ # @example
61
+ # progress_io.each_line do |line|
62
+ # puts "Processing: #{line.chomp}"
63
+ # end
21
64
  def each(sep_string = $/, &blk)
22
65
  # Report offset at each call of the iterator
23
- result = super(sep_string) do | line |
24
- yield(line)
25
- notify_read
66
+ @io.each(sep_string) do | line |
67
+ yield(line).tap { notify_read }
26
68
  end
27
69
  end
28
70
  alias_method :each_line, :each
29
71
 
72
+ # Iterates over the IO stream byte by byte, calling the progress block for each byte.
73
+ #
74
+ # @yield [byte] Each byte from the IO stream
75
+ # @yieldparam byte [Integer] A byte from the IO stream (0-255)
76
+ # @return [Enumerator] An enumerator if no block is given
77
+ #
78
+ # @example
79
+ # progress_io.each_byte do |byte|
80
+ # puts "Byte: #{byte}"
81
+ # end
30
82
  def each_byte(&blk)
31
83
  # Report offset at each call of the iterator
32
- super { |b| yield(b); notify_read }
84
+ @io.each_byte { |b| yield(b).tap { notify_read } }
33
85
  end
34
86
 
87
+ # Reads a single character from the IO stream.
88
+ #
89
+ # @return [String, nil] The next character or nil if at end of stream
90
+ # @see IO#getc
35
91
  def getc
36
- returning(super) { notify_read }
92
+ inner(:getc)
37
93
  end
38
94
 
39
- def gets
40
- returning(super) { notify_read }
95
+ # Reads a line from the IO stream.
96
+ #
97
+ # @param args [Array] Arguments to pass to the underlying IO#gets method
98
+ # @return [String, nil] The next line or nil if at end of stream
99
+ # @see IO#gets
100
+ def gets(*args)
101
+ inner(:gets, *args)
41
102
  end
42
103
 
104
+ # Reads data from the IO stream.
105
+ #
106
+ # @param a [Array] Arguments to pass to the underlying IO#read method
107
+ # @return [String, nil] The read data or nil if at end of stream
108
+ # @see IO#read
43
109
  def read(*a)
44
- returning(super) { notify_read }
110
+ inner(:read, *a)
45
111
  end
46
112
 
113
+ # Reads a specific number of bytes from the IO stream.
114
+ #
115
+ # @param a [Array] Arguments to pass to the underlying IO#readbytes method
116
+ # @return [String] The read bytes
117
+ # @see IO#readbytes
47
118
  def readbytes(*a)
48
- returning(super) { notify_read }
119
+ inner(:readbytes, *a)
49
120
  end
50
121
 
122
+ # Reads a single character from the IO stream.
123
+ #
124
+ # @return [String] The next character
125
+ # @raise [EOFError] If at end of stream
126
+ # @see IO#readchar
51
127
  def readchar
52
- returning(super) { notify_read }
128
+ inner(:readchar)
53
129
  end
54
130
 
131
+ # Reads a line from the IO stream.
132
+ #
133
+ # @param a [Array] Arguments to pass to the underlying IO#readline method
134
+ # @return [String] The next line
135
+ # @raise [EOFError] If at end of stream
136
+ # @see IO#readline
55
137
  def readline(*a)
56
- returning(super) { notify_read }
138
+ inner(:readline, *a)
57
139
  end
58
140
 
141
+ # Reads all lines from the IO stream.
142
+ #
143
+ # @param a [Array] Arguments to pass to the underlying IO#readlines method
144
+ # @return [Array<String>] Array of lines
145
+ # @see IO#readlines
59
146
  def readlines(*a)
60
- returning(super) { notify_read }
147
+ inner(:readlines, *a)
61
148
  end
62
149
 
150
+ # Seeks to a position in the IO stream.
151
+ #
152
+ # @param a [Array] Arguments to pass to the underlying IO#seek method
153
+ # @return [Integer] The new position
154
+ # @see IO#seek
63
155
  def seek(*a)
64
- returning(super) { notify_read }
156
+ inner(:seek, *a)
65
157
  end
66
158
 
67
- def ungetc(*a)
68
- returning(super) { notify_read }
69
- end
159
+ # def ungetc(*a)
160
+ # inner(:ungetc, a)
161
+ # end
70
162
 
163
+ # Sets the position in the IO stream.
164
+ #
165
+ # @param p [Integer] The new position
166
+ # @return [Integer] The new position
167
+ # @see IO#pos=
71
168
  def pos=(p)
72
- returning(super) { notify_read }
169
+ inner(:pos=, p)
73
170
  end
74
171
 
75
172
  private
76
- # The "returning" idiom copied from ActiveSupport. We know that modern Rubies have
77
- # Object#tap but why mandate newer Rubies for something as small as this?
78
- def returning(r)
79
- yield(r); r
173
+
174
+ # @return [IO] The wrapped IO object
175
+ def io
176
+ @io
177
+ end
178
+
179
+ # Delegates method calls to the wrapped IO object and calls the progress block.
180
+ #
181
+ # @param m [Symbol] The method name to call
182
+ # @param args [Array] Arguments to pass to the method
183
+ # @return [Object] The result of the method call
184
+ def inner(m, *args)
185
+ r = @io.respond_to?(:public_send) ? @io.public_send(m, *args) : @io.send(m, *args)
186
+ r.tap { notify_read }
80
187
  end
81
188
 
82
- # This method will be called when something is read
189
+ # Calls the progress block with current position.
190
+ # This method is called whenever data is read from the IO stream.
191
+ #
192
+ # @return [void]
83
193
  def notify_read
84
- @progress_block.call(pos, @total_size) if @progress_block
194
+ @progress_block.call(@io.pos) if @progress_block
85
195
  end
86
196
  end
@@ -1,19 +1,10 @@
1
- require "test/unit"
2
- require "progressive_io"
1
+ require "minitest/autorun"
2
+ require_relative "../lib/progressive_io"
3
3
  require "flexmock"
4
- require "flexmock/test_unit"
4
+ require "flexmock/minitest"
5
5
  require "stringio"
6
6
 
7
- # http://redmine.ruby-lang.org/issues/4882
8
- # https://github.com/jimweirich/flexmock/issues/4
9
- # https://github.com/julik/flexmock/commit/4acea00677e7b558bd564ec7c7630f0b27d368ca
10
- class FlexMock::PartialMockProxy
11
- def singleton?(method_name)
12
- @obj.singleton_methods.include?(method_name.to_s)
13
- end
14
- end
15
-
16
- class TestProgressiveIO < Test::Unit::TestCase
7
+ class TestProgressiveIO < Minitest::Test
17
8
 
18
9
  def e(s)
19
10
 
@@ -28,33 +19,33 @@ class TestProgressiveIO < Test::Unit::TestCase
28
19
  def test_each
29
20
  io, messages = e("Mary\nHad\nA little\nLamb"), []
30
21
 
31
- io.progress_block = lambda do | offset, total |
32
- messages.push([offset, total])
22
+ io.progress_block = lambda do | offset |
23
+ messages.push([offset])
33
24
  end
34
25
 
35
26
  lines = []
36
27
  io.each {|line| lines.push(line) }
37
28
  assert_equal ["Mary\n", "Had\n", "A little\n", "Lamb"], lines
38
- assert_equal [[5, 22], [9, 22], [18, 22], [22, 22]], messages
29
+ assert_equal [[5], [9], [18], [22]], messages
39
30
  end
40
31
 
41
32
  def test_each_byte
42
33
  io, messages = e("123"), []
43
34
 
44
- io.progress_block = lambda do | offset, total |
45
- messages.push([offset, total])
35
+ io.progress_block = lambda do | offset |
36
+ messages.push([offset])
46
37
  end
47
38
 
48
39
  bytes = []
49
40
  io.each_byte{|s| bytes << s }
50
41
  assert_equal [49, 50, 51], bytes
51
- assert_equal [[1, 3], [2, 3], [3, 3]], messages
42
+ assert_equal [[1], [2], [3]], messages
52
43
  end
53
44
 
54
45
  def test_getc
55
46
  io = e("123")
56
- io.progress_block = lambda do | offset, total |
57
- assert_equal [1, 3], [offset, total]
47
+ io.progress_block = lambda do | offset |
48
+ assert_equal 1, offset
58
49
  end
59
50
  if RUBY_VERSION < "1.9"
60
51
  assert_equal 49, io.getc
@@ -63,26 +54,52 @@ class TestProgressiveIO < Test::Unit::TestCase
63
54
  end
64
55
  end
65
56
 
57
+
58
+
66
59
  def test_gets
67
60
  io = e("Mary\nHad\nA little\nLamb")
68
- io.progress_block = lambda do | offset, total |
69
- assert_equal [5, 22], [offset, total]
61
+ io.progress_block = lambda do | offset |
62
+ assert_equal 5, offset
70
63
  end
71
64
  assert_equal "Mary\n", io.gets
72
65
  end
73
66
 
67
+ def test_gets_with_separator
68
+ io = e("Mary\nHad\nA little\nLamb")
69
+ io.progress_block = lambda do | offset |
70
+ assert_equal 4, offset
71
+ end
72
+ assert_equal "Mary", io.gets("y")
73
+ end
74
+
75
+ def test_gets_with_limit
76
+ io = e("Mary\nHad\nA little\nLamb")
77
+ io.progress_block = lambda do | offset |
78
+ assert_equal 3, offset
79
+ end
80
+ assert_equal "Mar", io.gets(3)
81
+ end
82
+
83
+ def test_gets_with_separator_and_limit
84
+ io = e("Mary\nHad\nA little\nLamb")
85
+ io.progress_block = lambda do | offset |
86
+ assert_equal 2, offset
87
+ end
88
+ assert_equal "Ma", io.gets("a", 2)
89
+ end
90
+
74
91
  def test_read
75
92
  io = e("Mary\nHad\nA little\nLamb")
76
- io.progress_block = lambda do | offset, total |
77
- assert_equal [15, 22], [offset, total]
93
+ io.progress_block = lambda do | offset |
94
+ assert_equal 15, offset
78
95
  end
79
96
  assert_equal "Mary\nHad\nA litt", io.read(15)
80
97
  end
81
98
 
82
99
  def test_readchar
83
100
  io = e("123")
84
- io.progress_block = lambda do | offset, total |
85
- assert_equal [1, 3], [offset, total]
101
+ io.progress_block = lambda do | offset |
102
+ assert_equal 1, offset
86
103
  end
87
104
 
88
105
  if RUBY_VERSION < "1.9"
@@ -92,50 +109,92 @@ class TestProgressiveIO < Test::Unit::TestCase
92
109
  end
93
110
  end
94
111
 
112
+
113
+
95
114
  def test_readline
96
115
  io = e("Mary\nHad\nA little\nLamb")
97
- io.progress_block = lambda do | offset, total |
98
- assert_equal [5, 22], [offset, total]
116
+ io.progress_block = lambda do | offset |
117
+ assert_equal 5, offset
99
118
  end
100
119
  assert_equal "Mary\n", io.readline
101
120
  end
102
121
 
122
+ def test_readline_with_separator
123
+ io = e("Mary\nHad\nA little\nLamb")
124
+ io.progress_block = lambda do | offset |
125
+ assert_equal 4, offset
126
+ end
127
+ assert_equal "Mary", io.readline("y")
128
+ end
129
+
130
+ def test_readline_with_limit
131
+ io = e("Mary\nHad\nA little\nLamb")
132
+ io.progress_block = lambda do | offset |
133
+ assert_equal 3, offset
134
+ end
135
+ assert_equal "Mar", io.readline(3)
136
+ end
137
+
138
+ def test_readline_with_separator_and_limit
139
+ io = e("Mary\nHad\nA little\nLamb")
140
+ io.progress_block = lambda do | offset |
141
+ assert_equal 2, offset
142
+ end
143
+ assert_equal "Ma", io.readline("a", 2)
144
+ end
145
+
103
146
  def test_readlines
104
147
  io = e("Mary\nHad\nA little\nLamb")
105
148
  m = []
106
- io.progress_block = lambda do | offset, total |
107
- m.push([offset, total])
149
+ io.progress_block = lambda do | offset |
150
+ m.push([offset])
108
151
  end
109
152
 
110
153
  assert_equal ["Mary\n", "Had\n", "A little\n", "Lamb"], io.readlines
111
- assert_equal [[22, 22]], m
154
+ assert_equal [[22]], m
112
155
  end
113
156
 
114
- def test_seek
157
+ def test_readlines_with_separator
115
158
  io = e("Mary\nHad\nA little\nLamb")
116
- io.progress_block = lambda do | offset, total |
117
- assert_equal [6, 22], [offset, total]
159
+ m = []
160
+ io.progress_block = lambda do | offset |
161
+ m.push([offset])
118
162
  end
119
- io.seek(6)
163
+
164
+ assert_equal ["Mary\nHad\nA little", "\nLamb"], io.readlines("e")
165
+ assert_equal [[22]], m
120
166
  end
121
167
 
122
- def test_ungetc
168
+ def test_seek
123
169
  io = e("Mary\nHad\nA little\nLamb")
124
- m = []
125
- io.progress_block = lambda do | offset, total |
126
- m.push([offset, total])
170
+ io.progress_block = lambda do | offset |
171
+ assert_equal 6, offset
127
172
  end
128
-
129
- io.getc
130
- io.ungetc(2)
131
- assert_equal [[1, 22], [0, 22]], m
173
+ io.seek(6)
132
174
  end
133
175
 
176
+ # def test_ungetc
177
+ # io = e("Mary\nHad\nA little\nLamb")
178
+ # m = []
179
+ # io.progress_block = lambda do | offset |
180
+ # m.push([offset])
181
+ # end
182
+ #
183
+ # char = io.getc
184
+ # io.ungetc("a")
185
+ # assert_equal [[1], [0]], m
186
+ # end
187
+
134
188
  def test_poseq
135
189
  io = e("Mary\nHad\nA little\nLamb")
136
- io.progress_block = lambda do | offset, total |
137
- assert_equal [2, 22], [offset, total]
190
+ m = []
191
+ io.progress_block = lambda do | offset |
192
+ m << [offset]
138
193
  end
139
194
  io.pos = 2
195
+ io.pos = 3
196
+ io.pos = 4
197
+
198
+ assert_equal [[2], [3], [4]], m
140
199
  end
141
200
  end
metadata CHANGED
@@ -1,86 +1,91 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: progressive_io
3
- version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 1.0.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0
6
5
  platform: ruby
7
- authors:
6
+ authors:
8
7
  - Julik Tarkhanov
9
- autorequire:
10
8
  bindir: bin
11
9
  cert_chain: []
12
-
13
- date: 2011-08-04 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: flexmock
10
+ date: 2025-08-01 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: rake
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '0.0'
19
+ type: :development
17
20
  prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
19
- none: false
20
- requirements:
21
- - - ~>
22
- - !ruby/object:Gem::Version
23
- version: "0.8"
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '0.0'
26
+ - !ruby/object:Gem::Dependency
27
+ name: flexmock
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '0.8'
24
33
  type: :development
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: hoe
28
34
  prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
30
- none: false
31
- requirements:
32
- - - ~>
33
- - !ruby/object:Gem::Version
34
- version: "2.10"
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0.8'
40
+ - !ruby/object:Gem::Dependency
41
+ name: minitest
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '5.0'
35
47
  type: :development
36
- version_requirements: *id002
37
- description: A wrapper for IO objects that allows a callback to be set which is called when an object is read from
38
- email:
39
- - me@ujulik.nl
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '5.0'
54
+ description: A Ruby gem that provides an IO wrapper with progress reporting capabilities.
55
+ It wraps any IO object and calls a callback with the current offset and total size
56
+ on each read operation, making it perfect for implementing progress bars or monitoring
57
+ file operations.
58
+ email: me@julik.nl
40
59
  executables: []
41
-
42
60
  extensions: []
43
-
44
- extra_rdoc_files:
45
- - History.txt
46
- - Manifest.txt
47
- - README.rdoc
48
- files:
49
- - .autotest
50
- - History.txt
51
- - Manifest.txt
52
- - README.rdoc
61
+ extra_rdoc_files:
62
+ - README.md
63
+ files:
64
+ - CHANGELOG.md
65
+ - README.md
53
66
  - Rakefile
54
67
  - lib/progressive_io.rb
55
68
  - test/test_progressive_io.rb
56
- - .gemtest
57
69
  homepage: http://github.com/julik/progressive_io
58
- licenses: []
59
-
60
- post_install_message:
61
- rdoc_options:
62
- - --main
63
- - README.rdoc
64
- require_paths:
70
+ licenses:
71
+ - MIT
72
+ metadata: {}
73
+ rdoc_options: []
74
+ require_paths:
65
75
  - lib
66
- required_ruby_version: !ruby/object:Gem::Requirement
67
- none: false
68
- requirements:
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ requirements:
69
78
  - - ">="
70
- - !ruby/object:Gem::Version
71
- version: "0"
72
- required_rubygems_version: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
79
+ - !ruby/object:Gem::Version
80
+ version: 1.8.7
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
75
83
  - - ">="
76
- - !ruby/object:Gem::Version
77
- version: "0"
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
78
86
  requirements: []
79
-
80
- rubyforge_project: progressive_io
81
- rubygems_version: 1.8.5
82
- signing_key:
83
- specification_version: 3
84
- summary: A wrapper for IO objects that allows a callback to be set which is called when an object is read from
85
- test_files:
86
- - test/test_progressive_io.rb
87
+ rubygems_version: 3.6.6
88
+ specification_version: 4
89
+ summary: An IO wrapper that sends reports on the offset to a callback, on each read
90
+ operation
91
+ test_files: []
data/.autotest DELETED
@@ -1,23 +0,0 @@
1
- # -*- ruby -*-
2
-
3
- require 'autotest/restart'
4
-
5
- # Autotest.add_hook :initialize do |at|
6
- # at.extra_files << "../some/external/dependency.rb"
7
- #
8
- # at.libs << ":../some/external"
9
- #
10
- # at.add_exception 'vendor'
11
- #
12
- # at.add_mapping(/dependency.rb/) do |f, _|
13
- # at.files_matching(/test_.*rb$/)
14
- # end
15
- #
16
- # %w(TestA TestB).each do |klass|
17
- # at.extra_class_map[klass] = "test/test_misc.rb"
18
- # end
19
- # end
20
-
21
- # Autotest.add_hook :run_command do |at|
22
- # system "rake build"
23
- # end
data/.gemtest DELETED
File without changes
data/History.txt DELETED
@@ -1,6 +0,0 @@
1
- === 1.0.0 / 2011-08-04
2
-
3
- * 1 major enhancement
4
-
5
- * Birthday!
6
-
data/Manifest.txt DELETED
@@ -1,7 +0,0 @@
1
- .autotest
2
- History.txt
3
- Manifest.txt
4
- README.rdoc
5
- Rakefile
6
- lib/progressive_io.rb
7
- test/test_progressive_io.rb