status_enumerator 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +30 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +23 -0
- data/Rakefile +57 -0
- data/VERSION +1 -0
- data/lib/status_enumerator.rb +70 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/status_enumerator_spec.rb +161 -0
- data/status_enumerator.gemspec +69 -0
- metadata +162 -0
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
# Add dependencies to develop your gem here.
|
7
|
+
# Include everything needed to run rake, tests, features, etc.
|
8
|
+
group :development do
|
9
|
+
gem "rspec", "~> 2.3.0"
|
10
|
+
gem "bundler", "~> 1.0.0"
|
11
|
+
gem "jeweler", "~> 1.6.0"
|
12
|
+
gem "rcov", ">= 0"
|
13
|
+
gem "rdoc", ">= 2.4.2"
|
14
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
diff-lcs (1.1.2)
|
5
|
+
git (1.2.5)
|
6
|
+
jeweler (1.6.0)
|
7
|
+
bundler (~> 1.0.0)
|
8
|
+
git (>= 1.2.5)
|
9
|
+
rake
|
10
|
+
rake (0.9.0)
|
11
|
+
rcov (0.9.9)
|
12
|
+
rdoc (3.6.1)
|
13
|
+
rspec (2.3.0)
|
14
|
+
rspec-core (~> 2.3.0)
|
15
|
+
rspec-expectations (~> 2.3.0)
|
16
|
+
rspec-mocks (~> 2.3.0)
|
17
|
+
rspec-core (2.3.1)
|
18
|
+
rspec-expectations (2.3.0)
|
19
|
+
diff-lcs (~> 1.1.2)
|
20
|
+
rspec-mocks (2.3.0)
|
21
|
+
|
22
|
+
PLATFORMS
|
23
|
+
x86-mingw32
|
24
|
+
|
25
|
+
DEPENDENCIES
|
26
|
+
bundler (~> 1.0.0)
|
27
|
+
jeweler (~> 1.6.0)
|
28
|
+
rcov
|
29
|
+
rdoc (>= 2.4.2)
|
30
|
+
rspec (~> 2.3.0)
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Keiichiro Nishi
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
= status_enumerator
|
2
|
+
|
3
|
+
This class provides an enumeration function to have the object which I added tree information to in an argument.
|
4
|
+
The instance receives an enumerable object and provides #each and #each_method. The #each method calls a block in an argument in own. The #each_method method calls the method of an object appointed own in an argument.
|
5
|
+
I have the information of the object equal to the ancestors in own and front and back and hierarchy structure, and a block and the argument handed to a method maintain the state flag in the enumeration again.
|
6
|
+
It is necessary to appoint the information about the descendant in the hierarchy structure in a block - a method explicitly. When the #into method receives an enumerable object, and a block is not exhibited, a block - a method is used recursively.
|
7
|
+
This class provides a function to enumerate it, but it is not the object which it can enumerate.
|
8
|
+
|
9
|
+
== Contributing to status_enumerator
|
10
|
+
|
11
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
12
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
13
|
+
* Fork the project
|
14
|
+
* Start a feature/bugfix branch
|
15
|
+
* Commit and push until you are happy with your contribution
|
16
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
17
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
18
|
+
|
19
|
+
== Copyright
|
20
|
+
|
21
|
+
Copyright (c) 2011 Keiichiro Nishi. See LICENSE.txt for
|
22
|
+
further details.
|
23
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "status_enumerator"
|
18
|
+
gem.homepage = "http://github.com/Ktouth/status_enumerator"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{This class provides an enumeration function to have the object which I added tree information to in an argument}
|
21
|
+
gem.description = <<-ENDE
|
22
|
+
This class provides an enumeration function to have the object which I added tree information to in an argument.
|
23
|
+
The instance receives an enumerable object and provides #each and #each_method. The #each method calls a block in an argument in own. The #each_method method calls the method of an object appointed own in an argument.
|
24
|
+
I have the information of the object equal to the ancestors in own and front and back and hierarchy structure, and a block and the argument handed to a method maintain the state flag in the enumeration again.
|
25
|
+
It is necessary to appoint the information about the descendant in the hierarchy structure in a block - a method explicitly. When the #into method receives an enumerable object, and a block is not exhibited, a block - a method is used recursively.
|
26
|
+
This class provides a function to enumerate it, but it is not the object which it can enumerate.
|
27
|
+
ENDE
|
28
|
+
gem.email = "ktouth@k-brand.gr.jp"
|
29
|
+
gem.authors = ["Keiichiro Nishi"]
|
30
|
+
gem.required_ruby_version = '>= 1.8.7'
|
31
|
+
# dependencies defined in Gemfile
|
32
|
+
end
|
33
|
+
Jeweler::RubygemsDotOrgTasks.new
|
34
|
+
|
35
|
+
require 'rspec/core'
|
36
|
+
require 'rspec/core/rake_task'
|
37
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
38
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
39
|
+
end
|
40
|
+
|
41
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
42
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
43
|
+
spec.rcov = true
|
44
|
+
end
|
45
|
+
|
46
|
+
task :default => :spec
|
47
|
+
|
48
|
+
require 'rdoc/task'
|
49
|
+
RDoc::Task.new do |rdoc|
|
50
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
51
|
+
|
52
|
+
rdoc.rdoc_dir = 'rdoc'
|
53
|
+
rdoc.title = "status_enumerator #{version}"
|
54
|
+
rdoc.rdoc_files.include('README*')
|
55
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
56
|
+
rdoc.options = ["--charset", "utf-8", "--line-numbers"]
|
57
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.2
|
@@ -0,0 +1,70 @@
|
|
1
|
+
class StatusEnumerator
|
2
|
+
def initialize(target)
|
3
|
+
raise ArgumentError, '%s is not redpond to #each' % target.class.name if target.nil? or !target.respond_to?(:each)
|
4
|
+
@target = target
|
5
|
+
end
|
6
|
+
|
7
|
+
def each
|
8
|
+
raise ArgumentError, 'no block given' unless block_given?
|
9
|
+
c, stat = 0, Status.new
|
10
|
+
@target.each do |i|
|
11
|
+
stat.send(:put_next, i)
|
12
|
+
c += 1
|
13
|
+
if c == 3
|
14
|
+
n = stat.send(:put_prev)
|
15
|
+
stat.send(:set_flags, true, false)
|
16
|
+
yield stat
|
17
|
+
stat.send(:put_next, n)
|
18
|
+
yield stat
|
19
|
+
elsif c > 2
|
20
|
+
yield stat
|
21
|
+
end
|
22
|
+
end.tap do
|
23
|
+
if c > 0
|
24
|
+
case c
|
25
|
+
when 1
|
26
|
+
stat.send(:put_next)
|
27
|
+
stat.send(:set_flags, true, true)
|
28
|
+
yield stat
|
29
|
+
when 2
|
30
|
+
stat.send(:set_flags, true, false)
|
31
|
+
yield stat
|
32
|
+
stat.send(:put_next)
|
33
|
+
stat.send(:set_flags, false, true)
|
34
|
+
yield stat
|
35
|
+
else
|
36
|
+
stat.send(:put_next)
|
37
|
+
stat.send(:set_flags, false, true)
|
38
|
+
yield stat
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
class Status # :nodoc:
|
45
|
+
attr_reader :current, :prev, :next
|
46
|
+
def first?; !!@first_p end
|
47
|
+
def last?; !!@last_p end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def initialize
|
52
|
+
@prev = @current = @next = nil
|
53
|
+
@first_p = @last_p = true
|
54
|
+
end
|
55
|
+
|
56
|
+
def put_next(obj = nil)
|
57
|
+
_prev, @prev, @current, @next = @prev, @current, @next, obj
|
58
|
+
@first_p = false
|
59
|
+
_prev
|
60
|
+
end
|
61
|
+
def put_prev(obj = nil)
|
62
|
+
@prev, @current, @next, _next = obj, @prev, @current, @next
|
63
|
+
@last_p = false
|
64
|
+
_next
|
65
|
+
end
|
66
|
+
def set_flags(first, last)
|
67
|
+
@first_p, @last_p = first, last
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
require 'status_enumerator'
|
5
|
+
|
6
|
+
# Requires supporting files with custom matchers and macros, etc,
|
7
|
+
# in ./support/ and its subdirectories.
|
8
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,161 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe StatusEnumerator do
|
4
|
+
it 'is Class' do
|
5
|
+
StatusEnumerator.should be_instance_of(Class)
|
6
|
+
end
|
7
|
+
|
8
|
+
describe 'constructor' do
|
9
|
+
it 'obj is enumerable' do
|
10
|
+
obj = (1..10).to_a
|
11
|
+
StatusEnumerator.new(obj).should be_instance_of(StatusEnumerator)
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'raise not parameter' do
|
15
|
+
lambda { StatusEnumerator.new }.should raise_error(ArgumentError)
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'raise not enumerable parameter' do
|
19
|
+
lambda { StatusEnumerator.new(Time.now) }.should raise_error(ArgumentError)
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'raise nil parameter' do
|
23
|
+
lambda { StatusEnumerator.new(nil) }.should raise_error(ArgumentError)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe '#each' do
|
28
|
+
it 'need block given' do
|
29
|
+
lambda { StatusEnumerator.new([]).each }.should raise_error(ArgumentError)
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'not carry out blocking when there is not an element' do
|
33
|
+
i = 0
|
34
|
+
StatusEnumerator.new([]).each { i += 1 }
|
35
|
+
i.should == 0
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'only a number same as an element carries out blocking' do
|
39
|
+
i = 0
|
40
|
+
obj = [2648, 'sample', nil, :test, /aaa/]
|
41
|
+
StatusEnumerator.new(obj).each { i += 1 }
|
42
|
+
i.should == obj.size
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'calls #each of the object which I can enumerate once' do
|
46
|
+
class << (ary = [2648, 'sample', nil, :test, /aaa/])
|
47
|
+
attr_accessor :called
|
48
|
+
def each(&block)
|
49
|
+
super(&block).tap { self.called += 1 }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
ary.called = 0
|
53
|
+
StatusEnumerator.new(ary).each { }
|
54
|
+
ary.called.should == 1
|
55
|
+
end
|
56
|
+
|
57
|
+
describe 'block parameter' do
|
58
|
+
before :all do
|
59
|
+
@ary_many = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
|
60
|
+
end
|
61
|
+
|
62
|
+
it 'is not nil' do
|
63
|
+
StatusEnumerator.new(@ary_many).each do |i|
|
64
|
+
i.should_not be_nil
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'is not object itself' do
|
69
|
+
ary = @ary_many.dup
|
70
|
+
StatusEnumerator.new(@ary_many).each do |i|
|
71
|
+
i.should_not == ary.shift
|
72
|
+
end
|
73
|
+
ary.should be_empty
|
74
|
+
end
|
75
|
+
|
76
|
+
it '#current is target object' do
|
77
|
+
ary = @ary_many.dup
|
78
|
+
StatusEnumerator.new(@ary_many).each do |i|
|
79
|
+
i.current.should == ary.shift
|
80
|
+
end
|
81
|
+
ary.should be_empty
|
82
|
+
end
|
83
|
+
|
84
|
+
it '#prev gives back an element just before that' do
|
85
|
+
ary = @ary_many[0 .. -2]
|
86
|
+
ary.unshift nil
|
87
|
+
ary.size.should == @ary_many.size
|
88
|
+
StatusEnumerator.new(@ary_many).each do |i|
|
89
|
+
i.prev.should == ary.shift
|
90
|
+
end
|
91
|
+
ary.should be_empty
|
92
|
+
end
|
93
|
+
|
94
|
+
it '#next gives back an element just after that' do
|
95
|
+
ary = @ary_many[1 .. -1]
|
96
|
+
ary.push nil
|
97
|
+
ary.size.should == @ary_many.size
|
98
|
+
StatusEnumerator.new(@ary_many).each do |i|
|
99
|
+
i.next.should == ary.shift
|
100
|
+
end
|
101
|
+
ary.should be_empty
|
102
|
+
end
|
103
|
+
|
104
|
+
describe 'The number of elements in the case of one' do
|
105
|
+
before do
|
106
|
+
@enum = StatusEnumerator.new([1564988])
|
107
|
+
end
|
108
|
+
|
109
|
+
it '#first? gives back true' do
|
110
|
+
ary = []
|
111
|
+
@enum.each {|x| ary.push x.first? }
|
112
|
+
ary.should == [true]
|
113
|
+
end
|
114
|
+
|
115
|
+
it '#last? gives back true' do
|
116
|
+
ary = []
|
117
|
+
@enum.each {|x| ary.push x.last? }
|
118
|
+
ary.should == [true]
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
describe 'The number of elements in the case of two' do
|
123
|
+
before do
|
124
|
+
@enum = StatusEnumerator.new([:symbol, /test/])
|
125
|
+
end
|
126
|
+
|
127
|
+
it '#first? gives back true and false' do
|
128
|
+
ary = []
|
129
|
+
@enum.each {|x| ary.push x.first? }
|
130
|
+
ary.should == [true, false]
|
131
|
+
end
|
132
|
+
|
133
|
+
it '#last? gives back false and true' do
|
134
|
+
ary = []
|
135
|
+
@enum.each {|x| ary.push x.last? }
|
136
|
+
ary.should == [false, true]
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
describe 'The number of elements in the case of a majority' do
|
141
|
+
before do
|
142
|
+
ary = [:symbol, 'abnormal', 150.55, nil, Enumerable, 'AAAAAAAAAA', 111, /test/]
|
143
|
+
@size = ary.size
|
144
|
+
@enum = StatusEnumerator.new(ary)
|
145
|
+
end
|
146
|
+
|
147
|
+
it '#first? gives back true and any false' do
|
148
|
+
ary = []
|
149
|
+
@enum.each {|x| ary.push x.first? }
|
150
|
+
ary.should == [true, Array.new(@size - 1, false)].flatten
|
151
|
+
end
|
152
|
+
|
153
|
+
it '#last? gives back any false and true' do
|
154
|
+
ary = []
|
155
|
+
@enum.each {|x| ary.push x.last? }
|
156
|
+
ary.should == [Array.new(@size - 1, false), true].flatten
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{status_enumerator}
|
8
|
+
s.version = "0.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = [%q{Keiichiro Nishi}]
|
12
|
+
s.date = %q{2011-05-30}
|
13
|
+
s.description = %q{This class provides an enumeration function to have the object which I added tree information to in an argument.
|
14
|
+
The instance receives an enumerable object and provides #each and #each_method. The #each method calls a block in an argument in own. The #each_method method calls the method of an object appointed own in an argument.
|
15
|
+
I have the information of the object equal to the ancestors in own and front and back and hierarchy structure, and a block and the argument handed to a method maintain the state flag in the enumeration again.
|
16
|
+
It is necessary to appoint the information about the descendant in the hierarchy structure in a block - a method explicitly. When the #into method receives an enumerable object, and a block is not exhibited, a block - a method is used recursively.
|
17
|
+
This class provides a function to enumerate it, but it is not the object which it can enumerate.
|
18
|
+
}
|
19
|
+
s.email = %q{ktouth@k-brand.gr.jp}
|
20
|
+
s.extra_rdoc_files = [
|
21
|
+
"LICENSE.txt",
|
22
|
+
"README.rdoc"
|
23
|
+
]
|
24
|
+
s.files = [
|
25
|
+
".document",
|
26
|
+
".rspec",
|
27
|
+
"Gemfile",
|
28
|
+
"Gemfile.lock",
|
29
|
+
"LICENSE.txt",
|
30
|
+
"README.rdoc",
|
31
|
+
"Rakefile",
|
32
|
+
"VERSION",
|
33
|
+
"lib/status_enumerator.rb",
|
34
|
+
"spec/spec_helper.rb",
|
35
|
+
"spec/status_enumerator_spec.rb",
|
36
|
+
"status_enumerator.gemspec"
|
37
|
+
]
|
38
|
+
s.homepage = %q{http://github.com/Ktouth/status_enumerator}
|
39
|
+
s.licenses = [%q{MIT}]
|
40
|
+
s.require_paths = [%q{lib}]
|
41
|
+
s.required_ruby_version = Gem::Requirement.new(">= 1.8.7")
|
42
|
+
s.rubygems_version = %q{1.8.4}
|
43
|
+
s.summary = %q{This class provides an enumeration function to have the object which I added tree information to in an argument}
|
44
|
+
|
45
|
+
if s.respond_to? :specification_version then
|
46
|
+
s.specification_version = 3
|
47
|
+
|
48
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
49
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
|
50
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
51
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.0"])
|
52
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
53
|
+
s.add_development_dependency(%q<rdoc>, [">= 2.4.2"])
|
54
|
+
else
|
55
|
+
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
56
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
57
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
|
58
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
59
|
+
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
60
|
+
end
|
61
|
+
else
|
62
|
+
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
63
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
64
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
|
65
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
66
|
+
s.add_dependency(%q<rdoc>, [">= 2.4.2"])
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
metadata
ADDED
@@ -0,0 +1,162 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: status_enumerator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Keiichiro Nishi
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-05-30 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ~>
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 3
|
28
|
+
segments:
|
29
|
+
- 2
|
30
|
+
- 3
|
31
|
+
- 0
|
32
|
+
version: 2.3.0
|
33
|
+
name: rspec
|
34
|
+
type: :development
|
35
|
+
requirement: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 23
|
44
|
+
segments:
|
45
|
+
- 1
|
46
|
+
- 0
|
47
|
+
- 0
|
48
|
+
version: 1.0.0
|
49
|
+
name: bundler
|
50
|
+
type: :development
|
51
|
+
requirement: *id002
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
prerelease: false
|
54
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ~>
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 15
|
60
|
+
segments:
|
61
|
+
- 1
|
62
|
+
- 6
|
63
|
+
- 0
|
64
|
+
version: 1.6.0
|
65
|
+
name: jeweler
|
66
|
+
type: :development
|
67
|
+
requirement: *id003
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
hash: 3
|
76
|
+
segments:
|
77
|
+
- 0
|
78
|
+
version: "0"
|
79
|
+
name: rcov
|
80
|
+
type: :development
|
81
|
+
requirement: *id004
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
hash: 27
|
90
|
+
segments:
|
91
|
+
- 2
|
92
|
+
- 4
|
93
|
+
- 2
|
94
|
+
version: 2.4.2
|
95
|
+
name: rdoc
|
96
|
+
type: :development
|
97
|
+
requirement: *id005
|
98
|
+
description: |
|
99
|
+
This class provides an enumeration function to have the object which I added tree information to in an argument.
|
100
|
+
The instance receives an enumerable object and provides #each and #each_method. The #each method calls a block in an argument in own. The #each_method method calls the method of an object appointed own in an argument.
|
101
|
+
I have the information of the object equal to the ancestors in own and front and back and hierarchy structure, and a block and the argument handed to a method maintain the state flag in the enumeration again.
|
102
|
+
It is necessary to appoint the information about the descendant in the hierarchy structure in a block - a method explicitly. When the #into method receives an enumerable object, and a block is not exhibited, a block - a method is used recursively.
|
103
|
+
This class provides a function to enumerate it, but it is not the object which it can enumerate.
|
104
|
+
|
105
|
+
email: ktouth@k-brand.gr.jp
|
106
|
+
executables: []
|
107
|
+
|
108
|
+
extensions: []
|
109
|
+
|
110
|
+
extra_rdoc_files:
|
111
|
+
- LICENSE.txt
|
112
|
+
- README.rdoc
|
113
|
+
files:
|
114
|
+
- .document
|
115
|
+
- .rspec
|
116
|
+
- Gemfile
|
117
|
+
- Gemfile.lock
|
118
|
+
- LICENSE.txt
|
119
|
+
- README.rdoc
|
120
|
+
- Rakefile
|
121
|
+
- VERSION
|
122
|
+
- lib/status_enumerator.rb
|
123
|
+
- spec/spec_helper.rb
|
124
|
+
- spec/status_enumerator_spec.rb
|
125
|
+
- status_enumerator.gemspec
|
126
|
+
homepage: http://github.com/Ktouth/status_enumerator
|
127
|
+
licenses:
|
128
|
+
- MIT
|
129
|
+
post_install_message:
|
130
|
+
rdoc_options: []
|
131
|
+
|
132
|
+
require_paths:
|
133
|
+
- lib
|
134
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
135
|
+
none: false
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
hash: 57
|
140
|
+
segments:
|
141
|
+
- 1
|
142
|
+
- 8
|
143
|
+
- 7
|
144
|
+
version: 1.8.7
|
145
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
|
+
none: false
|
147
|
+
requirements:
|
148
|
+
- - ">="
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
hash: 3
|
151
|
+
segments:
|
152
|
+
- 0
|
153
|
+
version: "0"
|
154
|
+
requirements: []
|
155
|
+
|
156
|
+
rubyforge_project:
|
157
|
+
rubygems_version: 1.8.4
|
158
|
+
signing_key:
|
159
|
+
specification_version: 3
|
160
|
+
summary: This class provides an enumeration function to have the object which I added tree information to in an argument
|
161
|
+
test_files: []
|
162
|
+
|