order 0.1.0 → 0.1.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 CHANGED
@@ -2,4 +2,5 @@
2
2
  /coverage
3
3
  /doc
4
4
  /pkg
5
- .yardoc
5
+ .yardoc
6
+ Gemfile.lock
@@ -0,0 +1,7 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - 1.9.3
5
+ - jruby
6
+ - ree
7
+ - rbx
data/Gemfile CHANGED
@@ -2,9 +2,20 @@ source :rubygems
2
2
 
3
3
  gemspec
4
4
 
5
+ platforms :jruby do
6
+ group :test do
7
+ gem 'activerecord-jdbcsqlite3-adapter', '~> 1.2.2'
8
+ end
9
+ end
10
+
11
+ platforms :ruby do
12
+ group :test do
13
+ gem 'sqlite3'
14
+ end
15
+ end
16
+
5
17
  group :test do
6
- gem 'rake'
7
- gem 'sqlite3'
8
18
  gem 'simplecov', :require => false
19
+ gem 'rake', '~> 10.0'
9
20
  gem 'rspec', '~> 2.12'
10
21
  end
@@ -1,5 +1,6 @@
1
- # Order
1
+ # Order [![Build Status](https://secure.travis-ci.org/iamvery/order.png?branch=master)](https://travis-ci.org/iamvery/order)
2
2
  Convenient ActiveRecord ordering.
3
+ https://github.com/iamvery/order
3
4
 
4
5
  ## Introduction
5
6
 
@@ -39,7 +39,8 @@ module Order
39
39
  # the +name+ is to be an alias for the ordering. You may also provide a block that defines a
40
40
  # custom ordering strategy.
41
41
  def order_scope(name, attribute = nil, &block)
42
- scope "order_by_#{name}", lambda{ |direction = nil|
42
+ scope "order_by_#{name}", lambda{ |*arguments|
43
+ direction = arguments.first
43
44
  if block_given?
44
45
  yield normalize_direction(direction)
45
46
  else
@@ -2,7 +2,7 @@ module Order
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 0
5
+ PATCH = 1
6
6
  PRE = nil
7
7
 
8
8
  def self.to_s
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: order
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-11 00:00:00.000000000 Z
12
+ date: 2012-12-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -34,8 +34,8 @@ extensions: []
34
34
  extra_rdoc_files: []
35
35
  files:
36
36
  - .gitignore
37
+ - .travis.yml
37
38
  - Gemfile
38
- - Gemfile.lock
39
39
  - LICENSE
40
40
  - README.markdown
41
41
  - Rakefile
@@ -60,7 +60,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
60
60
  version: '0'
61
61
  segments:
62
62
  - 0
63
- hash: -2075213003283050010
63
+ hash: -1189068835728440995
64
64
  required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  version: '0'
70
70
  segments:
71
71
  - 0
72
- hash: -2075213003283050010
72
+ hash: -1189068835728440995
73
73
  requirements: []
74
74
  rubyforge_project:
75
75
  rubygems_version: 1.8.24
@@ -1,50 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- order (0.1.0)
5
- activerecord (~> 3.2)
6
-
7
- GEM
8
- remote: http://rubygems.org/
9
- specs:
10
- activemodel (3.2.9)
11
- activesupport (= 3.2.9)
12
- builder (~> 3.0.0)
13
- activerecord (3.2.9)
14
- activemodel (= 3.2.9)
15
- activesupport (= 3.2.9)
16
- arel (~> 3.0.2)
17
- tzinfo (~> 0.3.29)
18
- activesupport (3.2.9)
19
- i18n (~> 0.6)
20
- multi_json (~> 1.0)
21
- arel (3.0.2)
22
- builder (3.0.4)
23
- diff-lcs (1.1.3)
24
- i18n (0.6.1)
25
- multi_json (1.5.0)
26
- rake (10.0.2)
27
- rspec (2.12.0)
28
- rspec-core (~> 2.12.0)
29
- rspec-expectations (~> 2.12.0)
30
- rspec-mocks (~> 2.12.0)
31
- rspec-core (2.12.1)
32
- rspec-expectations (2.12.0)
33
- diff-lcs (~> 1.1.3)
34
- rspec-mocks (2.12.0)
35
- simplecov (0.7.1)
36
- multi_json (~> 1.0)
37
- simplecov-html (~> 0.7.1)
38
- simplecov-html (0.7.1)
39
- sqlite3 (1.3.6)
40
- tzinfo (0.3.35)
41
-
42
- PLATFORMS
43
- ruby
44
-
45
- DEPENDENCIES
46
- order!
47
- rake
48
- rspec (~> 2.12)
49
- simplecov
50
- sqlite3