fsfifo 0.0.2 → 0.0.3

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
- SHA1:
3
- metadata.gz: b9dc3e26674507e180ce5280b2aa6c31c1db4e14
4
- data.tar.gz: 45da0f1bae15b7929970b23d836ace16c2a1913c
2
+ SHA256:
3
+ metadata.gz: 8748caec92e8256a6c0aa81f7fa10ef2ea1a81597e2e87688faa355bd7fa1755
4
+ data.tar.gz: 2add29fd90ad7d7292ec5dbb3d8df5208bd19ecaef948092580bc08500494262
5
5
  SHA512:
6
- metadata.gz: bd1a6df5f7946b5e8f6008212c980f22cefbb23909688a5b8458c5e0edd21ea2561d773eca5c650bd601b0fe5301f86ad70d36b724e602fd696b61289dd1e4b0
7
- data.tar.gz: ffcd0b4dd87d295e8e2ced48d7743eec75d862765b1f4bac3dffb6f50afbdf57e4a5e171d095f53c3721d097a59ed89e3c9e98a649877c26248e031955648b64
6
+ metadata.gz: 8a878c617f55ac3da93397e11724de0888470166d36a5bdc5ee91f4161a7622345bad3adb5f3f3a9c5726b8521e4ad1fb2183ad832cbf7389606774a3a70fbba
7
+ data.tar.gz: 06ba48adc9619477dd8d1a34651bba0582b7ae6eb9f1326f92504d538495cf9fcd0f1ebbb71529ff08d4bf3939ac8b8e53ba4d7948d83f2543c5046728d204df
data/Gemfile CHANGED
@@ -7,8 +7,10 @@ source "http://rubygems.org"
7
7
  # Include everything needed to run rake, tests, features, etc.
8
8
  group :development do
9
9
  gem "shoulda", ">= 0"
10
- gem "rdoc", "~> 3.12"
11
- gem "bundler", "~> 1.3.5"
12
- gem "jeweler", "~> 1.8.4"
10
+ # gem "rdoc", "~> 6.3.1"
11
+ # gem "bundler", "~> 2.2.33"
12
+ gem "bundler", "~> 2.3.1"
13
+ gem "jeweler", "~> 2.3.9"
13
14
  gem "simplecov-rcov", ">= 0"
15
+ gem "test-unit", ">= 0"
14
16
  end
data/Rakefile CHANGED
@@ -25,7 +25,9 @@ Jeweler::Tasks.new do |gem|
25
25
  end
26
26
  Jeweler::RubygemsDotOrgTasks.new
27
27
 
28
+ # $stderr.puts "LOAD_PATH in Rakefile (size: #{$LOAD_PATH.size}): #{$LOAD_PATH}"
28
29
  require 'rake/testtask'
30
+ require 'test-unit'
29
31
  Rake::TestTask.new(:test) do |test|
30
32
  test.libs << 'lib' << 'test'
31
33
  #test.pattern = 'test/**/test_*.rb'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
data/fsfifo.gemspec CHANGED
@@ -2,18 +2,21 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: fsfifo 0.0.3 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
- s.name = "fsfifo"
8
- s.version = "0.0.1"
8
+ s.name = "fsfifo".freeze
9
+ s.version = "0.0.3"
9
10
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["YAMAMOTO, Masayuki"]
12
- s.date = "2013-07-31"
13
- s.description = "Fixed size FIFO, LIFO, and Array."
14
- s.email = "martin.route66.blues+github@gmail.com"
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib".freeze]
13
+ s.authors = ["YAMAMOTO, Masayuki".freeze]
14
+ s.date = "2023-02-12"
15
+ s.description = "Fixed size FIFO, LIFO, and Array.".freeze
16
+ s.email = "martin.route66.blues+github@gmail.com".freeze
15
17
  s.extra_rdoc_files = [
16
- "LICENSE.txt"
18
+ "LICENSE.txt",
19
+ "ReadMe.md"
17
20
  ]
18
21
  s.files = [
19
22
  ".document",
@@ -22,38 +25,32 @@ Gem::Specification.new do |s|
22
25
  "Rakefile",
23
26
  "ReadMe.md",
24
27
  "VERSION",
28
+ "fsfifo.gemspec",
25
29
  "lib/fsfifo.rb",
26
30
  "test/helper.rb",
27
31
  "test/test_fsfifo.rb"
28
32
  ]
29
- s.homepage = "http://github.com/mephistobooks/fsfifo"
30
- s.licenses = ["MIT"]
31
- s.require_paths = ["lib"]
32
- s.rubygems_version = "2.0.6"
33
- s.summary = "Fixed size FIFO."
33
+ s.homepage = "http://github.com/mephistobooks/fsfifo".freeze
34
+ s.licenses = ["MIT".freeze]
35
+ s.rubygems_version = "3.3.7".freeze
36
+ s.summary = "Fixed size FIFO.".freeze
34
37
 
35
38
  if s.respond_to? :specification_version then
36
39
  s.specification_version = 4
40
+ end
37
41
 
38
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
39
- s.add_development_dependency(%q<shoulda>, [">= 0"])
40
- s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
41
- s.add_development_dependency(%q<bundler>, ["~> 1.3.5"])
42
- s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
43
- s.add_development_dependency(%q<simplecov-rcov>, [">= 0"])
44
- else
45
- s.add_dependency(%q<shoulda>, [">= 0"])
46
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
47
- s.add_dependency(%q<bundler>, ["~> 1.3.5"])
48
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
49
- s.add_dependency(%q<simplecov-rcov>, [">= 0"])
50
- end
42
+ if s.respond_to? :add_runtime_dependency then
43
+ s.add_development_dependency(%q<shoulda>.freeze, [">= 0"])
44
+ s.add_development_dependency(%q<bundler>.freeze, ["~> 2.3.1"])
45
+ s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
46
+ s.add_development_dependency(%q<simplecov-rcov>.freeze, [">= 0"])
47
+ s.add_development_dependency(%q<test-unit>.freeze, [">= 0"])
51
48
  else
52
- s.add_dependency(%q<shoulda>, [">= 0"])
53
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
54
- s.add_dependency(%q<bundler>, ["~> 1.3.5"])
55
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
56
- s.add_dependency(%q<simplecov-rcov>, [">= 0"])
49
+ s.add_dependency(%q<shoulda>.freeze, [">= 0"])
50
+ s.add_dependency(%q<bundler>.freeze, ["~> 2.3.1"])
51
+ s.add_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
52
+ s.add_dependency(%q<simplecov-rcov>.freeze, [">= 0"])
53
+ s.add_dependency(%q<test-unit>.freeze, [">= 0"])
57
54
  end
58
55
  end
59
56
 
data/lib/fsfifo.rb CHANGED
@@ -11,10 +11,24 @@
11
11
  class FSArray < Array
12
12
 
13
13
  FSARRAY_SIZE_DEFAULT = 1
14
- #
15
- # FSArray#new( n )
16
- # FSArray#new( size: n, of_enable: true, of_proc: Proc.new{...} )
17
- #
14
+
15
+ # Fixed-size Array.
16
+ # ==== Args
17
+ # _size :: size of FSArray.
18
+ # size: :: same above.
19
+ # of_enable: :: Overflow proc enable: true (enable)/false (disable)
20
+ # of_proc: :: Overflow proc itself.
21
+ # uf_enable: :: Underflow proc enable: true (enable)/false (disable)
22
+ # uf_proc: :: Underflow proc itself.
23
+ # wm_size: Water mark ( <= fsarray size )
24
+ # wm_proc: Water mark proc.
25
+ # ==== Usage
26
+ # * FSArray#new( n )
27
+ # * FSArray#new( size: n, of_enable: true, of_proc: Proc.new{...} )
28
+ # * FSArray.new[ -1 ] :: newly pushed data.
29
+ # * FSArray.new[ 0 ] :: first-out data.
30
+ # ==== Return
31
+ # Object of FSArray.
18
32
  def initialize( _size = FSARRAY_SIZE_DEFAULT,
19
33
  size: FSARRAY_SIZE_DEFAULT,
20
34
  of_enable: false, of_proc: Proc.new{ raise "Overflow!" },
data/test/helper.rb CHANGED
@@ -11,12 +11,14 @@ rescue Bundler::BundlerError => e
11
11
  $stderr.puts "Run `bundle install` to install missing gems"
12
12
  exit e.status_code
13
13
  end
14
- require 'test/unit'
14
+ # require 'test-unit'
15
15
  require 'shoulda'
16
16
 
17
17
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
18
18
  $LOAD_PATH.unshift(File.dirname(__FILE__))
19
+ # $stdout.puts "LOAD_PATH (size: #{$LOAD_PATH.size}): #{$LOAD_PATH}"
19
20
  require 'fsfifo'
21
+ require 'test-unit'
20
22
 
21
23
  class Test::Unit::TestCase
22
24
  end
data/test/test_fsfifo.rb CHANGED
@@ -32,7 +32,7 @@ class TestFSArray < Test::Unit::TestCase
32
32
  end
33
33
 
34
34
  ####
35
-
35
+
36
36
  def test_new
37
37
 
38
38
  ff = FSFIFO.new( size: 10 )
@@ -77,6 +77,7 @@ class TestFSArray < Test::Unit::TestCase
77
77
  assert_equal( 1, @fifo.size )
78
78
  assert_equal( 1, @fifo.fifosize )
79
79
  assert_equal( 'a', @fifo[0] )
80
+ assert_equal( 'a', @fifo[-1] )
80
81
 
81
82
  ret = @fifo.shift
82
83
  assert_equal( 0, @fifo.size )
@@ -88,6 +89,7 @@ class TestFSArray < Test::Unit::TestCase
88
89
  assert_equal( 1, @fifo.size )
89
90
  assert_equal( 1, @fifo.fifosize )
90
91
  assert_equal( 'c', @fifo[0] )
92
+ assert_equal( 'c', @fifo[-1] )
91
93
 
92
94
  end
93
95
 
@@ -103,31 +105,39 @@ class TestFSArray < Test::Unit::TestCase
103
105
  assert_equal( 1, @fifo.size )
104
106
  assert_equal( 4, @fifo.fifosize )
105
107
  assert_equal( 'm', ret.join )
108
+ assert_equal( 'm', @fifo[-1] )
106
109
 
107
110
  @fifo.push( 'o' )
108
111
  assert_equal( 2, @fifo.size )
109
112
  assert_equal( 4, @fifo.fifosize )
110
113
  assert_equal( 'mo', @fifo.join )
114
+ assert_equal( 'o', @fifo[-1] )
111
115
 
112
116
  @fifo.push( 'e' )
113
117
  assert_equal( 3, @fifo.size )
114
118
  assert_equal( 4, @fifo.fifosize )
115
119
  assert_equal( 'moe', @fifo.join )
120
+ assert_equal( 'm', @fifo[0] )
121
+ assert_equal( 'e', @fifo[-1] )
116
122
 
117
123
  @fifo.push( 'm' )
118
124
  assert_equal( 4, @fifo.size )
119
125
  assert_equal( 4, @fifo.fifosize )
120
126
  assert_equal( 'moem', @fifo.join )
127
+ assert_equal( 'm', @fifo[0] )
128
+ assert_equal( 'm', @fifo[-1] )
121
129
 
122
130
  @fifo.push( 'o' )
123
131
  assert_equal( 4, @fifo.size )
124
132
  assert_equal( 4, @fifo.fifosize )
125
133
  assert_equal( 'oemo', @fifo.join )
134
+ assert_equal( 'o', @fifo[-1] )
126
135
 
127
136
  @fifo.push( 'e' )
128
137
  assert_equal( 4, @fifo.size )
129
138
  assert_equal( 4, @fifo.fifosize )
130
139
  assert_equal( 'emoe', @fifo.join )
140
+ assert_equal( 'e', @fifo[-1] )
131
141
 
132
142
  end
133
143
 
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fsfifo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - YAMAMOTO, Masayuki
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-07 00:00:00.000000000 Z
11
+ date: 2023-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shoulda
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rdoc
28
+ name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.12'
33
+ version: 2.3.1
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '3.12'
40
+ version: 2.3.1
41
41
  - !ruby/object:Gem::Dependency
42
- name: bundler
42
+ name: jeweler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.3.5
47
+ version: 2.3.9
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.3.5
54
+ version: 2.3.9
55
55
  - !ruby/object:Gem::Dependency
56
- name: jeweler
56
+ name: simplecov-rcov
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 1.8.4
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 1.8.4
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: simplecov-rcov
70
+ name: test-unit
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: Fixed size FIFO, LIFO, and Array.
@@ -86,8 +86,9 @@ executables: []
86
86
  extensions: []
87
87
  extra_rdoc_files:
88
88
  - LICENSE.txt
89
+ - ReadMe.md
89
90
  files:
90
- - .document
91
+ - ".document"
91
92
  - Gemfile
92
93
  - LICENSE.txt
93
94
  - Rakefile
@@ -101,24 +102,23 @@ homepage: http://github.com/mephistobooks/fsfifo
101
102
  licenses:
102
103
  - MIT
103
104
  metadata: {}
104
- post_install_message:
105
+ post_install_message:
105
106
  rdoc_options: []
106
107
  require_paths:
107
108
  - lib
108
109
  required_ruby_version: !ruby/object:Gem::Requirement
109
110
  requirements:
110
- - - '>='
111
+ - - ">="
111
112
  - !ruby/object:Gem::Version
112
113
  version: '0'
113
114
  required_rubygems_version: !ruby/object:Gem::Requirement
114
115
  requirements:
115
- - - '>='
116
+ - - ">="
116
117
  - !ruby/object:Gem::Version
117
118
  version: '0'
118
119
  requirements: []
119
- rubyforge_project:
120
- rubygems_version: 2.1.9
121
- signing_key:
120
+ rubygems_version: 3.3.7
121
+ signing_key:
122
122
  specification_version: 4
123
123
  summary: Fixed size FIFO.
124
124
  test_files: []