groupy 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/groupy.rb +1 -1
- data/test/groupy_test.rb +9 -1
- data/test/with_database_test.rb +2 -2
- metadata +4 -4
data/Rakefile
CHANGED
@@ -33,7 +33,7 @@ spec = Gem::Specification.new do |s|
|
|
33
33
|
|
34
34
|
# Change these as appropriate
|
35
35
|
s.name = "groupy"
|
36
|
-
s.version = "0.2.
|
36
|
+
s.version = "0.2.3"
|
37
37
|
s.summary = "Categorise Active Records in nested groups with magical scopes, ? methods, and constants."
|
38
38
|
s.author = "Matthew Rudy Jacobs"
|
39
39
|
s.email = "MatthewRudyJacobs@gmail.com"
|
data/lib/groupy.rb
CHANGED
data/test/groupy_test.rb
CHANGED
@@ -12,7 +12,8 @@ class GroupyTest < ActiveSupport::TestCase
|
|
12
12
|
end
|
13
13
|
attr_reader :dish
|
14
14
|
attr_reader :spiciness
|
15
|
-
|
15
|
+
attr_reader :smelliness
|
16
|
+
|
16
17
|
include Groupy
|
17
18
|
groupy :dish do
|
18
19
|
group :healthy do
|
@@ -37,6 +38,12 @@ class GroupyTest < ActiveSupport::TestCase
|
|
37
38
|
value :extreme
|
38
39
|
end
|
39
40
|
|
41
|
+
# we can do constants without suffices too
|
42
|
+
groupy :smelliness, :constants => true do
|
43
|
+
value :very_smelly
|
44
|
+
value :hardly_smelly
|
45
|
+
end
|
46
|
+
|
40
47
|
end
|
41
48
|
|
42
49
|
test "groupies" do
|
@@ -71,6 +78,7 @@ class GroupyTest < ActiveSupport::TestCase
|
|
71
78
|
test "constants" do
|
72
79
|
assert_equal "small", Food::SMALL_SPICINESS
|
73
80
|
assert_equal "extreme", Food::EXTREME_SPICINESS
|
81
|
+
assert_equal "very_smelly", Food::VERY_SMELLY
|
74
82
|
end
|
75
83
|
|
76
84
|
class Thing
|
data/test/with_database_test.rb
CHANGED
@@ -4,8 +4,8 @@ require 'groupy'
|
|
4
4
|
require 'active_record'
|
5
5
|
|
6
6
|
ActiveRecord::Base.establish_connection(
|
7
|
-
|
8
|
-
|
7
|
+
:adapter => (RUBY_PLATFORM=="java" ? "jdbcsqlite3" : "sqlite3"),
|
8
|
+
:database => ":memory:"
|
9
9
|
)
|
10
10
|
|
11
11
|
ActiveRecord::Schema.define(:version => 0) do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: groupy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 3
|
10
|
+
version: 0.2.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matthew Rudy Jacobs
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-16 00:00:00 +08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|