datamapper-shim 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/Gemfile.lock +9 -7
- data/Rakefile +8 -0
- data/datamapper-shim.gemspec +2 -1
- data/lib/data_mapper/shim.rb +1 -1
- data/test/data_mapper/shim_test.rb +19 -0
- metadata +118 -135
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
N2FkOTYxYjMxMzI5NThhMWZjMWJhNjUzYjgzY2ZlM2QwZGFlNWY4OQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YzVjNzhjZGE4YjcwY2RlYjI4MjY5M2MwMTk3MzgzMjBlYTJjZDZjYw==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NGU4NzVhNzViY2MzMzIwYTUzOGFiMDM3MTQ4ZTM5N2RjN2M5YTgwNGYwM2Q4
|
10
|
+
NjljMWUzMmJkY2Q0NzkzYmMxYjBlMWIzYmZjYjAwMTBiYWViN2NjNmM1OGZh
|
11
|
+
ZDQ5NWJhM2E2ZjE5NmY0Y2RkZmM2Yjg4YjZkM2UyMDU3MWIyMjY=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZDUzMjAxODNkYmFjOTU0ZjU1NzQzYjJmNmUxZGI4YTBjNWM0NDg2ODMzY2U4
|
14
|
+
N2Y0YWE2OTU4ZjlkZGFhNjYyYmQ2NDFlMTQxNGY2NmZlODc4MzhiMTBlMTYx
|
15
|
+
ZjE0ZDEyOWM4NDY0ZDA4ZDdkZGM4NjI2NjYxMTgxOTFhNDRhOWU=
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
datamapper-shim (0.0.
|
4
|
+
datamapper-shim (0.0.3)
|
5
5
|
activerecord (~> 3.2.0)
|
6
6
|
composite_primary_keys (~> 5.0.0)
|
7
7
|
json (~> 1.4)
|
@@ -9,15 +9,15 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activemodel (3.2.
|
13
|
-
activesupport (= 3.2.
|
12
|
+
activemodel (3.2.17)
|
13
|
+
activesupport (= 3.2.17)
|
14
14
|
builder (~> 3.0.0)
|
15
|
-
activerecord (3.2.
|
16
|
-
activemodel (= 3.2.
|
17
|
-
activesupport (= 3.2.
|
15
|
+
activerecord (3.2.17)
|
16
|
+
activemodel (= 3.2.17)
|
17
|
+
activesupport (= 3.2.17)
|
18
18
|
arel (~> 3.0.2)
|
19
19
|
tzinfo (~> 0.3.29)
|
20
|
-
activesupport (3.2.
|
20
|
+
activesupport (3.2.17)
|
21
21
|
i18n (~> 0.6, >= 0.6.4)
|
22
22
|
multi_json (~> 1.0)
|
23
23
|
arel (3.0.3)
|
@@ -34,6 +34,7 @@ GEM
|
|
34
34
|
coderay (~> 1.0)
|
35
35
|
method_source (~> 0.8)
|
36
36
|
slop (~> 3.4)
|
37
|
+
rake (10.1.1)
|
37
38
|
slop (3.4.7)
|
38
39
|
sqlite3 (1.3.8)
|
39
40
|
tzinfo (0.3.38)
|
@@ -46,4 +47,5 @@ DEPENDENCIES
|
|
46
47
|
datamapper-shim!
|
47
48
|
minitest (~> 5.2.3)
|
48
49
|
pry (~> 0.9.12.4)
|
50
|
+
rake (~> 10.1.1)
|
49
51
|
sqlite3 (~> 1.3.8)
|
data/Rakefile
ADDED
data/datamapper-shim.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "datamapper-shim"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.4"
|
8
8
|
spec.authors = ["ecin"]
|
9
9
|
spec.email = ["ecin@copypastel.com"]
|
10
10
|
spec.description = "Dress ActiveRecord models in DataMapper robes"
|
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_dependency "activerecord", "~> 3.2.0"
|
22
22
|
spec.add_dependency "composite_primary_keys", "~> 5.0.0"
|
23
23
|
|
24
|
+
spec.add_development_dependency "rake", "~> 10.1.1"
|
24
25
|
spec.add_development_dependency "sqlite3", "~> 1.3.8"
|
25
26
|
spec.add_development_dependency "bundler", "~> 1.3"
|
26
27
|
spec.add_development_dependency "minitest", "~> 5.2.3"
|
data/lib/data_mapper/shim.rb
CHANGED
@@ -511,6 +511,15 @@ describe DataMapper::Shim do
|
|
511
511
|
Typecaster.first.list.must_equal list
|
512
512
|
end
|
513
513
|
|
514
|
+
it "can typecast strings to a list" do
|
515
|
+
value = "value"
|
516
|
+
@typecaster.list = value
|
517
|
+
@typecaster.save
|
518
|
+
|
519
|
+
Typecaster.connection.select_value("SELECT list FROM typecasters").must_equal value
|
520
|
+
Typecaster.first.list.must_equal [value]
|
521
|
+
end
|
522
|
+
|
514
523
|
it "can typecast to YAML" do
|
515
524
|
object = {}
|
516
525
|
@typecaster.yaml = object
|
@@ -782,6 +791,11 @@ describe DataMapper::Shim do
|
|
782
791
|
@validator = Validator.new
|
783
792
|
end
|
784
793
|
|
794
|
+
after do
|
795
|
+
# Avoid 'already initialized' warnings
|
796
|
+
Object.__send__(:remove_const, :Validator)
|
797
|
+
end
|
798
|
+
|
785
799
|
describe "presence" do
|
786
800
|
|
787
801
|
it "checks an attribute is present" do
|
@@ -1119,6 +1133,11 @@ describe DataMapper::Shim do
|
|
1119
1133
|
@callbacker = Callbacker.new
|
1120
1134
|
end
|
1121
1135
|
|
1136
|
+
after do
|
1137
|
+
# Avoid 'already initialized' warnings
|
1138
|
+
Object.__send__(:remove_const, :Callbacker)
|
1139
|
+
end
|
1140
|
+
|
1122
1141
|
describe ":after callbacks" do
|
1123
1142
|
|
1124
1143
|
before do
|
metadata
CHANGED
@@ -1,180 +1,163 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: datamapper-shim
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 3
|
10
|
-
version: 0.0.3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.4
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- ecin
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2014-03-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
21
14
|
name: json
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 7
|
29
|
-
segments:
|
30
|
-
- 1
|
31
|
-
- 4
|
32
|
-
version: "1.4"
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.4'
|
33
20
|
type: :runtime
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: activerecord
|
37
21
|
prerelease: false
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.4'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activerecord
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
48
33
|
version: 3.2.0
|
49
34
|
type: :runtime
|
50
|
-
version_requirements: *id002
|
51
|
-
- !ruby/object:Gem::Dependency
|
52
|
-
name: composite_primary_keys
|
53
35
|
prerelease: false
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 3.2.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: composite_primary_keys
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
64
47
|
version: 5.0.0
|
65
48
|
type: :runtime
|
66
|
-
version_requirements: *id003
|
67
|
-
- !ruby/object:Gem::Dependency
|
68
|
-
name: sqlite3
|
69
49
|
prerelease: false
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 5.0.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 10.1.1
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 10.1.1
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: sqlite3
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
80
75
|
version: 1.3.8
|
81
76
|
type: :development
|
82
|
-
version_requirements: *id004
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: bundler
|
85
77
|
prerelease: false
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.3.8
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: bundler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.3'
|
96
90
|
type: :development
|
97
|
-
version_requirements: *id005
|
98
|
-
- !ruby/object:Gem::Dependency
|
99
|
-
name: minitest
|
100
91
|
prerelease: false
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.3'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: minitest
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ~>
|
102
|
+
- !ruby/object:Gem::Version
|
111
103
|
version: 5.2.3
|
112
104
|
type: :development
|
113
|
-
version_requirements: *id006
|
114
|
-
- !ruby/object:Gem::Dependency
|
115
|
-
name: pry
|
116
105
|
prerelease: false
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 5.2.3
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: pry
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
128
117
|
version: 0.9.12.4
|
129
118
|
type: :development
|
130
|
-
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ~>
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.9.12.4
|
131
125
|
description: Dress ActiveRecord models in DataMapper robes
|
132
|
-
email:
|
126
|
+
email:
|
133
127
|
- ecin@copypastel.com
|
134
128
|
executables: []
|
135
|
-
|
136
129
|
extensions: []
|
137
|
-
|
138
130
|
extra_rdoc_files: []
|
139
|
-
|
140
|
-
files:
|
131
|
+
files:
|
141
132
|
- Gemfile
|
142
133
|
- Gemfile.lock
|
134
|
+
- Rakefile
|
143
135
|
- datamapper-shim.gemspec
|
144
136
|
- lib/data_mapper/shim.rb
|
145
137
|
- test/data_mapper/shim_test.rb
|
146
138
|
homepage: https://github.com/typekit/datamapper-shim
|
147
|
-
licenses:
|
139
|
+
licenses:
|
148
140
|
- MIT
|
141
|
+
metadata: {}
|
149
142
|
post_install_message:
|
150
143
|
rdoc_options: []
|
151
|
-
|
152
|
-
require_paths:
|
144
|
+
require_paths:
|
153
145
|
- lib
|
154
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
none: false
|
165
|
-
requirements:
|
166
|
-
- - ">="
|
167
|
-
- !ruby/object:Gem::Version
|
168
|
-
hash: 3
|
169
|
-
segments:
|
170
|
-
- 0
|
171
|
-
version: "0"
|
146
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - ! '>='
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0'
|
151
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
|
+
requirements:
|
153
|
+
- - ! '>='
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: '0'
|
172
156
|
requirements: []
|
173
|
-
|
174
157
|
rubyforge_project:
|
175
|
-
rubygems_version: 1.
|
158
|
+
rubygems_version: 2.1.6
|
176
159
|
signing_key:
|
177
|
-
specification_version:
|
160
|
+
specification_version: 4
|
178
161
|
summary: Migrate DataMapper models to ActiveRecord
|
179
|
-
test_files:
|
162
|
+
test_files:
|
180
163
|
- test/data_mapper/shim_test.rb
|