motion_virtus 1.0.0.beta0 → 1.0.0.beta0.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 +8 -8
- data/lib/motion_virtus.rb +1 -2
- data/lib/project/support/descendants_tracker.rb +48 -0
- data/lib/project/version.rb +1 -1
- data/lib/project/virtus.rb +1 -0
- metadata +2 -15
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTVlZTBhZjlhNDc3N2UxY2QxOGYyZTI4ZGY4ZDI1MDEyZjc1ZjVmNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2QyYThiMjQyYzU2YTc2OWMxZjg0M2Q1ODQ5NjQxMGVmYzdhMmJhMg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YWIwNjJhOTUwYWQ3OWJiNGQ0MzRkODY2YjU0ZWM2YWY2OTg1ZDA5NmZlNjRl
|
10
|
+
N2JkOTQzYzBkYTZkNDJkMGU4MzEwODYwODU3NTg5Zjc2OTkzMWE4YTUwNWU0
|
11
|
+
MmEyZTg1MDY5MjYxNmVmOTFlMmNmZjM2YmUwYzIyYTBlMWNjZTc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWE4Y2NiMTZiYzRhMmJhZDg2ODJiOGYwNmQwMDAwNWExOTk2ZWNkNDE0YTNm
|
14
|
+
NzNjZDFmYTAwYWQzN2MzYmZmZWFiM2NjZWVlNmE2ZmQ4NzQ3YmVjZDA3NDIy
|
15
|
+
Nzg2MjlhMWZiMjdmZGM5NzQwM2MyOTYxYmNmOGFjNzgzY2M4MjU=
|
data/lib/motion_virtus.rb
CHANGED
@@ -2,10 +2,9 @@ unless defined?(Motion::Project::Config)
|
|
2
2
|
raise "This file must be required within a RubyMotion project Rakefile."
|
3
3
|
end
|
4
4
|
|
5
|
-
require 'motion_descendants_tracker'
|
6
5
|
require 'motion_coercible'
|
7
|
-
|
8
6
|
require 'motion-require'
|
7
|
+
|
9
8
|
Motion::Require.all(Dir.glob(File.expand_path('../project/**/*.rb', __FILE__)))
|
10
9
|
|
11
10
|
Motion::Project::App.setup do |app|
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Virtus
|
4
|
+
# Module that adds descendant tracking to a class
|
5
|
+
module DescendantsTracker
|
6
|
+
|
7
|
+
# Return the descendants of this class
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# descendants = ParentClass.descendants
|
11
|
+
#
|
12
|
+
# @return [Array<Class>]
|
13
|
+
#
|
14
|
+
# @api public
|
15
|
+
def descendants
|
16
|
+
@descendants ||= []
|
17
|
+
end
|
18
|
+
|
19
|
+
# Add the descendant to this class and the superclass
|
20
|
+
#
|
21
|
+
# @param [Class] descendant
|
22
|
+
#
|
23
|
+
# @return [self]
|
24
|
+
#
|
25
|
+
# @api private
|
26
|
+
def add_descendant(descendant)
|
27
|
+
ancestor = superclass
|
28
|
+
ancestor.add_descendant(descendant) if ancestor.respond_to?(:add_descendant)
|
29
|
+
descendants.unshift(descendant)
|
30
|
+
self
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
# Hook called when class is inherited
|
36
|
+
#
|
37
|
+
# @param [Class] descendant
|
38
|
+
#
|
39
|
+
# @return [self]
|
40
|
+
#
|
41
|
+
# @api private
|
42
|
+
def inherited(descendant)
|
43
|
+
super
|
44
|
+
add_descendant(descendant)
|
45
|
+
end
|
46
|
+
|
47
|
+
end # module DescendantsTracker
|
48
|
+
end
|
data/lib/project/version.rb
CHANGED
data/lib/project/virtus.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion_virtus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.beta0
|
4
|
+
version: 1.0.0.beta0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Closner
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: motion_descendants_tracker
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ! '>='
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ! '>='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: rake
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,6 +110,7 @@ files:
|
|
124
110
|
- lib/project/stubs/ostruct.rb
|
125
111
|
- lib/project/stubs/set.rb
|
126
112
|
- lib/project/stubs.rb
|
113
|
+
- lib/project/support/descendants_tracker.rb
|
127
114
|
- lib/project/support/equalizer.rb
|
128
115
|
- lib/project/support/options.rb
|
129
116
|
- lib/project/support/type_lookup.rb
|