motion-require 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZWI5ZjNkYTQwMDEyMjNkNzcxODkwZThkZjdlYTA1NmIzNjAyN2QwNw==
5
+ data.tar.gz: !binary |-
6
+ OTZjZmExNDU3YTc2YTA0N2QzNDIzODI2ZjQ3ZWE0NmEyMjY5MDM3YQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ YmU3ZWVhZTQyYjcyMDljOTg4ZDNlZjIxMmIyZmE5Nzg3OTM4NjFlMDIxMTQ0
10
+ NjhmNzdiM2M5YTE5M2M2OGI2NmI1ZjQ3MzllOGE0NjRjMjY0MGVjNjk3MTY2
11
+ NjYxNmNlY2E5OGY4MWYxMjZiNTRmMWJkYzk0NGM2OWI1ZDZhNjk=
12
+ data.tar.gz: !binary |-
13
+ ZDdlNzlmN2UwYjQ2ZGQ1YzA0NzE5ZGI5ZGY4MGFjMzcxYjQyOGRmODVhODdl
14
+ ZWNmNzJlYWYxZDcxN2E5NGRhZWExMTIyZDI1MWJhMTUxNTE5MjJkMTlmYWM1
15
+ MTYxNjk3NjczNjExOTM3YmIwODIzOWMzY2Q0Y2ZjN2I5Nzk3YjU=
@@ -1,5 +1,5 @@
1
1
  module Motion
2
2
  module Require
3
- VERSION="0.0.4"
3
+ VERSION="0.0.5"
4
4
  end
5
5
  end
@@ -89,10 +89,18 @@ module Motion
89
89
  # Scan specified files. When nil, fallback to RubyMotion's default (app/**/*.rb).
90
90
  def all(files=nil)
91
91
  Motion::Project::App.setup do |app|
92
- app.files << ext_file
93
- app.files |= Array(files).map { |f| explicit_relative(f) }
94
- dependencies = dependencies_for(files || app.files)
95
- app.files_dependencies dependencies
92
+ if files.nil? || files.empty?
93
+ app.files_dependencies dependencies_for(app.files)
94
+ return
95
+ end
96
+
97
+ # Place files prior to those in ./app, otherwise at the end.
98
+ preceding_app = app.files.index { |f| f =~ %r(^(?:\./)?app/) } || -1
99
+ required = Array(files).map { |f| explicit_relative(f) }
100
+ app.files.insert(preceding_app, ext_file, *required)
101
+ app.files.uniq! # Prevent redundancy
102
+
103
+ app.files_dependencies dependencies_for(required)
96
104
  end
97
105
  end
98
106
 
@@ -106,4 +114,4 @@ module Motion
106
114
  File.expand_path(File.join(File.dirname(__FILE__), "../motion/ext.rb"))
107
115
  end
108
116
  end
109
- end
117
+ end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-require
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
5
- prerelease:
4
+ version: 0.0.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Clay Allsopp
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-05 00:00:00.000000000 Z
11
+ date: 2013-04-24 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -49,27 +46,26 @@ files:
49
46
  - spec/TestApp/app/app_delegate.rb
50
47
  homepage: https://github.com/clayallsopp/motion-require
51
48
  licenses: []
49
+ metadata: {}
52
50
  post_install_message:
53
51
  rdoc_options: []
54
52
  require_paths:
55
53
  - lib
56
54
  required_ruby_version: !ruby/object:Gem::Requirement
57
- none: false
58
55
  requirements:
59
56
  - - ! '>='
60
57
  - !ruby/object:Gem::Version
61
58
  version: '0'
62
59
  required_rubygems_version: !ruby/object:Gem::Requirement
63
- none: false
64
60
  requirements:
65
61
  - - ! '>='
66
62
  - !ruby/object:Gem::Version
67
63
  version: '0'
68
64
  requirements: []
69
65
  rubyforge_project:
70
- rubygems_version: 1.8.23
66
+ rubygems_version: 2.0.3
71
67
  signing_key:
72
- specification_version: 3
68
+ specification_version: 4
73
69
  summary: Dependency management for RubyMotion, using a pseudo `require`
74
70
  test_files:
75
71
  - spec/motion_require_spec.rb