motion-objection 0.7.2 → 0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Rakefile +4 -2
- data/lib/motion-objection.rb +1 -1
- data/lib/motion-objection/extensions/js_object_factory.rb +11 -0
- data/lib/motion-objection/extensions/js_objection.rb +1 -1
- data/lib/motion-objection/ruby_property_reflector.rb +13 -8
- data/lib/motion-objection/version.rb +1 -1
- data/spec/objection_spec.rb +12 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjYwMzFlYWRmZmFiMmUzNGYwYmFkYTY0NmFiNWY2YjllOTViYTI5Zg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YmZjMzI2YTgxMmQ3ZjBiOTQ5OTlhY2ViYjBmM2QyZmQ5YmI0NmJhNg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTM3ZmNiN2YxYmE2MTMyOTc4YjA2ZjZhYTRiNDcwYmJkNzdhNjJmM2Q0YTg0
|
10
|
+
YWEzMDMzYWZjMTVmMzRlYzA3N2NhZjc5NDZiZDQ3NTdhMjUxYTA5ZDRkZDhh
|
11
|
+
NmNmMTQ5YTRjYTdjN2QyMDNmZDQxZDZhYWQ3ODRiMmU3ZmFhZTI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTE2NTE2NTM4M2UwMWEyMWJmMmZhZjQ3YWViODBlZGJkZmJiZDM1ODkyNTM0
|
14
|
+
ZTg0MGUxZThjMGM5YmZiZjE2Mjk2NGY0NGMyYzE0OWExYzdiYWNkN2I2NWE5
|
15
|
+
MjVkMmM0MWYzNzYxMTFkNTVlZDc1NWZkY2YzZDU0NWFkMGQxYWQ=
|
data/Rakefile
CHANGED
@@ -7,12 +7,14 @@ $:.unshift("./lib/")
|
|
7
7
|
require './lib/motion-objection'
|
8
8
|
|
9
9
|
Motion::Project::App.setup do |app|
|
10
|
-
# Use `rake config' to see complete project settings.
|
11
10
|
app.name = 'motion-objection'
|
12
11
|
|
12
|
+
if ENV['DEV_CERT']
|
13
|
+
app.codesign_certificate = ENV['DEV_CERT']
|
14
|
+
end
|
13
15
|
app.identifier = 'com.atomicobject.motion-objection'
|
14
16
|
|
15
17
|
app.pods do
|
16
|
-
pod "Objection",
|
18
|
+
pod "Objection", '~>1.1'
|
17
19
|
end
|
18
20
|
end
|
data/lib/motion-objection.rb
CHANGED
@@ -1,11 +1,16 @@
|
|
1
|
-
class RubyPropertyReflector
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
class RubyPropertyReflector < JSObjectionRuntimePropertyReflector
|
2
|
+
def propertyForClass(klass, andProperty: property)
|
3
|
+
if klass.respondsToSelector :objectionTypeMappings
|
4
|
+
dependency_type = klass.send(:objectionTypeMappings)[property]
|
5
|
+
unless dependency_type.is_a? Class
|
6
|
+
dependency_type = dependency_type.objection_constantize
|
7
|
+
end
|
8
|
+
property_info = JSObjectionPropertyInfo.new
|
9
|
+
property_info.value = dependency_type
|
10
|
+
property_info.type = JSObjectionTypeClass
|
11
|
+
property_info
|
12
|
+
else
|
13
|
+
super
|
7
14
|
end
|
8
|
-
JSObjectionPropertyInfo.new(dependency_type, JSObjectionTypeClass).value
|
9
15
|
end
|
10
|
-
|
11
16
|
end
|
data/spec/objection_spec.rb
CHANGED
@@ -99,4 +99,16 @@ describe "Objection" do
|
|
99
99
|
@controller.name.should.equal "Work"
|
100
100
|
end
|
101
101
|
end
|
102
|
+
|
103
|
+
describe "object factory" do
|
104
|
+
before do
|
105
|
+
@object_factory = @injector[JSObjectFactory]
|
106
|
+
end
|
107
|
+
|
108
|
+
it "will build an object via Objection" do
|
109
|
+
@object_factory[ViewController].name.should.equal "Home"
|
110
|
+
@object_factory.get_object(ViewController).name.should.equal "Home"
|
111
|
+
@object_factory.get_object(ViewController, "Work").name.should.equal "Work"
|
112
|
+
end
|
113
|
+
end
|
102
114
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-objection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.8'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin DeWind
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- lib/motion-objection.rb
|
43
43
|
- lib/motion-objection/awoken.rb
|
44
44
|
- lib/motion-objection/compose.rb
|
45
|
+
- lib/motion-objection/extensions/js_object_factory.rb
|
45
46
|
- lib/motion-objection/extensions/js_objection.rb
|
46
47
|
- lib/motion-objection/extensions/js_objection_injector.rb
|
47
48
|
- lib/motion-objection/extensions/ns_object.rb
|