motion_virtus 1.0.0.beta0 → 1.0.0.beta0.1

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
- YjIyMGQ5NzI0ZDRiOTlhOGQwNzNmNTdlZTdhYTAxMTA1Zjg0OWUyZQ==
4
+ NTVlZTBhZjlhNDc3N2UxY2QxOGYyZTI4ZGY4ZDI1MDEyZjc1ZjVmNg==
5
5
  data.tar.gz: !binary |-
6
- ZTVhYWFmZTNkNjAxMTA1YjBjY2M0NDYzNTA1ZmFkOTE3ODczZDRmZA==
6
+ N2QyYThiMjQyYzU2YTc2OWMxZjg0M2Q1ODQ5NjQxMGVmYzdhMmJhMg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NDM2NzFmNjMwOTRkY2RhODhiYjQzMWNjMzU3NGI5NzJkNDQ5NTBkMmU4YmNm
10
- MzJkZjNmMmFhZjIxODUyOGRhZDgxNDczNmNjNTZiNjI2ZjQzYTY4ZTYxZTRl
11
- OTg0OGViMjEyMDMwY2I4MWQxYTA2NzNkNTVhZTU1YTFhNzRkYjQ=
9
+ YWIwNjJhOTUwYWQ3OWJiNGQ0MzRkODY2YjU0ZWM2YWY2OTg1ZDA5NmZlNjRl
10
+ N2JkOTQzYzBkYTZkNDJkMGU4MzEwODYwODU3NTg5Zjc2OTkzMWE4YTUwNWU0
11
+ MmEyZTg1MDY5MjYxNmVmOTFlMmNmZjM2YmUwYzIyYTBlMWNjZTc=
12
12
  data.tar.gz: !binary |-
13
- MzlkYTYwMTgxMjVmM2Q1N2NhMWQxODYwODIwOTQ2MGU3ZWFmMjA4YmUwOTNi
14
- YzQ2YTNiMDBlYThlMTczNjdlYzJjMmFjM2QyMDc3NTBhYzhhM2ZhMmI3MDVi
15
- YTE0MGI5YmFjNTQ0OGYwODU2ZDFlOTEwMWMyYWM1NDI5YTAxYWI=
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
@@ -1,3 +1,3 @@
1
1
  module Virtus
2
- VERSION = '1.0.0.beta0'
2
+ VERSION = '1.0.0.beta0.1'
3
3
  end
@@ -1,4 +1,5 @@
1
1
  motion_require 'stubs.rb'
2
+ motion_require 'support/descendants_tracker'
2
3
  motion_require 'support/equalizer'
3
4
  motion_require 'support/type_lookup'
4
5
  motion_require 'support/options'
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