resort 0.2.3 → 0.3.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.
- data/.gitignore +1 -0
- data/.rvmrc +1 -1
- data/.travis.yml +8 -0
- data/Gemfile +9 -0
- data/Readme.md +93 -15
- data/lib/resort.rb +15 -11
- data/lib/resort/version.rb +1 -1
- data/resort.gemspec +2 -1
- data/spec/resort_spec.rb +39 -28
- data/spec/spec_helper.rb +11 -5
- metadata +69 -73
data/.gitignore
CHANGED
data/.rvmrc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rvm --create use ruby-1.9.
|
1
|
+
rvm --create use ruby-1.9.3-p0@resort
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
@@ -1,3 +1,12 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
3
|
gemspec
|
4
|
+
|
5
|
+
#group :development, :test do
|
6
|
+
# # For debugging under ruby 1.9 special gems are needed
|
7
|
+
# gem 'ruby-debug19', :platform => :mri
|
8
|
+
# # See http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug
|
9
|
+
# gem 'ruby-debug-base19', '>=0.11.26'
|
10
|
+
# gem 'linecache19', '>=0.5.13'
|
11
|
+
#end
|
12
|
+
|
data/Readme.md
CHANGED
@@ -8,7 +8,9 @@ Resort provides sorting capabilities to your Rails 3 models.
|
|
8
8
|
|
9
9
|
Or in your Gemfile:
|
10
10
|
|
11
|
-
|
11
|
+
```ruby
|
12
|
+
gem 'resort'
|
13
|
+
```
|
12
14
|
|
13
15
|
##Rationale
|
14
16
|
|
@@ -30,44 +32,120 @@ First, run the migration for the model you want to Resort:
|
|
30
32
|
|
31
33
|
Then in your Product model:
|
32
34
|
|
33
|
-
|
34
|
-
|
35
|
-
|
35
|
+
```ruby
|
36
|
+
class Product < ActiveRecord::Base
|
37
|
+
resort!
|
38
|
+
end
|
39
|
+
```
|
36
40
|
|
37
41
|
**NOTE**: By default, Resort will treat _all products_ as a single big tree.
|
38
42
|
If you wanted to limit the tree scope, i.e. treating every ProductLine as a
|
39
43
|
separate tree of sortable products, you must override the `siblings` method:
|
40
44
|
|
41
|
-
|
42
|
-
|
45
|
+
```ruby
|
46
|
+
class Product < ActiveRecord::Base
|
47
|
+
resort!
|
43
48
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
+
def siblings
|
50
|
+
# Tree contains only products from my own product line
|
51
|
+
self.product_line.products
|
52
|
+
end
|
53
|
+
end
|
54
|
+
```
|
49
55
|
|
50
56
|
### Concurrency
|
51
57
|
|
52
58
|
Multiple users modifying the same list at the same time could be a problem,
|
53
59
|
so it's always a good practice to wrap the changes in a transaction:
|
54
60
|
|
55
|
-
|
56
|
-
|
57
|
-
|
61
|
+
```ruby
|
62
|
+
Product.transaction do
|
63
|
+
my_product.append_to(another_product)
|
64
|
+
end
|
65
|
+
```
|
58
66
|
|
59
67
|
###API
|
60
68
|
|
61
|
-
Every time a product is created, it will be appended after the last element
|
69
|
+
**Every time a product is created, it will be appended after the last element.**
|
62
70
|
|
63
71
|
Moreover, now a `product` responds to the following methods:
|
64
72
|
|
65
73
|
* `first?` — Returns true if the element is the first of the tree.
|
66
74
|
* `append_to(other_element)` — Appends the element _after_ another element.
|
75
|
+
* `next` — Returns the next element in the list
|
76
|
+
* `previous` — Returns the previous element in the list
|
67
77
|
|
68
78
|
And the class Product has a new scope named `ordered` that returns the
|
69
79
|
products in order.
|
70
80
|
|
81
|
+
### Examples
|
82
|
+
|
83
|
+
Given our `Product` example defined before, we can do things like:
|
84
|
+
|
85
|
+
Getting products in order:
|
86
|
+
|
87
|
+
```ruby
|
88
|
+
Product.first_in_order # returns the first ordered product.
|
89
|
+
Product.last_in_order # returns the last ordered product.
|
90
|
+
Product.ordered # returns all products ordered as an Array, not a Relation!
|
91
|
+
```
|
92
|
+
|
93
|
+
Find ordered products with scopes or conditions:
|
94
|
+
|
95
|
+
```ruby
|
96
|
+
Product.where('price > 10').ordered # => Ordered array of products with price > 10
|
97
|
+
Product.with_custom_scope.ordered # => Ordered array of products with your custom conditions
|
98
|
+
```
|
99
|
+
|
100
|
+
Modify the list of products:
|
101
|
+
|
102
|
+
```ruby
|
103
|
+
product = Product.create(:name => 'Bread')
|
104
|
+
product.first? # => true
|
105
|
+
|
106
|
+
another_product = Product.create(:name => 'Milk')
|
107
|
+
yet_another_product = Product.create(:name => 'Salami')
|
108
|
+
|
109
|
+
yet_another_product.append_to(product) # puts the products right after the first one
|
110
|
+
|
111
|
+
Product.ordered.map(&:name) # => ['Bread', 'Salami', 'Milk']
|
112
|
+
```
|
113
|
+
|
114
|
+
Check neighbours:
|
115
|
+
|
116
|
+
```ruby
|
117
|
+
product = Product.create(:name => 'Bread')
|
118
|
+
second_product = Product.create(:name => 'Milk')
|
119
|
+
third_product = Product.create(:name => 'Salami')
|
120
|
+
|
121
|
+
second_product.previous.name # => 'Bread'
|
122
|
+
second_product.next.name # => 'Salami'
|
123
|
+
|
124
|
+
third_product.next # => nil
|
125
|
+
```
|
126
|
+
|
127
|
+
Maybe you need different orders depending on the product vendor:
|
128
|
+
|
129
|
+
```ruby
|
130
|
+
class Product < ActiveRecord::Base
|
131
|
+
resort!
|
132
|
+
|
133
|
+
belongs_to :vendor
|
134
|
+
|
135
|
+
def siblings
|
136
|
+
self.vendor.products
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
bread = Product.create(:name => 'Bread', :vendor => Vendor.where(:name => 'Bread factory'))
|
141
|
+
bread.first? # => true
|
142
|
+
|
143
|
+
milk = Product.create(:name => 'Milk', :vendor => Vendor.where(:name => 'Cow world'))
|
144
|
+
milk.first? # => true
|
145
|
+
|
146
|
+
# bread and milk aren't neighbours
|
147
|
+
```
|
148
|
+
|
71
149
|
##Under the hood
|
72
150
|
|
73
151
|
Run the test suite by typing:
|
data/lib/resort.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'generators/active_record/resort_generator' if defined?(Rails)
|
2
|
+
require 'active_record' unless defined?(ActiveRecord)
|
2
3
|
|
3
4
|
# # Resort
|
4
5
|
#
|
@@ -155,10 +156,10 @@ module Resort
|
|
155
156
|
if _siblings.count > 0
|
156
157
|
delete_from_list
|
157
158
|
old_first = _siblings.first_in_order
|
158
|
-
self.update_attribute(:next_id, old_first.id)
|
159
|
-
old_first.update_attribute(:first, false)
|
159
|
+
raise(ActiveRecord::RecordNotSaved) unless self.update_attribute(:next_id, old_first.id)
|
160
|
+
raise(ActiveRecord::RecordNotSaved) unless old_first.update_attribute(:first, false)
|
160
161
|
end
|
161
|
-
self.update_attribute(:first, true)
|
162
|
+
raise(ActiveRecord::RecordNotSaved) unless self.update_attribute(:first, true)
|
162
163
|
end
|
163
164
|
end
|
164
165
|
|
@@ -177,8 +178,12 @@ module Resort
|
|
177
178
|
return if another.next_id == id
|
178
179
|
another.lock!
|
179
180
|
delete_from_list
|
180
|
-
|
181
|
-
|
181
|
+
if self.next_id or (another && another.next_id)
|
182
|
+
raise(ActiveRecord::RecordNotSaved) unless self.update_attribute(:next_id, another.next_id)
|
183
|
+
end
|
184
|
+
if another
|
185
|
+
raise(ActiveRecord::RecordNotSaved) unless another.update_attribute(:next_id, self.id)
|
186
|
+
end
|
182
187
|
end
|
183
188
|
end
|
184
189
|
|
@@ -187,16 +192,16 @@ module Resort
|
|
187
192
|
def delete_from_list
|
188
193
|
if first? && self.next
|
189
194
|
self.next.lock!
|
190
|
-
self.next.update_attribute(:first, true)
|
195
|
+
raise(ActiveRecord::RecordNotSaved) unless self.next.update_attribute(:first, true)
|
191
196
|
elsif self.previous
|
192
197
|
self.previous.lock!
|
193
|
-
self.previous
|
198
|
+
p = self.previous
|
199
|
+
self.previous = nil unless frozen?
|
200
|
+
raise(ActiveRecord::RecordNotSaved) unless p.update_attribute(:next_id, self.next_id)
|
194
201
|
end
|
195
|
-
|
196
202
|
unless frozen?
|
197
203
|
self.first = false
|
198
204
|
self.next = nil
|
199
|
-
self.previous = nil
|
200
205
|
save!
|
201
206
|
end
|
202
207
|
end
|
@@ -208,7 +213,7 @@ module Resort
|
|
208
213
|
def last!
|
209
214
|
self.class.transaction do
|
210
215
|
self.lock!
|
211
|
-
_siblings.last_in_order.update_attribute(:next_id, self.id)
|
216
|
+
raise(ActiveRecord::RecordNotSaved) unless _siblings.last_in_order.update_attribute(:next_id, self.id)
|
212
217
|
end
|
213
218
|
end
|
214
219
|
|
@@ -229,5 +234,4 @@ module Resort
|
|
229
234
|
end
|
230
235
|
end
|
231
236
|
|
232
|
-
require 'active_record' unless defined?(ActiveRecord)
|
233
237
|
ActiveRecord::Base.extend Resort::ClassMethods
|
data/lib/resort/version.rb
CHANGED
data/resort.gemspec
CHANGED
@@ -14,7 +14,8 @@ Gem::Specification.new do |s|
|
|
14
14
|
|
15
15
|
s.rubyforge_project = "resort"
|
16
16
|
|
17
|
-
s.add_runtime_dependency 'activerecord', '
|
17
|
+
s.add_runtime_dependency 'activerecord', '>= 3.0.5', '< 3.2'
|
18
|
+
# s.add_runtime_dependency 'activerecord', '~> 3.0.5'
|
18
19
|
s.add_development_dependency 'sqlite3'
|
19
20
|
s.add_development_dependency 'rspec', '~> 2.5.0'
|
20
21
|
s.add_development_dependency 'yard'
|
data/spec/resort_spec.rb
CHANGED
@@ -17,7 +17,7 @@ module Resort
|
|
17
17
|
(class << subject.class; self; end).ancestors.should include(Sortable::ClassMethods)
|
18
18
|
end
|
19
19
|
it 'defines a siblings method' do
|
20
|
-
subject.
|
20
|
+
subject.should respond_to(:siblings)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -67,8 +67,8 @@ module Resort
|
|
67
67
|
|
68
68
|
describe "siblings" do
|
69
69
|
before do
|
70
|
-
one_list =
|
71
|
-
another_list =
|
70
|
+
one_list = OrderedList.create(:name => 'My list')
|
71
|
+
another_list = OrderedList.create(:name => 'My other list')
|
72
72
|
|
73
73
|
4.times do |i|
|
74
74
|
one_list.items << ListItem.new(:name => "My list item #{i}")
|
@@ -79,22 +79,22 @@ module Resort
|
|
79
79
|
|
80
80
|
describe "#first_in_order" do
|
81
81
|
it 'returns the first element of the list' do
|
82
|
-
|
83
|
-
|
82
|
+
OrderedList.find_by_name('My list').items.first_in_order.name.should == "My list item 0"
|
83
|
+
OrderedList.find_by_name('My other list').items.first_in_order.name.should == "My other list item 0"
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
87
|
describe "#last_in_order" do
|
88
88
|
it 'returns the last element of the list' do
|
89
|
-
|
90
|
-
|
89
|
+
OrderedList.find_by_name('My list').items.last_in_order.name.should == "My list item 3"
|
90
|
+
OrderedList.find_by_name('My other list').items.last_in_order.name.should == "My other list item 3"
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
94
94
|
describe "#ordered" do
|
95
95
|
it 'returns all elements ordered' do
|
96
|
-
|
97
|
-
|
96
|
+
OrderedList.find_by_name('My list').items.ordered.map(&:name).should == ['My list item 0', 'My list item 1', 'My list item 2', 'My list item 3']
|
97
|
+
OrderedList.find_by_name('My other list').items.ordered.map(&:name).should == ['My other list item 0', 'My other list item 1', 'My other list item 2', 'My other list item 3']
|
98
98
|
end
|
99
99
|
|
100
100
|
it 'raises when ordering without scope' do
|
@@ -105,7 +105,7 @@ module Resort
|
|
105
105
|
end
|
106
106
|
|
107
107
|
after do
|
108
|
-
|
108
|
+
OrderedList.destroy_all
|
109
109
|
ListItem.destroy_all
|
110
110
|
end
|
111
111
|
end
|
@@ -143,9 +143,9 @@ module Resort
|
|
143
143
|
|
144
144
|
context 'when there are no siblings' do
|
145
145
|
it 'prepends the element' do
|
146
|
-
one_list =
|
147
|
-
another_list =
|
148
|
-
item = ListItem.create(:name => "My list item", :
|
146
|
+
one_list = OrderedList.create(:name => 'My list')
|
147
|
+
another_list = OrderedList.create(:name => 'My other list')
|
148
|
+
item = ListItem.create(:name => "My list item", :ordered_list => one_list)
|
149
149
|
|
150
150
|
item.should be_first
|
151
151
|
item.next.should be_nil
|
@@ -154,10 +154,10 @@ module Resort
|
|
154
154
|
end
|
155
155
|
context 'otherwise' do
|
156
156
|
it 'appends the element' do
|
157
|
-
one_list =
|
158
|
-
another_list =
|
159
|
-
ListItem.create(:name => "1", :
|
160
|
-
ListItem.create(:name => "last!", :
|
157
|
+
one_list = OrderedList.create(:name => 'My list')
|
158
|
+
another_list = OrderedList.create(:name => 'My other list')
|
159
|
+
ListItem.create(:name => "1", :ordered_list => one_list)
|
160
|
+
ListItem.create(:name => "last!", :ordered_list => one_list)
|
161
161
|
|
162
162
|
first = ListItem.find_by_name('1')
|
163
163
|
last = ListItem.find_by_name('last!')
|
@@ -170,15 +170,15 @@ module Resort
|
|
170
170
|
end
|
171
171
|
|
172
172
|
it 'prepends the last element' do
|
173
|
-
one_list =
|
174
|
-
ListItem.create(:name => "First", :
|
175
|
-
ListItem.create(:name => "Second", :
|
176
|
-
third = ListItem.create(:name => "Third", :
|
173
|
+
one_list = OrderedList.create(:name => 'My list')
|
174
|
+
ListItem.create(:name => "First", :ordered_list => one_list)
|
175
|
+
ListItem.create(:name => "Second", :ordered_list => one_list)
|
176
|
+
third = ListItem.create(:name => "Third", :ordered_list => one_list)
|
177
177
|
|
178
178
|
third.prepend
|
179
|
-
first = ListItem.where(:name => "First", :
|
180
|
-
second = ListItem.where(:name => "Second", :
|
181
|
-
third = ListItem.where(:name => "Third", :
|
179
|
+
first = ListItem.where(:name => "First", :ordered_list_id => one_list).first
|
180
|
+
second = ListItem.where(:name => "Second", :ordered_list_id => one_list).first
|
181
|
+
third = ListItem.where(:name => "Third", :ordered_list_id => one_list).first
|
182
182
|
|
183
183
|
first.should_not be_first
|
184
184
|
second.should_not be_first
|
@@ -187,9 +187,10 @@ module Resort
|
|
187
187
|
first.next.name.should == 'Second'
|
188
188
|
second.next.should be_nil
|
189
189
|
end
|
190
|
+
|
190
191
|
end
|
191
192
|
after do
|
192
|
-
|
193
|
+
OrderedList.destroy_all
|
193
194
|
ListItem.destroy_all
|
194
195
|
end
|
195
196
|
end
|
@@ -259,7 +260,7 @@ module Resort
|
|
259
260
|
@article3 = Article.find_by_name('3')
|
260
261
|
@article4 = Article.find_by_name('4')
|
261
262
|
end
|
262
|
-
|
263
|
+
|
263
264
|
describe "#push" do
|
264
265
|
it "appends the element to the list" do
|
265
266
|
@article1.push
|
@@ -299,6 +300,11 @@ module Resort
|
|
299
300
|
article4.next.name.should == '1'
|
300
301
|
end
|
301
302
|
|
303
|
+
it 'will raise ActiveRecord::RecordNotSaved if update fails' do
|
304
|
+
@article2.should_receive(:update_attribute).and_return(false)
|
305
|
+
expect { @article2.prepend }.to raise_error(ActiveRecord::RecordNotSaved)
|
306
|
+
end
|
307
|
+
|
302
308
|
context 'when the article is already first' do
|
303
309
|
it 'does nothing' do
|
304
310
|
@article1.prepend
|
@@ -310,6 +316,11 @@ module Resort
|
|
310
316
|
end
|
311
317
|
|
312
318
|
describe "#append_to" do
|
319
|
+
it 'will raise ActiveRecord::RecordNotSaved if update fails' do
|
320
|
+
@article2.should_receive(:update_attribute).and_return(false)
|
321
|
+
expect { @article2.append_to(@article3) }.to raise_error(ActiveRecord::RecordNotSaved)
|
322
|
+
end
|
323
|
+
|
313
324
|
context 'appending 1 after 2' do
|
314
325
|
it "appends the element after another element" do
|
315
326
|
@article1.append_to(@article2)
|
@@ -357,7 +368,7 @@ module Resort
|
|
357
368
|
|
358
369
|
article1 = Article.find_by_name('1')
|
359
370
|
article1.next.name.should == '3'
|
360
|
-
|
371
|
+
|
361
372
|
article2 = Article.find_by_name('2')
|
362
373
|
article2.previous.name.should == '3'
|
363
374
|
article2.next.name.should == '4'
|
@@ -405,7 +416,7 @@ module Resort
|
|
405
416
|
|
406
417
|
article1 = Article.find_by_name('1')
|
407
418
|
article1.next.name.should == '3'
|
408
|
-
|
419
|
+
|
409
420
|
article2 = Article.find_by_name('2')
|
410
421
|
article2.previous.name.should == '3'
|
411
422
|
article2.next.name.should == '4'
|
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
require 'rspec'
|
2
2
|
|
3
3
|
module Rails
|
4
|
+
class << self
|
5
|
+
# 3.0 defaults this, 3.1 does not
|
6
|
+
def application
|
7
|
+
"application"
|
8
|
+
end
|
9
|
+
end
|
4
10
|
end
|
5
11
|
|
6
12
|
require 'resort'
|
@@ -22,7 +28,7 @@ ActiveRecord::Schema.define do
|
|
22
28
|
t.timestamps
|
23
29
|
end
|
24
30
|
|
25
|
-
create_table :
|
31
|
+
create_table :ordered_lists do |t|
|
26
32
|
t.string :name
|
27
33
|
t.timestamps
|
28
34
|
end
|
@@ -31,7 +37,7 @@ ActiveRecord::Schema.define do
|
|
31
37
|
t.string :name
|
32
38
|
t.boolean :first
|
33
39
|
t.references :next
|
34
|
-
t.references :
|
40
|
+
t.references :ordered_list
|
35
41
|
t.timestamps
|
36
42
|
end
|
37
43
|
end
|
@@ -42,17 +48,17 @@ class Article < ActiveRecord::Base
|
|
42
48
|
resort!
|
43
49
|
end
|
44
50
|
|
45
|
-
class
|
51
|
+
class OrderedList < ActiveRecord::Base
|
46
52
|
has_many :items, :class_name => 'ListItem'
|
47
53
|
end
|
48
54
|
|
49
55
|
class ListItem < ActiveRecord::Base
|
50
|
-
belongs_to :
|
56
|
+
belongs_to :ordered_list
|
51
57
|
resort!
|
52
58
|
|
53
59
|
default_scope :order => 'created_at desc'
|
54
60
|
|
55
61
|
def siblings
|
56
|
-
self.
|
62
|
+
self.ordered_list.items
|
57
63
|
end
|
58
64
|
end
|
metadata
CHANGED
@@ -1,99 +1,98 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: resort
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.0
|
4
5
|
prerelease:
|
5
|
-
version: 0.2.3
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Oriol Gual
|
9
9
|
- Josep M. Bach
|
10
10
|
- Josep Jaume Rey
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
dependencies:
|
18
|
-
- !ruby/object:Gem::Dependency
|
14
|
+
date: 2012-02-18 00:00:00.000000000Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
19
17
|
name: activerecord
|
20
|
-
|
21
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
18
|
+
requirement: &70302327492940 !ruby/object:Gem::Requirement
|
22
19
|
none: false
|
23
|
-
requirements:
|
24
|
-
- -
|
25
|
-
- !ruby/object:Gem::Version
|
20
|
+
requirements:
|
21
|
+
- - ! '>='
|
22
|
+
- !ruby/object:Gem::Version
|
26
23
|
version: 3.0.5
|
24
|
+
- - <
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.2'
|
27
27
|
type: :runtime
|
28
|
-
version_requirements: *id001
|
29
|
-
- !ruby/object:Gem::Dependency
|
30
|
-
name: sqlite3
|
31
28
|
prerelease: false
|
32
|
-
|
29
|
+
version_requirements: *70302327492940
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: sqlite3
|
32
|
+
requirement: &70302327491540 !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
|
-
requirements:
|
35
|
-
- -
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version:
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
38
|
type: :development
|
39
|
-
version_requirements: *id002
|
40
|
-
- !ruby/object:Gem::Dependency
|
41
|
-
name: rspec
|
42
39
|
prerelease: false
|
43
|
-
|
40
|
+
version_requirements: *70302327491540
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: &70302327490080 !ruby/object:Gem::Requirement
|
44
44
|
none: false
|
45
|
-
requirements:
|
45
|
+
requirements:
|
46
46
|
- - ~>
|
47
|
-
- !ruby/object:Gem::Version
|
47
|
+
- !ruby/object:Gem::Version
|
48
48
|
version: 2.5.0
|
49
49
|
type: :development
|
50
|
-
version_requirements: *id003
|
51
|
-
- !ruby/object:Gem::Dependency
|
52
|
-
name: yard
|
53
50
|
prerelease: false
|
54
|
-
|
51
|
+
version_requirements: *70302327490080
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: yard
|
54
|
+
requirement: &70302327489380 !ruby/object:Gem::Requirement
|
55
55
|
none: false
|
56
|
-
requirements:
|
57
|
-
- -
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version:
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
60
|
type: :development
|
61
|
-
version_requirements: *id004
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: bluecloth
|
64
61
|
prerelease: false
|
65
|
-
|
62
|
+
version_requirements: *70302327489380
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: bluecloth
|
65
|
+
requirement: &70302327488200 !ruby/object:Gem::Requirement
|
66
66
|
none: false
|
67
|
-
requirements:
|
68
|
-
- -
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
version:
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
71
|
type: :development
|
72
|
-
version_requirements: *id005
|
73
|
-
- !ruby/object:Gem::Dependency
|
74
|
-
name: generator_spec
|
75
72
|
prerelease: false
|
76
|
-
|
73
|
+
version_requirements: *70302327488200
|
74
|
+
- !ruby/object:Gem::Dependency
|
75
|
+
name: generator_spec
|
76
|
+
requirement: &70302327487300 !ruby/object:Gem::Requirement
|
77
77
|
none: false
|
78
|
-
requirements:
|
78
|
+
requirements:
|
79
79
|
- - ~>
|
80
|
-
- !ruby/object:Gem::Version
|
80
|
+
- !ruby/object:Gem::Version
|
81
81
|
version: 0.8.1
|
82
82
|
type: :development
|
83
|
-
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: *70302327487300
|
84
85
|
description: Positionless model sorting for Rails 3.
|
85
|
-
email:
|
86
|
+
email:
|
86
87
|
- info@codegram.com
|
87
88
|
executables: []
|
88
|
-
|
89
89
|
extensions: []
|
90
|
-
|
91
90
|
extra_rdoc_files: []
|
92
|
-
|
93
|
-
files:
|
91
|
+
files:
|
94
92
|
- .gitignore
|
95
93
|
- .rspec
|
96
94
|
- .rvmrc
|
95
|
+
- .travis.yml
|
97
96
|
- Gemfile
|
98
97
|
- LICENSE
|
99
98
|
- Rakefile
|
@@ -106,35 +105,32 @@ files:
|
|
106
105
|
- spec/generators/migration_spec.rb
|
107
106
|
- spec/resort_spec.rb
|
108
107
|
- spec/spec_helper.rb
|
109
|
-
has_rdoc: true
|
110
108
|
homepage: http://codegram.github.com/resort
|
111
109
|
licenses: []
|
112
|
-
|
113
110
|
post_install_message:
|
114
111
|
rdoc_options: []
|
115
|
-
|
116
|
-
require_paths:
|
112
|
+
require_paths:
|
117
113
|
- lib
|
118
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
119
115
|
none: false
|
120
|
-
requirements:
|
121
|
-
- -
|
122
|
-
- !ruby/object:Gem::Version
|
123
|
-
version:
|
124
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ! '>='
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
121
|
none: false
|
126
|
-
requirements:
|
127
|
-
- -
|
128
|
-
- !ruby/object:Gem::Version
|
129
|
-
version:
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
130
126
|
requirements: []
|
131
|
-
|
132
127
|
rubyforge_project: resort
|
133
|
-
rubygems_version: 1.
|
128
|
+
rubygems_version: 1.8.10
|
134
129
|
signing_key:
|
135
130
|
specification_version: 3
|
136
131
|
summary: Positionless model sorting for Rails 3.
|
137
|
-
test_files:
|
132
|
+
test_files:
|
138
133
|
- spec/generators/migration_spec.rb
|
139
134
|
- spec/resort_spec.rb
|
140
135
|
- spec/spec_helper.rb
|
136
|
+
has_rdoc:
|