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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzdhYTYzOTUwZmZmMmIyM2IxYmU0OWM5MjhmOTgzOGY2ODJjM2MyYQ==
4
+ NjYwMzFlYWRmZmFiMmUzNGYwYmFkYTY0NmFiNWY2YjllOTViYTI5Zg==
5
5
  data.tar.gz: !binary |-
6
- ZTM1MDU2MjZlNGRiNGI0OThjNDdkMGVhZGVhNDhiYmQ0NDc3MWJkNA==
6
+ YmZjMzI2YTgxMmQ3ZjBiOTQ5OTlhY2ViYjBmM2QyZmQ5YmI0NmJhNg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YzExMTU1NzM2YzhmNGZjZWJjMDVlZTVjNjdkZThiODMxOGQ4YTc3NmU4NWZi
10
- ZDUxYzZlNWIzYmY2MGRjNTdkMTdjNzZlZGFiODVkYzY0ZTMyZDExMzMwZGIx
11
- YzMwYTY0MDA1NGIwZGUxNWY1NGIxNzE2MTFkOWZmNTBlNjY3ZWU=
9
+ MTM3ZmNiN2YxYmE2MTMyOTc4YjA2ZjZhYTRiNDcwYmJkNzdhNjJmM2Q0YTg0
10
+ YWEzMDMzYWZjMTVmMzRlYzA3N2NhZjc5NDZiZDQ3NTdhMjUxYTA5ZDRkZDhh
11
+ NmNmMTQ5YTRjYTdjN2QyMDNmZDQxZDZhYWQ3ODRiMmU3ZmFhZTI=
12
12
  data.tar.gz: !binary |-
13
- MmQ4YzdhOWZlNjQ0MzYzZTQ1NDY5YTY3MmIwZmQwMWM4MzEzZTA2ZDUzNTlm
14
- NDFiZGVkZTVhMjBmZmU3ODRjYzZiMjFhOGFkYWJmYjZkMGVmMzYzNmQyZTM5
15
- YjMxOGU5YmYzZjY0YzlhZjk3MTA3NWZiMTY5MDFkNzY0OTEzNmU=
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", "~>1.0.3"
18
+ pod "Objection", '~>1.1'
17
19
  end
18
20
  end
@@ -8,6 +8,6 @@ Motion::Project::App.setup do |app|
8
8
  end
9
9
 
10
10
  app.pods do
11
- pod 'Objection', "~>1.0.4"
11
+ pod "Objection", '~>1.1'
12
12
  end
13
13
  end
@@ -0,0 +1,11 @@
1
+ class JSObjectFactory
2
+ alias_method :[], :getObject
3
+
4
+ def get_object(klass, *args)
5
+ if args.empty?
6
+ getObject klass
7
+ else
8
+ getObject klass, withArgumentList: args
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  class JSObjection #:nodoc:
2
- setPropertyReflector RubyPropertyReflector
2
+ setPropertyReflector RubyPropertyReflector.new
3
3
  end
@@ -1,11 +1,16 @@
1
- class RubyPropertyReflector
2
-
3
- def self.propertyForClass(klass, andProperty: property)
4
- dependency_type = klass.send(:objectionTypeMappings)[property]
5
- unless dependency_type.is_a? Class
6
- dependency_type = dependency_type.objection_constantize
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
@@ -1,3 +1,3 @@
1
1
  module Objection
2
- VERSION = "0.7.2"
2
+ VERSION = "0.8"
3
3
  end
@@ -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.7.2
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