motion-objection 0.6 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWQzMWNjZDg0ZDFmY2M5ODIyZGYwMmIzNmI0ZWQxODdiYTljMTliYg==
4
+ NDllZmQ5MjJhM2QyMWRiMWYzZjgwMjdjNWQ1M2FlN2IyMWViYmExZQ==
5
5
  data.tar.gz: !binary |-
6
- NDRlNGMzZTQ3MjRhMzUxNzdiZjRiYWE1NmQ1MjFlMThjYWUzY2M5NA==
6
+ Mzc0ZDdkNDYxNzMxYWFjMjRlYzM3OTJmNTYzZjNjYjRlMWYwY2E0ZA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YzA0N2M1YmVhMjljNmFjZTFmNDhiMDk1N2U0ODhiYjU0ZmQ1NmRlOTc1NmE5
10
- Zjc2NjQwODc2OTFkNWVlMjYzOTkxMTZjZmRhMjFjMWIxMjkxNDA0NWE5MjUy
11
- YTQ1Yzg0YWJhZDQ4ZWEzMjdlZjFiZTg3YTBjYjM3NjUzZjZiZTM=
9
+ NDA4YzMxYTUwMGY4Mjk5NzZmNjQzYmNhMGFlOTlmMjc1MGNlYzhlZjg2ODQ0
10
+ NDExNWJmNGQzNWRkZmU3ZDlmY2Y1NjUxNjk2N2UwYmNkMzA3NDM0NzMwOTQ2
11
+ ZTY5YjAzZGVhOTMwMjRlNGVmODc2NTMwZDg0ZjQxOTI0NzUyZWI=
12
12
  data.tar.gz: !binary |-
13
- OGI1NzBmMGVhYTliOTI5ODliM2VjYjUwODhjZjYzZjliN2QyZjQ3YjYzOWJk
14
- NTIzYTdiNjE5YzBmMDgxOWViNDYxMmJjYWUxYjFhMTNhZjVjNjhjNmY3OGNl
15
- ODZhM2M4NDNkNjk4NjIzMWU1ZTM1YWM2MjgyNGJmYjU1OWMxYjI=
13
+ MzFhNTkyOWRmOTY3NjYzYmM5NDk2NmNhZGUyYzBiNjdlMTA3ZWQyN2NjZTY3
14
+ NzdiNGM4M2IwYTNkOTYwNDdiY2I4MjBkNzgxZmVjNzhkMjU1NWViMTUzNTE3
15
+ M2Y5ZjczMzM4YWQ2YTQ4NTFiNTM5Nzg2MWUwY2RkMDI4MGEzYTU=
data/README.md CHANGED
@@ -1,10 +1,14 @@
1
1
  motion-objection
2
2
  ================
3
3
 
4
- Wrapping Objection in RubyMotion.
4
+ Wrapping the dependency injection library [Objection](https://github.com/atomicobject/objection) in RubyMotion.
5
5
 
6
6
  [![Build Status](https://travis-ci.org/atomicobject/motion-objection.png)](https://travis-ci.org/atomicobject/motion-objection)
7
7
 
8
+ ## Install
9
+ ```bash
10
+ gem install motion-objection
11
+ ```
8
12
  ## Basic Example
9
13
 
10
14
  ```ruby
@@ -52,3 +56,9 @@ class ViewController < NSObject
52
56
  end
53
57
  end
54
58
  ```
59
+
60
+ ## Default Injector
61
+
62
+ ```ruby
63
+ Objection.default_injector = Objection.injector
64
+ ```
@@ -1,11 +1,22 @@
1
1
  class JSObjectionInjector
2
2
  alias_method :[], :getObject
3
+ alias_method :inject_dependencies, :injectDependencies
4
+ alias_method :with_module, :withModule
5
+ alias_method :without_module_of_type, :withoutModuleOfType
3
6
 
4
7
  def get_object(klass, *args)
5
8
  if args.empty?
6
9
  getObject klass
7
10
  else
8
- getObjectWithArgs klass, *args
11
+ getObject klass, argumentList: args
9
12
  end
10
13
  end
14
+
15
+ def with_modules(*modules)
16
+ withModuleCollection modules
17
+ end
18
+
19
+ def without_modules_of_type(*modules)
20
+ withoutModuleCollection modules
21
+ end
11
22
  end
@@ -1,3 +1,3 @@
1
1
  module Objection
2
- VERSION = "0.6"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -72,5 +72,10 @@ describe "Objection" do
72
72
  @controller = @injector[ViewController]
73
73
  @controller.name.should.equal "Home"
74
74
  end
75
+
76
+ it "has support for getting an object with custom arguments" do
77
+ @controller = @injector.get_object ViewController, "Work"
78
+ @controller.name.should.equal "Work"
79
+ end
75
80
  end
76
81
  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.6'
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin DeWind