asc_desc 0.0.1
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 +4 -0
- data/.rspec +1 -0
- data/.travis.yml +4 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +4 -0
- data/LICENSE +20 -0
- data/README.md +88 -0
- data/Rakefile +5 -0
- data/asc_desc.gemspec +26 -0
- data/lib/asc_desc/model_additions.rb +60 -0
- data/lib/asc_desc/railtie.rb +9 -0
- data/lib/asc_desc/version.rb +3 -0
- data/lib/asc_desc.rb +23 -0
- data/spec/asc_desc/model_additions_spec.rb +139 -0
- data/spec/asc_desc_spec.rb +54 -0
- data/spec/spec_helper.rb +9 -0
- metadata +120 -0
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2012 David Werlen
|
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.md
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
# asc_desc [](https://secure.travis-ci.org/dwerlen/asc_desc)
|
2
|
+
|
3
|
+
This gem adds two new methods to ActiveRecord (and ActiveRecord::Relation) that allows to sort SQL queries without using
|
4
|
+
the "ASC" and "DESC" SQL keywords.
|
5
|
+
|
6
|
+
## Remark
|
7
|
+
|
8
|
+
`asc_desc` was developed in order to experiment the creation of a ruby gem.
|
9
|
+
It was conducted on the basis of the excellent tutorials from Ryan Bates, namely:
|
10
|
+
|
11
|
+
* ["#301 Extracting a Ruby Gem"](http://railscasts.com/episodes/301-extracting-a-ruby-gem)
|
12
|
+
* ["#303 Publishing a Gem"](http://railscasts.com/episodes/303-publishing-a-gem)
|
13
|
+
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
Add to your Gemfile and run the `bundle` command to install it.
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
gem 'asc_desc', git: 'git@github.com:dwerlen/asc_desc.git'
|
21
|
+
```
|
22
|
+
|
23
|
+
|
24
|
+
## Requirements
|
25
|
+
|
26
|
+
* Ruby 1.8.7 or later
|
27
|
+
* Ruby on Rails 3.0 or later
|
28
|
+
|
29
|
+
|
30
|
+
## Usage
|
31
|
+
|
32
|
+
Call `asc` on an ActiveRecord object or on an ActiveRecord::Relation object to sort the column(s) in an ascending way.
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
# using a symbol for the name of the column
|
36
|
+
Candy.where(:sugar => true).asc(:name)
|
37
|
+
|
38
|
+
# using a string for the name of the column
|
39
|
+
Candy.where(:sugar => true).asc('name')
|
40
|
+
|
41
|
+
# using multiple parameters to specify more than one column for the sort clause
|
42
|
+
Candy.where(:sugar => true).asc(:classification, :name)
|
43
|
+
|
44
|
+
# using an array to pass mutliple argument
|
45
|
+
Candy.where(:sugar => true).asc([:classification, :name])
|
46
|
+
|
47
|
+
# using a string to specify more than one column for the sort clause
|
48
|
+
Candy.where(:sugar => true).asc('classification, name')
|
49
|
+
|
50
|
+
# the method is chainable
|
51
|
+
Candy.where(:sugar => true).asc(:classification).asc(:name)
|
52
|
+
```
|
53
|
+
|
54
|
+
`ascending` and `ascending_order` are aliases of `asc`.
|
55
|
+
|
56
|
+
|
57
|
+
Call `desc` on an ActiveRecord object or on an ActiveRecord::Relation object to sort the column(s) in a descending way.
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
# using a symbol for the name of the column
|
61
|
+
Candy.where(:sugar => true).desc(:name)
|
62
|
+
|
63
|
+
# using a string for the name of the column
|
64
|
+
Candy.where(:sugar => true).desc('name')
|
65
|
+
|
66
|
+
# using multiple parameters to specify more than one column for the sort clause
|
67
|
+
Candy.where(:sugar => true).desc(:classification, :name)
|
68
|
+
|
69
|
+
# using an array to pass mutliple argument
|
70
|
+
Candy.where(:sugar => true).desc([:classification, :name])
|
71
|
+
|
72
|
+
# using a string to specify more than one column for the sort clause
|
73
|
+
Candy.where(:sugar => true).desc('classification, name')
|
74
|
+
|
75
|
+
# the method is chainable
|
76
|
+
Candy.where(:sugar => true).desc(:classification).desc(:name)
|
77
|
+
```
|
78
|
+
|
79
|
+
`descending` and `descending_order` are aliases of `desc`.
|
80
|
+
|
81
|
+
|
82
|
+
## Development
|
83
|
+
|
84
|
+
Questions or problems? Please post them on the [issue tracker](https://github.com/dwerlen/asc_desc/issues).
|
85
|
+
You can contribute changes by forking the project and submitting a pull request.
|
86
|
+
You can ensure the tests passing by running `bundle` and `rake`.
|
87
|
+
|
88
|
+
This gem is created by David Werlen and is under the MIT License.
|
data/Rakefile
ADDED
data/asc_desc.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
3
|
+
require 'asc_desc/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = 'asc_desc'
|
7
|
+
s.version = AscDesc::VERSION
|
8
|
+
s.authors = ['David Werlen']
|
9
|
+
s.email = ['werlen@icare.ch']
|
10
|
+
s.homepage = 'http://github.com/dwerlen/asc_desc'
|
11
|
+
s.summary = %q{add "asc" and "desc" methods to ActiveRecord}
|
12
|
+
s.description = %q{This gem adds two new methods to ActiveRecord (and ActiveRecord::Relation) that allow to sort SQL queries without using the "ASC" and "DESC" SQL keywords.}
|
13
|
+
|
14
|
+
s.rubyforge_project = 'asc_desc'
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ['lib']
|
20
|
+
|
21
|
+
s.add_development_dependency 'rake'
|
22
|
+
s.add_development_dependency 'rspec'
|
23
|
+
s.add_development_dependency 'with_model'
|
24
|
+
s.add_development_dependency 'activerecord', '~> 3.2.1'
|
25
|
+
s.add_development_dependency 'sqlite3', '~> 1.3.5'
|
26
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module AscDesc
|
2
|
+
module ModelAdditions
|
3
|
+
|
4
|
+
# Call <tt>asc</tt> on an ActiveRecord object or on an ActiveRecord::Relation object to sort
|
5
|
+
# the column(s) in an ascending way.
|
6
|
+
#
|
7
|
+
# using a symbol for the name of the column
|
8
|
+
# Candy.where(:sugar => true).asc(:name)
|
9
|
+
#
|
10
|
+
# using a string for the name of the column
|
11
|
+
# Candy.where(:sugar => true).asc('name')
|
12
|
+
#
|
13
|
+
# using multiple parameters to specify more than one column for the sort clause
|
14
|
+
# Candy.where(:sugar => true).asc(:classification, :name)
|
15
|
+
#
|
16
|
+
# using an array to pass mutliple argument
|
17
|
+
# Candy.where(:sugar => true).asc([:classification, :name])
|
18
|
+
#
|
19
|
+
# using a string to specify more than one column for the sort clause
|
20
|
+
# Candy.where(:sugar => true).asc('classification, name')
|
21
|
+
#
|
22
|
+
# the method is chainable
|
23
|
+
# Candy.where(:sugar => true).asc(:classification).asc(:name)
|
24
|
+
#
|
25
|
+
def asc(*args)
|
26
|
+
self.order AscDesc.format_order_clause(*args << AscDesc::ASC)
|
27
|
+
end
|
28
|
+
alias :ascending :asc
|
29
|
+
alias :ascending_order :asc
|
30
|
+
|
31
|
+
|
32
|
+
# Call <tt>desc</tt> on an ActiveRecord object or on an ActiveRecord::Relation object to sort
|
33
|
+
# the column(s) in a descending way.
|
34
|
+
#
|
35
|
+
# using a symbol for the name of the column
|
36
|
+
# Candy.where(:sugar => true).desc(:name)
|
37
|
+
#
|
38
|
+
# using a string for the name of the column
|
39
|
+
# Candy.where(:sugar => true).desc('name')
|
40
|
+
#
|
41
|
+
# using multiple parameters to specify more than one column for the sort clause
|
42
|
+
# Candy.where(:sugar => true).desc(:classification, :name)
|
43
|
+
#
|
44
|
+
# using an array to pass mutliple argument
|
45
|
+
# Candy.where(:sugar => true).desc([:classification, :name])
|
46
|
+
#
|
47
|
+
# using a string to specify more than one column for the sort clause
|
48
|
+
# Candy.where(:sugar => true).desc('classification, name')
|
49
|
+
#
|
50
|
+
# the method is chainable
|
51
|
+
# Candy.where(:sugar => true).desc(:classification).desc(:name)
|
52
|
+
#
|
53
|
+
def desc(*args)
|
54
|
+
self.order AscDesc.format_order_clause(*args << AscDesc::DESC)
|
55
|
+
end
|
56
|
+
alias :descending :desc
|
57
|
+
alias :descending_order :desc
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
data/lib/asc_desc.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'asc_desc/version'
|
2
|
+
require 'asc_desc/model_additions'
|
3
|
+
require 'asc_desc/railtie' if defined? Rails
|
4
|
+
|
5
|
+
module AscDesc
|
6
|
+
|
7
|
+
ASC = 'ASC'
|
8
|
+
DESC = 'DESC'
|
9
|
+
|
10
|
+
def self.format_order_clause(*args)
|
11
|
+
order = args.last
|
12
|
+
args[0..-2].map do |column|
|
13
|
+
if column.is_a?(Array)
|
14
|
+
format_order_clause(*column << order)
|
15
|
+
elsif column.respond_to?('include?') and column.include?(',')
|
16
|
+
format_order_clause(*column.split(',') << order)
|
17
|
+
else
|
18
|
+
"#{column.to_s.strip} #{order}"
|
19
|
+
end
|
20
|
+
end.join(', ')
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
@@ -0,0 +1,139 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe AscDesc::ModelAdditions do
|
4
|
+
|
5
|
+
with_model :Candy do
|
6
|
+
# The table block works just like a migration.
|
7
|
+
table do |t|
|
8
|
+
t.string :name
|
9
|
+
t.string :classification
|
10
|
+
t.boolean :sugar
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
# The model block works just like the class definition.
|
14
|
+
model do
|
15
|
+
extend AscDesc::ModelAdditions
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'respond to a class method named "asc"' do
|
20
|
+
Candy.respond_to?(:asc).should be_true
|
21
|
+
Candy.respond_to?(:ascending).should be_true
|
22
|
+
Candy.respond_to?(:ascending_order).should be_true
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'respond to a class method named "desc"' do
|
26
|
+
Candy.respond_to?(:desc).should be_true
|
27
|
+
Candy.respond_to?(:descending).should be_true
|
28
|
+
Candy.respond_to?(:descending_order).should be_true
|
29
|
+
end
|
30
|
+
|
31
|
+
describe '.asc' do
|
32
|
+
|
33
|
+
it 'should return an ActiveRecord Relation' do
|
34
|
+
candies = Candy.asc(:name)
|
35
|
+
candies.should be_an_instance_of(ActiveRecord::Relation)
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'can format a symbol for the name of the column' do
|
39
|
+
candies = Candy.asc(:name)
|
40
|
+
candies.to_sql.should be_end_with('ORDER BY name ASC')
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'can format a string for the name of the column' do
|
44
|
+
candies = Candy.asc('name')
|
45
|
+
candies.to_sql.should be_end_with('ORDER BY name ASC')
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'can format multiple parameters to specify more than one column for the sort clause' do
|
49
|
+
candies = Candy.asc(:classification, :name)
|
50
|
+
candies.to_sql.should be_end_with('ORDER BY classification ASC, name ASC')
|
51
|
+
|
52
|
+
candies = Candy.asc('classification', 'name')
|
53
|
+
candies.to_sql.should be_end_with('ORDER BY classification ASC, name ASC')
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'can format an array as mutliple argument' do
|
57
|
+
candies = Candy.asc([:classification, :name])
|
58
|
+
candies.to_sql.should be_end_with('ORDER BY classification ASC, name ASC')
|
59
|
+
candies = Candy.asc([:classification, :name], :sugar)
|
60
|
+
candies.to_sql.should be_end_with('ORDER BY classification ASC, name ASC, sugar ASC')
|
61
|
+
|
62
|
+
candies = Candy.asc(['classification', 'name'])
|
63
|
+
candies.to_sql.should be_end_with('ORDER BY classification ASC, name ASC')
|
64
|
+
candies = Candy.asc(['classification', 'name'], 'sugar')
|
65
|
+
candies.to_sql.should be_end_with('ORDER BY classification ASC, name ASC, sugar ASC')
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'can format a string to specify more than one column for the sort clause' do
|
69
|
+
candies = Candy.asc('classification, name', :sugar)
|
70
|
+
candies.to_sql.should be_end_with('ORDER BY classification ASC, name ASC, sugar ASC')
|
71
|
+
|
72
|
+
candies = Candy.asc(['classification, name', :sugar])
|
73
|
+
candies.to_sql.should be_end_with('ORDER BY classification ASC, name ASC, sugar ASC')
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'should be chainable' do
|
77
|
+
candies = Candy.asc(:name)
|
78
|
+
candies = candies.asc(:sugar)
|
79
|
+
candies.should be_an_instance_of(ActiveRecord::Relation)
|
80
|
+
candies.to_sql.should be_end_with('ORDER BY name ASC, sugar ASC')
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
describe '.desc' do
|
86
|
+
|
87
|
+
it 'should return an ActiveRecord Relation' do
|
88
|
+
candies = Candy.desc(:name)
|
89
|
+
candies.should be_an_instance_of(ActiveRecord::Relation)
|
90
|
+
end
|
91
|
+
|
92
|
+
it 'can format a symbol for the name of the column' do
|
93
|
+
candies = Candy.desc(:name)
|
94
|
+
candies.to_sql.should be_end_with('ORDER BY name DESC')
|
95
|
+
end
|
96
|
+
|
97
|
+
it 'can format a string for the name of the column' do
|
98
|
+
candies = Candy.desc('name')
|
99
|
+
candies.to_sql.should be_end_with('ORDER BY name DESC')
|
100
|
+
end
|
101
|
+
|
102
|
+
it 'can format multiple parameters to specify more than one column for the sort clause' do
|
103
|
+
candies = Candy.desc(:classification, :name)
|
104
|
+
candies.to_sql.should be_end_with('ORDER BY classification DESC, name DESC')
|
105
|
+
|
106
|
+
candies = Candy.desc('classification', 'name')
|
107
|
+
candies.to_sql.should be_end_with('ORDER BY classification DESC, name DESC')
|
108
|
+
end
|
109
|
+
|
110
|
+
it 'can format an array as mutliple argument' do
|
111
|
+
candies = Candy.desc([:classification, :name])
|
112
|
+
candies.to_sql.should be_end_with('ORDER BY classification DESC, name DESC')
|
113
|
+
candies = Candy.desc([:classification, :name], :sugar)
|
114
|
+
candies.to_sql.should be_end_with('ORDER BY classification DESC, name DESC, sugar DESC')
|
115
|
+
|
116
|
+
candies = Candy.desc(['classification', 'name'])
|
117
|
+
candies.to_sql.should be_end_with('ORDER BY classification DESC, name DESC')
|
118
|
+
candies = Candy.desc(['classification', 'name'], 'sugar')
|
119
|
+
candies.to_sql.should be_end_with('ORDER BY classification DESC, name DESC, sugar DESC')
|
120
|
+
end
|
121
|
+
|
122
|
+
it 'can format a string to specify more than one column for the sort clause' do
|
123
|
+
candies = Candy.desc('classification, name', :sugar)
|
124
|
+
candies.to_sql.should be_end_with('ORDER BY classification DESC, name DESC, sugar DESC')
|
125
|
+
|
126
|
+
candies = Candy.desc(['classification, name', :sugar])
|
127
|
+
candies.to_sql.should be_end_with('ORDER BY classification DESC, name DESC, sugar DESC')
|
128
|
+
end
|
129
|
+
|
130
|
+
it 'should be chainable' do
|
131
|
+
candies = Candy.desc(:name)
|
132
|
+
candies = candies.desc(:sugar)
|
133
|
+
candies.should be_an_instance_of(ActiveRecord::Relation)
|
134
|
+
candies.to_sql.should be_end_with('ORDER BY name DESC, sugar DESC')
|
135
|
+
end
|
136
|
+
|
137
|
+
end
|
138
|
+
|
139
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe AscDesc do
|
4
|
+
|
5
|
+
it 'has a constant for the ASC SQL keyword' do
|
6
|
+
AscDesc.const_defined?(:ASC).should be_true
|
7
|
+
AscDesc.const_get(:ASC).should eq('ASC')
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'has a constant for the DESC SQL keyword' do
|
11
|
+
AscDesc.const_defined?(:DESC).should be_true
|
12
|
+
AscDesc.const_get(:DESC).should eq('DESC')
|
13
|
+
end
|
14
|
+
|
15
|
+
describe '.format_order_clause' do
|
16
|
+
|
17
|
+
it 'respond to a class method named "format_order_clause"' do
|
18
|
+
AscDesc.respond_to?(:format_order_clause)
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'can format a symbol for the name of the column' do
|
22
|
+
AscDesc.format_order_clause(:name, AscDesc::ASC).should eq('name ASC')
|
23
|
+
AscDesc.format_order_clause(:name, AscDesc::DESC).should eq('name DESC')
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'can format a string for the name of the column' do
|
27
|
+
AscDesc.format_order_clause('name', AscDesc::ASC).should eq('name ASC')
|
28
|
+
AscDesc.format_order_clause('name', AscDesc::DESC).should eq('name DESC')
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'can format multiple parameters to specify more than one column for the sort clause' do
|
32
|
+
AscDesc.format_order_clause(:classification, :name, AscDesc::ASC).should eq('classification ASC, name ASC')
|
33
|
+
AscDesc.format_order_clause(:classification, :name, AscDesc::DESC).should eq('classification DESC, name DESC')
|
34
|
+
AscDesc.format_order_clause('classification', 'name', AscDesc::ASC).should eq('classification ASC, name ASC')
|
35
|
+
AscDesc.format_order_clause('classification', 'name', AscDesc::DESC).should eq('classification DESC, name DESC')
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'can format an array as mutliple argument' do
|
39
|
+
AscDesc.format_order_clause([:classification, :name], AscDesc::ASC).should eq('classification ASC, name ASC')
|
40
|
+
AscDesc.format_order_clause([:classification, :name], AscDesc::DESC).should eq('classification DESC, name DESC')
|
41
|
+
AscDesc.format_order_clause([:classification, :name], :sugar, AscDesc::DESC).should eq('classification DESC, name DESC, sugar DESC')
|
42
|
+
AscDesc.format_order_clause(['classification', 'name'], AscDesc::ASC).should eq('classification ASC, name ASC')
|
43
|
+
AscDesc.format_order_clause(['classification', 'name'], AscDesc::DESC).should eq('classification DESC, name DESC')
|
44
|
+
AscDesc.format_order_clause(['classification', 'name'], 'sugar', AscDesc::DESC).should eq('classification DESC, name DESC, sugar DESC')
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'can formata string to specify more than one column for the sort clause' do
|
48
|
+
AscDesc.format_order_clause('classification, name', :sugar, AscDesc::ASC).should eq('classification ASC, name ASC, sugar ASC')
|
49
|
+
AscDesc.format_order_clause(['classification, name', :sugar], AscDesc::ASC).should eq('classification ASC, name ASC, sugar ASC')
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: asc_desc
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- David Werlen
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-02-20 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: &70196428113380 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70196428113380
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rspec
|
27
|
+
requirement: &70196428112960 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70196428112960
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: with_model
|
38
|
+
requirement: &70196428112540 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70196428112540
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: activerecord
|
49
|
+
requirement: &70196428112040 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 3.2.1
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70196428112040
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: sqlite3
|
60
|
+
requirement: &70196428111540 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ~>
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 1.3.5
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *70196428111540
|
69
|
+
description: This gem adds two new methods to ActiveRecord (and ActiveRecord::Relation)
|
70
|
+
that allow to sort SQL queries without using the "ASC" and "DESC" SQL keywords.
|
71
|
+
email:
|
72
|
+
- werlen@icare.ch
|
73
|
+
executables: []
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- .gitignore
|
78
|
+
- .rspec
|
79
|
+
- .travis.yml
|
80
|
+
- CHANGELOG.md
|
81
|
+
- Gemfile
|
82
|
+
- LICENSE
|
83
|
+
- README.md
|
84
|
+
- Rakefile
|
85
|
+
- asc_desc.gemspec
|
86
|
+
- lib/asc_desc.rb
|
87
|
+
- lib/asc_desc/model_additions.rb
|
88
|
+
- lib/asc_desc/railtie.rb
|
89
|
+
- lib/asc_desc/version.rb
|
90
|
+
- spec/asc_desc/model_additions_spec.rb
|
91
|
+
- spec/asc_desc_spec.rb
|
92
|
+
- spec/spec_helper.rb
|
93
|
+
homepage: http://github.com/dwerlen/asc_desc
|
94
|
+
licenses: []
|
95
|
+
post_install_message:
|
96
|
+
rdoc_options: []
|
97
|
+
require_paths:
|
98
|
+
- lib
|
99
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
101
|
+
requirements:
|
102
|
+
- - ! '>='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
requirements: []
|
112
|
+
rubyforge_project: asc_desc
|
113
|
+
rubygems_version: 1.8.6
|
114
|
+
signing_key:
|
115
|
+
specification_version: 3
|
116
|
+
summary: add "asc" and "desc" methods to ActiveRecord
|
117
|
+
test_files:
|
118
|
+
- spec/asc_desc/model_additions_spec.rb
|
119
|
+
- spec/asc_desc_spec.rb
|
120
|
+
- spec/spec_helper.rb
|