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 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.2)
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.16)
13
- activesupport (= 3.2.16)
12
+ activemodel (3.2.17)
13
+ activesupport (= 3.2.17)
14
14
  builder (~> 3.0.0)
15
- activerecord (3.2.16)
16
- activemodel (= 3.2.16)
17
- activesupport (= 3.2.16)
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.16)
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
@@ -0,0 +1,8 @@
1
+ require "rake/testtask"
2
+
3
+ task :default => [:test]
4
+
5
+ Rake::TestTask.new do |t|
6
+ t.libs << "test"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
@@ -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.3"
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"
@@ -49,7 +49,7 @@ module DataMapper
49
49
  end
50
50
 
51
51
  def dump(value)
52
- value ? value.collect { |x| x.to_s.strip }.join(',') : nil
52
+ value ? Array(value).collect { |x| x.to_s.strip }.join(',') : nil
53
53
  end
54
54
  end
55
55
 
@@ -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
- hash: 25
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
- date: 2014-03-04 00:00:00 Z
19
- dependencies:
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
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
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
- requirement: &id002 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ~>
42
- - !ruby/object:Gem::Version
43
- hash: 15
44
- segments:
45
- - 3
46
- - 2
47
- - 0
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
- requirement: &id003 !ruby/object:Gem::Requirement
55
- none: false
56
- requirements:
57
- - - ~>
58
- - !ruby/object:Gem::Version
59
- hash: 55
60
- segments:
61
- - 5
62
- - 0
63
- - 0
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
- requirement: &id004 !ruby/object:Gem::Requirement
71
- none: false
72
- requirements:
73
- - - ~>
74
- - !ruby/object:Gem::Version
75
- hash: 11
76
- segments:
77
- - 1
78
- - 3
79
- - 8
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
- requirement: &id005 !ruby/object:Gem::Requirement
87
- none: false
88
- requirements:
89
- - - ~>
90
- - !ruby/object:Gem::Version
91
- hash: 9
92
- segments:
93
- - 1
94
- - 3
95
- version: "1.3"
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
- requirement: &id006 !ruby/object:Gem::Requirement
102
- none: false
103
- requirements:
104
- - - ~>
105
- - !ruby/object:Gem::Version
106
- hash: 57
107
- segments:
108
- - 5
109
- - 2
110
- - 3
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
- requirement: &id007 !ruby/object:Gem::Requirement
118
- none: false
119
- requirements:
120
- - - ~>
121
- - !ruby/object:Gem::Version
122
- hash: 63
123
- segments:
124
- - 0
125
- - 9
126
- - 12
127
- - 4
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
- version_requirements: *id007
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
- none: false
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- hash: 3
160
- segments:
161
- - 0
162
- version: "0"
163
- required_rubygems_version: !ruby/object:Gem::Requirement
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.8.25
158
+ rubygems_version: 2.1.6
176
159
  signing_key:
177
- specification_version: 3
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