kartograph 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kartograph/artist.rb +6 -4
- data/lib/kartograph/version.rb +1 -1
- data/spec/lib/kartograph/artist_spec.rb +2 -1
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49a4dcf3325b645e55a1ff0e50d4d4e3d4a82ab4
|
4
|
+
data.tar.gz: 2f15ae89e2d52f9730081e8108f51da1cc49f2eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38edfe5c8bc641c8993ac84832482c9a2483a1fa4f2d21f0df0c3e044e87fa6183a6af4d675edb53ea811ddc5c2320d9597e8b76dda65869c563c4fda6f1b915
|
7
|
+
data.tar.gz: e166ff85208cb0ce396b01dd8b196c82f23c6f09663f577413c8417d68a4fd8c4f24770b71596dcedaffd67aec0044306502b5467a67d2a6e14268d1ae63f224
|
data/lib/kartograph/artist.rb
CHANGED
@@ -23,10 +23,12 @@ module Kartograph
|
|
23
23
|
def build_properties(scope)
|
24
24
|
scoped_properties = scope ? properties.filter_by_scope(scope) : properties
|
25
25
|
scoped_properties.each_with_object({}) do |property, mapped|
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
begin
|
27
|
+
mapped[property.key] = property.value_for(object, scope)
|
28
|
+
rescue NoMethodError => e
|
29
|
+
raise ArgumentError, "#{object} does not respond to #{property.name}, so we can't map it"
|
30
|
+
end
|
29
31
|
end
|
30
32
|
end
|
31
33
|
end
|
32
|
-
end
|
34
|
+
end
|
data/lib/kartograph/version.rb
CHANGED
@@ -28,7 +28,8 @@ describe Kartograph::Artist do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'raises for a property that the object does not have' do
|
31
|
-
|
31
|
+
class TestArtistNoMethod; end
|
32
|
+
object = TestArtistNoMethod.new
|
32
33
|
properties << Kartograph::Property.new(:bunk)
|
33
34
|
artist = Kartograph::Artist.new(object, map)
|
34
35
|
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kartograph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Ross
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.6'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 3.0.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 3.0.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: pry
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: Kartograph makes it easy to generate and convert JSON. It's intention
|
@@ -76,9 +76,9 @@ executables: []
|
|
76
76
|
extensions: []
|
77
77
|
extra_rdoc_files: []
|
78
78
|
files:
|
79
|
-
-
|
80
|
-
-
|
81
|
-
-
|
79
|
+
- .gitignore
|
80
|
+
- .rspec
|
81
|
+
- .travis.yml
|
82
82
|
- Gemfile
|
83
83
|
- LICENSE.txt
|
84
84
|
- README.md
|
@@ -117,17 +117,17 @@ require_paths:
|
|
117
117
|
- lib
|
118
118
|
required_ruby_version: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
|
-
- -
|
120
|
+
- - '>='
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '0'
|
123
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
124
|
requirements:
|
125
|
-
- -
|
125
|
+
- - '>='
|
126
126
|
- !ruby/object:Gem::Version
|
127
127
|
version: '0'
|
128
128
|
requirements: []
|
129
129
|
rubyforge_project:
|
130
|
-
rubygems_version: 2.
|
130
|
+
rubygems_version: 2.0.14
|
131
131
|
signing_key:
|
132
132
|
specification_version: 4
|
133
133
|
summary: Kartograph makes it easy to generate and convert JSON. It's intention is
|