routable 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/routable/router.rb +4 -2
- data/lib/routable/version.rb +1 -1
- metadata +20 -31
- data/lib/routable/ns_object.rb +0 -23
- data/spec/ns_object_spec.rb +0 -21
data/lib/routable/router.rb
CHANGED
@@ -179,8 +179,10 @@ module Routable
|
|
179
179
|
if open_options[:shared]
|
180
180
|
shared_vc_cache[url] = controller
|
181
181
|
# when controller.viewDidUnload called, remove from cache.
|
182
|
-
controller.
|
183
|
-
|
182
|
+
controller.class.class_eval do
|
183
|
+
define_method(:new_dealloc) do
|
184
|
+
shared_vc_cache.delete url
|
185
|
+
end
|
184
186
|
end
|
185
187
|
controller.instance_eval do
|
186
188
|
def viewDidUnload
|
data/lib/routable/version.rb
CHANGED
metadata
CHANGED
@@ -1,28 +1,23 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: routable
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
4
5
|
prerelease:
|
5
|
-
version: 0.0.2
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Clay Allsopp
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
date: 2012-06-09 00:00:00 Z
|
12
|
+
date: 2012-10-10 00:00:00.000000000 Z
|
14
13
|
dependencies: []
|
15
|
-
|
16
14
|
description: A RubyMotion UIViewController -> URL router
|
17
|
-
email:
|
15
|
+
email:
|
18
16
|
- clay.allsopp@gmail.com
|
19
17
|
executables: []
|
20
|
-
|
21
18
|
extensions: []
|
22
|
-
|
23
19
|
extra_rdoc_files: []
|
24
|
-
|
25
|
-
files:
|
20
|
+
files:
|
26
21
|
- .gitignore
|
27
22
|
- Gemfile
|
28
23
|
- README.md
|
@@ -30,38 +25,32 @@ files:
|
|
30
25
|
- Routable.gemspec
|
31
26
|
- app/app_delegate.rb
|
32
27
|
- lib/routable.rb
|
33
|
-
- lib/routable/ns_object.rb
|
34
28
|
- lib/routable/router.rb
|
35
29
|
- lib/routable/version.rb
|
36
30
|
- spec/main_spec.rb
|
37
|
-
- spec/ns_object_spec.rb
|
38
31
|
homepage: https://github.com/clayallsopp/Routable
|
39
32
|
licenses: []
|
40
|
-
|
41
33
|
post_install_message:
|
42
34
|
rdoc_options: []
|
43
|
-
|
44
|
-
require_paths:
|
35
|
+
require_paths:
|
45
36
|
- lib
|
46
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
47
38
|
none: false
|
48
|
-
requirements:
|
49
|
-
- -
|
50
|
-
- !ruby/object:Gem::Version
|
51
|
-
version:
|
52
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ! '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
44
|
none: false
|
54
|
-
requirements:
|
55
|
-
- -
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version:
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
58
49
|
requirements: []
|
59
|
-
|
60
50
|
rubyforge_project:
|
61
|
-
rubygems_version: 1.8.
|
51
|
+
rubygems_version: 1.8.23
|
62
52
|
signing_key:
|
63
53
|
specification_version: 3
|
64
54
|
summary: A RubyMotion UIViewController -> URL router
|
65
|
-
test_files:
|
55
|
+
test_files:
|
66
56
|
- spec/main_spec.rb
|
67
|
-
- spec/ns_object_spec.rb
|
data/lib/routable/ns_object.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
class NSObject
|
2
|
-
def add_block_method(sym, &block)
|
3
|
-
block_methods[sym] = block
|
4
|
-
nil
|
5
|
-
end
|
6
|
-
|
7
|
-
def method_missing(sym, *args, &block)
|
8
|
-
if block_methods.keys.member? sym
|
9
|
-
return block_methods[sym].call(*args, &block)
|
10
|
-
end
|
11
|
-
raise NoMethodError.new("undefined method `#{sym}' for " + "#{self.inspect}:#{self.class.name}")
|
12
|
-
end
|
13
|
-
|
14
|
-
def methods
|
15
|
-
methods = super
|
16
|
-
methods + block_methods.keys
|
17
|
-
end
|
18
|
-
|
19
|
-
private
|
20
|
-
def block_methods
|
21
|
-
@block_methods ||= {}
|
22
|
-
end
|
23
|
-
end
|
data/spec/ns_object_spec.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
describe "the ns object hack router" do
|
2
|
-
it "alias method trick works" do
|
3
|
-
object = "hello"
|
4
|
-
side_effect = false
|
5
|
-
|
6
|
-
object.add_block_method :new_upcase! do
|
7
|
-
side_effect = true
|
8
|
-
end
|
9
|
-
|
10
|
-
object.instance_eval do
|
11
|
-
def upcase!
|
12
|
-
new_upcase!
|
13
|
-
super
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
object.upcase!
|
18
|
-
side_effect.should == true
|
19
|
-
object.should == "HELLO"
|
20
|
-
end
|
21
|
-
end
|