thirtythirty 0.1.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +7 -0
- data/lib/thirtythirty.rb +2 -1
- data/spec/support/classes.rb +6 -0
- data/spec/thirtythirty_spec.rb +10 -0
- data/thirtythirty.gemspec +3 -2
- metadata +62 -87
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f150dea3c6f334beccd43a3d188f64e8c2e71751
|
4
|
+
data.tar.gz: f071f455a33ee9939cfdf706f24d5d9e9f5bb2cd
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b2c2129ad2a8f7b8ff52c39552f87766ce801a29a62a10f5f9753f832d1d32b017bf587100757e8f9a014baeab3106bfcfe8fa3c1709d0076f4ba1a7d8f9c4b7
|
7
|
+
data.tar.gz: 0413599ff9c6ec5f8220c09cc7f329b0b9a223c259bf4b553683075d5430b58a7e2e16e0b0a1228f08a58213fa3a60cce0973192479c7938ba1009d47981669c
|
data/LICENSE
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
Copyright (c) blaulabs
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
4
|
+
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
6
|
+
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/thirtythirty.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
1
2
|
module Thirtythirty
|
2
3
|
|
3
4
|
# Activates marshalling for the given attributes - you have to implement getters/setters yourself!
|
@@ -53,7 +54,7 @@ private
|
|
53
54
|
obj = new
|
54
55
|
marshalled_attributes.each do |attr|
|
55
56
|
setter = :"#{attr}="
|
56
|
-
value = Marshal.load(data[attr])
|
57
|
+
value = data[attr] ? Marshal.load(data[attr]) : nil
|
57
58
|
if obj.respond_to?(setter)
|
58
59
|
obj.send(setter, value)
|
59
60
|
else
|
data/spec/support/classes.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
1
2
|
class ThirtythirtyBase
|
2
3
|
extend Thirtythirty
|
3
4
|
end
|
@@ -33,3 +34,8 @@ class WithSetterOnly < ThirtythirtyBase
|
|
33
34
|
@ivar = value.nil? ? nil : value.upcase
|
34
35
|
end
|
35
36
|
end
|
37
|
+
|
38
|
+
class ThirtythirtyTree2 < ThirtythirtyBase
|
39
|
+
marshalled_accessor :persistent, :parent, :children
|
40
|
+
attr_accessor :transient
|
41
|
+
end
|
data/spec/thirtythirty_spec.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
1
2
|
require 'spec_helper'
|
2
3
|
|
3
4
|
describe Thirtythirty do
|
@@ -318,6 +319,15 @@ describe Thirtythirty do
|
|
318
319
|
restored.persistent.should == "loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo text"
|
319
320
|
end
|
320
321
|
|
322
|
+
it "does not throw an type error for a not persisted attribute" do
|
323
|
+
b = ThirtythirtyTree2.new
|
324
|
+
b.persistent = 1
|
325
|
+
|
326
|
+
dumped = Marshal.dump(b)
|
327
|
+
ThirtythirtyTree2.marshalled_accessor :attr4
|
328
|
+
lambda { Marshal.load dumped }.should_not raise_error(TypeError)
|
329
|
+
end
|
330
|
+
|
321
331
|
end
|
322
332
|
|
323
333
|
end
|
data/thirtythirty.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = "thirtythirty"
|
4
|
-
s.version = "0.
|
4
|
+
s.version = "0.2.2"
|
5
5
|
s.date = Time.now
|
6
6
|
s.platform = Gem::Platform::RUBY
|
7
7
|
s.authors = ["Benjamin Behr", "Thomas Jachmann"]
|
@@ -9,12 +9,13 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.homepage = "http://github.com/blaulabs/thirtythirty"
|
10
10
|
s.summary = %q{Marshalling customization}
|
11
11
|
s.description = %q{This gem allows for customization of which data to marshal, especially useful for selective session data serialization.}
|
12
|
+
s.license = "MIT"
|
12
13
|
|
13
14
|
s.rubyforge_project = "thirtythirty"
|
14
15
|
|
15
16
|
s.add_development_dependency "ci_reporter", "~> 1.6.5"
|
16
17
|
s.add_development_dependency "rspec", "~> 2.6.0"
|
17
|
-
s.add_development_dependency "rake", "0.
|
18
|
+
s.add_development_dependency "rake", "~> 0.9.0"
|
18
19
|
|
19
20
|
s.files = `git ls-files`.split("\n")
|
20
21
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
metadata
CHANGED
@@ -1,86 +1,71 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: thirtythirty
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
- 0
|
10
|
-
version: 0.1.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.2
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Benjamin Behr
|
14
8
|
- Thomas Jachmann
|
15
9
|
autorequire:
|
16
10
|
bindir: bin
|
17
11
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
dependencies:
|
22
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2014-05-22 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
23
15
|
name: ci_reporter
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
- - ~>
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
hash: 5
|
31
|
-
segments:
|
32
|
-
- 1
|
33
|
-
- 6
|
34
|
-
- 5
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
35
20
|
version: 1.6.5
|
36
21
|
type: :development
|
37
|
-
version_requirements: *id001
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name: rspec
|
40
22
|
prerelease: false
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 1.6.5
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rspec
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
51
34
|
version: 2.6.0
|
52
35
|
type: :development
|
53
|
-
version_requirements: *id002
|
54
|
-
- !ruby/object:Gem::Dependency
|
55
|
-
name: rake
|
56
36
|
prerelease: false
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 2.6.0
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: rake
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 0.9.0
|
68
49
|
type: :development
|
69
|
-
|
70
|
-
|
71
|
-
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 0.9.0
|
56
|
+
description: This gem allows for customization of which data to marshal, especially
|
57
|
+
useful for selective session data serialization.
|
58
|
+
email:
|
72
59
|
- benny@digitalbehr.de
|
73
60
|
- self@thomasjachmann.com
|
74
61
|
executables: []
|
75
|
-
|
76
62
|
extensions: []
|
77
|
-
|
78
63
|
extra_rdoc_files: []
|
79
|
-
|
80
|
-
|
81
|
-
- .
|
82
|
-
- .rspec
|
64
|
+
files:
|
65
|
+
- ".gitignore"
|
66
|
+
- ".rspec"
|
83
67
|
- Gemfile
|
68
|
+
- LICENSE
|
84
69
|
- README.rdoc
|
85
70
|
- Rakefile
|
86
71
|
- lib/thirtythirty.rb
|
@@ -88,41 +73,31 @@ files:
|
|
88
73
|
- spec/support/classes.rb
|
89
74
|
- spec/thirtythirty_spec.rb
|
90
75
|
- thirtythirty.gemspec
|
91
|
-
has_rdoc: true
|
92
76
|
homepage: http://github.com/blaulabs/thirtythirty
|
93
|
-
licenses:
|
94
|
-
|
77
|
+
licenses:
|
78
|
+
- MIT
|
79
|
+
metadata: {}
|
95
80
|
post_install_message:
|
96
81
|
rdoc_options: []
|
97
|
-
|
98
|
-
require_paths:
|
82
|
+
require_paths:
|
99
83
|
- lib
|
100
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
101
|
-
|
102
|
-
requirements:
|
84
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
103
86
|
- - ">="
|
104
|
-
- !ruby/object:Gem::Version
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
version: "0"
|
109
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
-
none: false
|
111
|
-
requirements:
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
112
91
|
- - ">="
|
113
|
-
- !ruby/object:Gem::Version
|
114
|
-
|
115
|
-
segments:
|
116
|
-
- 0
|
117
|
-
version: "0"
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
118
94
|
requirements: []
|
119
|
-
|
120
95
|
rubyforge_project: thirtythirty
|
121
|
-
rubygems_version:
|
96
|
+
rubygems_version: 2.2.2
|
122
97
|
signing_key:
|
123
|
-
specification_version:
|
98
|
+
specification_version: 4
|
124
99
|
summary: Marshalling customization
|
125
|
-
test_files:
|
100
|
+
test_files:
|
126
101
|
- spec/spec_helper.rb
|
127
102
|
- spec/support/classes.rb
|
128
103
|
- spec/thirtythirty_spec.rb
|