serialize_variants 0.0.4 → 0.0.5
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/{README → README.md} +0 -0
- data/Rakefile +2 -2
- data/lib/serialize_variants.rb +3 -2
- metadata +7 -5
data/{README → README.md}
RENAMED
|
File without changes
|
data/Rakefile
CHANGED
|
@@ -34,7 +34,7 @@ PKG_FILES = FileList[
|
|
|
34
34
|
|
|
35
35
|
spec = Gem::Specification.new do |s|
|
|
36
36
|
s.name = "serialize_variants"
|
|
37
|
-
s.version = "0.0.
|
|
37
|
+
s.version = "0.0.5"
|
|
38
38
|
s.author = "Nicolas Goy"
|
|
39
39
|
s.email = "kuon@goyman.com"
|
|
40
40
|
s.homepage = "http://goyman.com/"
|
|
@@ -43,7 +43,7 @@ spec = Gem::Specification.new do |s|
|
|
|
43
43
|
s.description = "Serialize Variants provides a way to specify serialize options at the model level and reuse those options"
|
|
44
44
|
s.files = PKG_FILES.to_a
|
|
45
45
|
s.require_path = "lib"
|
|
46
|
-
s.extra_rdoc_files = ["README"]
|
|
46
|
+
s.extra_rdoc_files = ["README.md"]
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
desc 'Turn this plugin into a gem.'
|
data/lib/serialize_variants.rb
CHANGED
|
@@ -20,12 +20,13 @@ module SerializeVariants
|
|
|
20
20
|
def serializable_hash(options = nil)
|
|
21
21
|
options ||= {}
|
|
22
22
|
variant = options[:variant]
|
|
23
|
+
force = options[:force] || {}
|
|
23
24
|
|
|
24
25
|
case options[:variant]
|
|
25
26
|
when :short
|
|
26
|
-
super(self.class.short_serialize_options)
|
|
27
|
+
super(force.merge(self.class.short_serialize_options))
|
|
27
28
|
when :long
|
|
28
|
-
super(self.class.long_serialize_options)
|
|
29
|
+
super(force.merge(self.class.long_serialize_options))
|
|
29
30
|
else
|
|
30
31
|
super(options)
|
|
31
32
|
end
|
metadata
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: serialize_variants
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease:
|
|
5
|
-
version: 0.0.
|
|
5
|
+
version: 0.0.5
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- Nicolas Goy
|
|
@@ -10,7 +10,8 @@ autorequire:
|
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
12
|
|
|
13
|
-
date: 2011-05-
|
|
13
|
+
date: 2011-05-25 00:00:00 +02:00
|
|
14
|
+
default_executable:
|
|
14
15
|
dependencies: []
|
|
15
16
|
|
|
16
17
|
description: Serialize Variants provides a way to specify serialize options at the model level and reuse those options
|
|
@@ -20,18 +21,19 @@ executables: []
|
|
|
20
21
|
extensions: []
|
|
21
22
|
|
|
22
23
|
extra_rdoc_files:
|
|
23
|
-
- README
|
|
24
|
+
- README.md
|
|
24
25
|
files:
|
|
25
26
|
- init.rb
|
|
26
27
|
- install.rb
|
|
27
28
|
- MIT-LICENSE
|
|
28
29
|
- Rakefile
|
|
29
|
-
- README
|
|
30
|
+
- README.md
|
|
30
31
|
- uninstall.rb
|
|
31
32
|
- lib/serialize_variants.rb
|
|
32
33
|
- rails/init.rb
|
|
33
34
|
- test/serialize_variants_test.rb
|
|
34
35
|
- test/test_helper.rb
|
|
36
|
+
has_rdoc: true
|
|
35
37
|
homepage: http://goyman.com/
|
|
36
38
|
licenses: []
|
|
37
39
|
|
|
@@ -55,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
55
57
|
requirements: []
|
|
56
58
|
|
|
57
59
|
rubyforge_project:
|
|
58
|
-
rubygems_version: 1.
|
|
60
|
+
rubygems_version: 1.6.2
|
|
59
61
|
signing_key:
|
|
60
62
|
specification_version: 3
|
|
61
63
|
summary: Provides serialization options as variants
|