sorted_array 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +18 -0
- data/.yardopts +1 -0
- data/Gemfile +5 -0
- data/Guardfile +24 -0
- data/LICENSE.txt +22 -0
- data/README.md +103 -0
- data/Rakefile +29 -0
- data/TODO.md +4 -0
- data/lib/sorted_array/default_sorter.rb +50 -0
- data/lib/sorted_array/version.rb +4 -0
- data/lib/sorted_array.rb +71 -0
- data/sorted_array.gemspec +31 -0
- data/spec/default_sorter_spec.rb +34 -0
- data/spec/sorted_array_spec.rb +50 -0
- data/spec/spec_helper.rb +19 -0
- metadata +232 -0
data/.gitignore
ADDED
data/.yardopts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
-m markdown --protected lib/**/*rb - README.md TODO.md LICENSE.txt
|
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard 'rspec' do
|
5
|
+
watch(%r{^spec/.+_spec\.rb$})
|
6
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
7
|
+
watch('spec/spec_helper.rb') { "spec" }
|
8
|
+
|
9
|
+
# Rails example
|
10
|
+
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
11
|
+
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
12
|
+
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
|
13
|
+
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
|
14
|
+
watch('config/routes.rb') { "spec/routing" }
|
15
|
+
watch('app/controllers/application_controller.rb') { "spec/controllers" }
|
16
|
+
|
17
|
+
# Capybara features specs
|
18
|
+
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
|
19
|
+
|
20
|
+
# Turnip features and steps
|
21
|
+
watch(%r{^spec/acceptance/(.+)\.feature$})
|
22
|
+
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
|
23
|
+
end
|
24
|
+
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Andi Altendorfer
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
# SortedArray
|
2
|
+
|
3
|
+
The gem provides a class SortedArray which keeps sorted
|
4
|
+
with a given Sorter-class after adding new items.
|
5
|
+
|
6
|
+
The included DefaultSorter sorts a list of Objects by a
|
7
|
+
given method-name.
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
gem 'sorted_array'
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install sorted_array
|
22
|
+
|
23
|
+
Run Tests
|
24
|
+
|
25
|
+
$ rake
|
26
|
+
|
27
|
+
# using Guard
|
28
|
+
$ guard
|
29
|
+
|
30
|
+
# with rspec
|
31
|
+
$ rspec spec/
|
32
|
+
|
33
|
+
Build Documentation
|
34
|
+
|
35
|
+
$ yard
|
36
|
+
$ open doc/index.html
|
37
|
+
|
38
|
+
## Usage
|
39
|
+
|
40
|
+
data = [
|
41
|
+
OpenStruct.new( foo: 1 ),
|
42
|
+
OpenStruct.new( foo: 3 ),
|
43
|
+
OpenStruct.new( foo: 2 )
|
44
|
+
]
|
45
|
+
keep_sorted = SortedArray.new( DefaultSorter.new(:foo), data )
|
46
|
+
keep_sorted << OpenStruct.new( foo: 0 )
|
47
|
+
|
48
|
+
# data.map(&:foo) => [1,3,2]
|
49
|
+
# keep_sorted.map(&:foo) => [0,1,2,3]
|
50
|
+
|
51
|
+
## Persistent
|
52
|
+
|
53
|
+
_SortedArray_ defines a marshal_load and marshal_dump method and
|
54
|
+
is safe to be used with PStore.
|
55
|
+
|
56
|
+
Example:
|
57
|
+
|
58
|
+
store=PStore.new('example.pstore')
|
59
|
+
store.transaction do |w|
|
60
|
+
w[:data] = keep_sorted
|
61
|
+
end
|
62
|
+
|
63
|
+
from_disk = []
|
64
|
+
store.trasaction(true) do |r|
|
65
|
+
from_disk = r[:data]
|
66
|
+
end
|
67
|
+
|
68
|
+
# from_disk.map(&:foo) => [0,1,2,3]
|
69
|
+
|
70
|
+
|
71
|
+
## Contributing
|
72
|
+
|
73
|
+
1. Fork it
|
74
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
75
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
76
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
77
|
+
5. Create new Pull Request
|
78
|
+
|
79
|
+
|
80
|
+
## License
|
81
|
+
|
82
|
+
Copyright (c) 2013 Andi Altendorfer
|
83
|
+
|
84
|
+
MIT License
|
85
|
+
|
86
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
87
|
+
a copy of this software and associated documentation files (the
|
88
|
+
"Software"), to deal in the Software without restriction, including
|
89
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
90
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
91
|
+
permit persons to whom the Software is furnished to do so, subject to
|
92
|
+
the following conditions:
|
93
|
+
|
94
|
+
The above copyright notice and this permission notice shall be
|
95
|
+
included in all copies or substantial portions of the Software.
|
96
|
+
|
97
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
98
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
99
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
100
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
101
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
102
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
103
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
#
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
options = ENV['TERM'] == 'dumb' ? '--no-color' : '--color'
|
5
|
+
|
6
|
+
# Enable ask when needed ...
|
7
|
+
#def ask prompt, allow
|
8
|
+
#loop do
|
9
|
+
#printf( "%s (%s):" % [prompt, "[#{allow.first}]#{allow[1..-1].join('/')}"])
|
10
|
+
#answer = $stdin.gets
|
11
|
+
#break answer.strip if allow.include?(answer.strip)
|
12
|
+
#break allow.first if answer == "\n"
|
13
|
+
#puts "Please answer #{allow.join('/')} or press Ctrl+C to abort"
|
14
|
+
#end
|
15
|
+
#end
|
16
|
+
|
17
|
+
|
18
|
+
# Application Tasks
|
19
|
+
task :default => 'test'
|
20
|
+
|
21
|
+
desc 'Run all specs'
|
22
|
+
task :test do
|
23
|
+
system "rspec -f p #{options} spec "
|
24
|
+
end
|
25
|
+
|
26
|
+
desc 'Build documentation'
|
27
|
+
task :doc do
|
28
|
+
system 'yard'
|
29
|
+
end
|
data/TODO.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
module SortedArray
|
2
|
+
|
3
|
+
# Sorts by comparing of :field a <=> b.
|
4
|
+
#
|
5
|
+
# Descend your Sorter from this class. It must at least define a
|
6
|
+
# method 'sort'.
|
7
|
+
# @example
|
8
|
+
# class Foo
|
9
|
+
# def initialize(_bar)
|
10
|
+
# @bar = _bar
|
11
|
+
# end
|
12
|
+
# def bar
|
13
|
+
# @bar
|
14
|
+
# end
|
15
|
+
# end
|
16
|
+
# s = DefaultSorter.new(:bar)
|
17
|
+
# a = SortedArray(s, Foo.new(1), Foo.new(3), Foo.new(2))
|
18
|
+
# # => Foo(1), Foo(2), Foo(3)
|
19
|
+
# @see SortedArray
|
20
|
+
class DefaultSorter
|
21
|
+
|
22
|
+
attr_reader :method
|
23
|
+
|
24
|
+
# @param [String] _method - the method to be used while sorting.
|
25
|
+
def initialize(_method)
|
26
|
+
@method = _method
|
27
|
+
end
|
28
|
+
|
29
|
+
# Sort the given object.
|
30
|
+
# @abstract Overwrite this method in descendants
|
31
|
+
# to sort your objects for your needs
|
32
|
+
# @param [Object] what - what must provice a method sort! and :method
|
33
|
+
# @return [Object]
|
34
|
+
def sort(object)
|
35
|
+
object.sort! { |a,b| a.send(@method) <=> b.send(@method) }
|
36
|
+
end
|
37
|
+
|
38
|
+
# @return [Array] - Classname, methodname
|
39
|
+
def marshal_dump
|
40
|
+
[ self.class, @method ]
|
41
|
+
end
|
42
|
+
|
43
|
+
# @param [Array] array - _classname,[..entries..]
|
44
|
+
def marshal_load array
|
45
|
+
@method = array.last
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
data/lib/sorted_array.rb
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'sorted_array/version'
|
2
|
+
require 'sorted_array/default_sorter'
|
3
|
+
|
4
|
+
# The gem/module provides a class SortedArray which keeps sorted
|
5
|
+
# with a given Sorter-class after adding new items.
|
6
|
+
module SortedArray
|
7
|
+
|
8
|
+
# A SortedArray takes a Sorter-object as a parameter.
|
9
|
+
# The array gets sorted after each push,<<,unsift.
|
10
|
+
# It defines marshal-methods and can be used with PStore
|
11
|
+
# @see DefaultSorter
|
12
|
+
class SortedArray < Array
|
13
|
+
|
14
|
+
# @params [Array] args the first argument is a Sorter-object
|
15
|
+
# @example
|
16
|
+
# my_array = SortedArray.new( DefaultSorter.new(:foo) )
|
17
|
+
# my_array << AnyClassWhichSupportsFoo.new(1)
|
18
|
+
# my_array << AnyClassWhichSupportsFoo.new(3)
|
19
|
+
# my_array << AnyClassWhichSupportsFoo.new(2)
|
20
|
+
# # my_array.map(&:foo) => 1,2,3
|
21
|
+
# @see DefaultSorter
|
22
|
+
# @see Array
|
23
|
+
def initialize *args
|
24
|
+
@sorter = args.shift
|
25
|
+
super
|
26
|
+
end
|
27
|
+
|
28
|
+
# @see Array
|
29
|
+
def push *other
|
30
|
+
super
|
31
|
+
@sorter.sort(self)
|
32
|
+
end
|
33
|
+
|
34
|
+
# @see Array
|
35
|
+
def unshift other
|
36
|
+
super
|
37
|
+
@sorter.sort(self)
|
38
|
+
end
|
39
|
+
|
40
|
+
# @see Array
|
41
|
+
def << other
|
42
|
+
push *other
|
43
|
+
@sorter.sort(self)
|
44
|
+
end
|
45
|
+
|
46
|
+
protected
|
47
|
+
|
48
|
+
# @return [Array] - Sorter-object or nil, [...values...]
|
49
|
+
def marshal_dump
|
50
|
+
[@sorter ? @sorter.marshal_dump : nil, to_a]
|
51
|
+
end
|
52
|
+
|
53
|
+
# Initialize sorter and read in data
|
54
|
+
# @param [Array] array - _sorter, [..entries..]
|
55
|
+
def marshal_load array
|
56
|
+
_sorter, _data = *array
|
57
|
+
if _sorter
|
58
|
+
initialize_sorter _sorter
|
59
|
+
push *_data if _data
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
def initialize_sorter args
|
66
|
+
@sorter = args.shift.new *args
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'sorted_array/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "sorted_array"
|
8
|
+
spec.version = SortedArray::VERSION
|
9
|
+
spec.authors = ["Andi Altendorfer"]
|
10
|
+
spec.email = ["andi@iboard.cc"]
|
11
|
+
spec.description = %q{Provides class SortedArray which you can initialize with a block used to sort the Array after each push-action.}
|
12
|
+
spec.summary = 'SortedArray.new { |a,b| a.foo <=> b.foo }'
|
13
|
+
spec.homepage = "https://github.com/iboard/sorted_array"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "rspec"
|
24
|
+
spec.add_development_dependency "rspec-expectations"
|
25
|
+
spec.add_development_dependency "rspec-mocks"
|
26
|
+
spec.add_development_dependency "guard"
|
27
|
+
spec.add_development_dependency "guard-rspec"
|
28
|
+
spec.add_development_dependency "yard"
|
29
|
+
spec.add_development_dependency "redcarpet"
|
30
|
+
spec.add_development_dependency "simplecov"
|
31
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe SortedArray::DefaultSorter do
|
4
|
+
|
5
|
+
let(:sorter) { SortedArray::DefaultSorter.new(:foo) }
|
6
|
+
let(:items) { [
|
7
|
+
OpenStruct.new(foo: 1),
|
8
|
+
OpenStruct.new(foo: 3),
|
9
|
+
OpenStruct.new(foo: 2)
|
10
|
+
] }
|
11
|
+
let(:sorted) { items.sort{|a,b|a.foo <=> b.foo} }
|
12
|
+
|
13
|
+
it 'initialize with a sort-method' do
|
14
|
+
expect(sorter.method).to eq(:foo)
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'sorts an array by a given sort-method' do
|
18
|
+
expect(sorter.sort(items)).to eq(sorted)
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'stores the method-name to a PStore' do
|
22
|
+
sorter.should_receive(:marshal_dump)
|
23
|
+
PStore.new(SORTER_TEST_STORE).transaction do |s|
|
24
|
+
s[:sorter] = sorter
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'loads the method-name from a PStore' do
|
29
|
+
sorter.should_receive(:marshal_load)
|
30
|
+
PStore.new(SORTER_TEST_STORE).transaction do |s|
|
31
|
+
s[:sorter]
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'ostruct'
|
3
|
+
require 'pstore'
|
4
|
+
|
5
|
+
describe SortedArray::SortedArray do
|
6
|
+
|
7
|
+
context 'with two objects and the DefaultSorter' do
|
8
|
+
|
9
|
+
let(:items) { [ OpenStruct.new(foo: 'baz'), OpenStruct.new(foo: 'bar') ] }
|
10
|
+
let(:sorted) { items.reverse }
|
11
|
+
let(:sorter) { SortedArray::DefaultSorter.new( :foo ) }
|
12
|
+
let(:array) { SortedArray::SortedArray.new(sorter) }
|
13
|
+
|
14
|
+
it 'sorts objects after push' do
|
15
|
+
expect(array.push *items).to eq(sorted)
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'sorts objects after <<' do
|
19
|
+
expect(array << items).to eq(sorted)
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'sorts objects after unshift' do
|
23
|
+
items.each { |item| array.unshift(item) }
|
24
|
+
expect(array).to eq(sorted)
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
describe 'Persists to a PStore' do
|
29
|
+
|
30
|
+
let(:store) { PStore.new(ARRAY_TEST_STORE) }
|
31
|
+
|
32
|
+
it 'stores to a PStore' do
|
33
|
+
expect{ store.transaction { |ps| ps[:array] = array } }.not_to raise_error
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'reads from a PStore' do
|
37
|
+
loaded_array = nil
|
38
|
+
array.push *items
|
39
|
+
store.transaction do |ps|
|
40
|
+
ps[:array] = array
|
41
|
+
end
|
42
|
+
store.transaction(true) do |ps|
|
43
|
+
loaded_array = ps[:array]
|
44
|
+
end
|
45
|
+
expect(loaded_array).to eq(sorted)
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
SimpleCov.start
|
3
|
+
|
4
|
+
require 'rubygems'
|
5
|
+
require 'bundler/setup'
|
6
|
+
|
7
|
+
require 'rspec/expectations'
|
8
|
+
require 'rspec/mocks'
|
9
|
+
require 'sorted_array' # and any other gems you need
|
10
|
+
|
11
|
+
SORTER_TEST_STORE = '/tmp/sorter_spec.pstore'
|
12
|
+
ARRAY_TEST_STORE = '/tmp/sorted_array_spec.pstore'
|
13
|
+
|
14
|
+
RSpec.configure do |c|
|
15
|
+
c.include SortedArray
|
16
|
+
File.unlink(SORTER_TEST_STORE) if File.exists?(SORTER_TEST_STORE)
|
17
|
+
File.unlink(ARRAY_TEST_STORE) if File.exists?(ARRAY_TEST_STORE)
|
18
|
+
end
|
19
|
+
|
metadata
ADDED
@@ -0,0 +1,232 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sorted_array
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Andi Altendorfer
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-06-09 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '1.3'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.3'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rspec-expectations
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rspec-mocks
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: guard
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: guard-rspec
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: yard
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: redcarpet
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
type: :development
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
- !ruby/object:Gem::Dependency
|
159
|
+
name: simplecov
|
160
|
+
requirement: !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
162
|
+
requirements:
|
163
|
+
- - '>='
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0'
|
166
|
+
type: :development
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - '>='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
description: Provides class SortedArray which you can initialize with a block used
|
175
|
+
to sort the Array after each push-action.
|
176
|
+
email:
|
177
|
+
- andi@iboard.cc
|
178
|
+
executables: []
|
179
|
+
extensions: []
|
180
|
+
extra_rdoc_files: []
|
181
|
+
files:
|
182
|
+
- .gitignore
|
183
|
+
- .yardopts
|
184
|
+
- Gemfile
|
185
|
+
- Guardfile
|
186
|
+
- LICENSE.txt
|
187
|
+
- README.md
|
188
|
+
- Rakefile
|
189
|
+
- TODO.md
|
190
|
+
- lib/sorted_array.rb
|
191
|
+
- lib/sorted_array/default_sorter.rb
|
192
|
+
- lib/sorted_array/version.rb
|
193
|
+
- sorted_array.gemspec
|
194
|
+
- spec/default_sorter_spec.rb
|
195
|
+
- spec/sorted_array_spec.rb
|
196
|
+
- spec/spec_helper.rb
|
197
|
+
homepage: https://github.com/iboard/sorted_array
|
198
|
+
licenses:
|
199
|
+
- MIT
|
200
|
+
post_install_message:
|
201
|
+
rdoc_options: []
|
202
|
+
require_paths:
|
203
|
+
- lib
|
204
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
205
|
+
none: false
|
206
|
+
requirements:
|
207
|
+
- - '>='
|
208
|
+
- !ruby/object:Gem::Version
|
209
|
+
version: '0'
|
210
|
+
segments:
|
211
|
+
- 0
|
212
|
+
hash: -3563326067175133732
|
213
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
214
|
+
none: false
|
215
|
+
requirements:
|
216
|
+
- - '>='
|
217
|
+
- !ruby/object:Gem::Version
|
218
|
+
version: '0'
|
219
|
+
segments:
|
220
|
+
- 0
|
221
|
+
hash: -3563326067175133732
|
222
|
+
requirements: []
|
223
|
+
rubyforge_project:
|
224
|
+
rubygems_version: 1.8.25
|
225
|
+
signing_key:
|
226
|
+
specification_version: 3
|
227
|
+
summary: SortedArray.new { |a,b| a.foo <=> b.foo }
|
228
|
+
test_files:
|
229
|
+
- spec/default_sorter_spec.rb
|
230
|
+
- spec/sorted_array_spec.rb
|
231
|
+
- spec/spec_helper.rb
|
232
|
+
has_rdoc:
|