classy_enum 3.3.1 → 3.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/classy_enum/base.rb +12 -2
- data/lib/classy_enum/version.rb +1 -1
- data/lib/generators/test_unit/classy_enum_generator.rb +1 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd8f827576d5863923d1700d81be95ccc85495a9
|
4
|
+
data.tar.gz: ba0b639734522273bc380f7f772a69e8c586d9db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e6df9008d2535fb6e4ddc3ecf6f5aad2f37d849b2f18b6271c7a21542fd38883095e3d8cc9c60e42cfbc7903efc94e3cd7a45411f5eee4cc1d1a2627db9805f
|
7
|
+
data.tar.gz: b78ad295a389584f2a05a92e21b10759185bcec10168312dc7a90226c6329a3f727d68a0a8e6080f47b7290cb2bde8736cced605fa4d0d7f4c16eba90404f68b
|
data/CHANGELOG.md
CHANGED
data/lib/classy_enum/base.rb
CHANGED
@@ -32,11 +32,21 @@ module ClassyEnum
|
|
32
32
|
visitor_method = "visit_#{klass.name.split('::').join('_')}"
|
33
33
|
|
34
34
|
Arel::Visitors::ToSql.class_eval do
|
35
|
-
define_method visitor_method, lambda {|
|
35
|
+
define_method visitor_method, lambda {|*values|
|
36
|
+
values[0] = values[0].to_s
|
37
|
+
begin
|
38
|
+
quoted(*values)
|
39
|
+
rescue NoMethodError
|
40
|
+
quote(*values)
|
41
|
+
end
|
42
|
+
}
|
36
43
|
end
|
37
44
|
|
38
45
|
Arel::Visitors::DepthFirst.class_eval do
|
39
|
-
define_method visitor_method, lambda {|
|
46
|
+
define_method visitor_method, lambda {|*values|
|
47
|
+
values[0] = values[0].to_s
|
48
|
+
terminal(*values)
|
49
|
+
}
|
40
50
|
end
|
41
51
|
end
|
42
52
|
|
data/lib/classy_enum/version.rb
CHANGED
@@ -9,8 +9,7 @@ module TestUnit
|
|
9
9
|
source_root File.expand_path("../templates", __FILE__)
|
10
10
|
|
11
11
|
def copy_files # :nodoc:
|
12
|
-
|
13
|
-
template "enum_test.rb", "test/unit/enums/#{file_name}_test.rb"
|
12
|
+
template "enum_test.rb", "test/enums/#{file_name}_test.rb"
|
14
13
|
end
|
15
14
|
end
|
16
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: classy_enum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Brown
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
143
|
version: '0'
|
144
144
|
requirements: []
|
145
145
|
rubyforge_project:
|
146
|
-
rubygems_version: 2.
|
146
|
+
rubygems_version: 2.1.11
|
147
147
|
signing_key:
|
148
148
|
specification_version: 4
|
149
149
|
summary: A class based enumerator utility for Ruby on Rails
|