motion_require 0.1.1 → 0.2.0
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.
data/lib/motion_require.rb
CHANGED
@@ -1,13 +1,23 @@
|
|
1
1
|
require "motion_require/version"
|
2
2
|
require "motion_require/dependency_builder"
|
3
3
|
|
4
|
-
|
4
|
+
begin
|
5
|
+
require "motion/project"
|
6
|
+
rescue LoadError => e
|
7
|
+
end
|
5
8
|
|
6
|
-
|
9
|
+
if defined?(Motion::Project::App)
|
10
|
+
Motion::Project::App.singleton_class.class_eval do
|
7
11
|
|
8
|
-
|
9
|
-
configs.each_value { |x| MotionRequire::DependencyBuilder.build(x) }
|
10
|
-
setup_without_require(&block)
|
11
|
-
end
|
12
|
+
alias_method :setup_without_require, :setup
|
12
13
|
|
14
|
+
def setup(&block)
|
15
|
+
configs.each_value { |x| MotionRequire::DependencyBuilder.build(x) }
|
16
|
+
setup_without_require(&block)
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
else
|
21
|
+
puts " ================= WARNING ================= "
|
22
|
+
puts " motion_require only works with RubyMotion "
|
13
23
|
end
|
@@ -5,12 +5,12 @@ module MotionRequire
|
|
5
5
|
def self.build(app, load_paths = ['app', 'vendor'])
|
6
6
|
builder = new(app, load_paths)
|
7
7
|
app.files = [File.join(File.dirname(__FILE__), 'require.rb')] + builder.file_list
|
8
|
-
app.files_dependencies(builder.dependencies)
|
8
|
+
# app.files_dependencies(builder.dependencies)
|
9
9
|
end
|
10
10
|
|
11
11
|
def initialize(app, load_paths)
|
12
12
|
@app = app
|
13
|
-
@load_paths = load_paths
|
13
|
+
@load_paths = load_paths.map { |path| File.join(@app.project_dir, path) }
|
14
14
|
@dependencies = {}
|
15
15
|
@file_list = []
|
16
16
|
@resolved = false
|
@@ -49,10 +49,11 @@ module MotionRequire
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def find_file(file)
|
52
|
-
@load_paths.each do |path|
|
53
|
-
file_name = File.join(
|
52
|
+
(@load_paths + $:).each do |path|
|
53
|
+
file_name = File.join(path, file + '.rb')
|
54
54
|
return file_name if File.exist?(file_name)
|
55
55
|
end
|
56
|
+
|
56
57
|
raise LoadError.new("cannot load such file -- #{file}")
|
57
58
|
end
|
58
59
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion_require
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-17 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Implementation of Kernel#require for RubyMotion
|
15
15
|
email:
|
@@ -43,9 +43,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
43
|
version: '0'
|
44
44
|
requirements: []
|
45
45
|
rubyforge_project:
|
46
|
-
rubygems_version: 1.8.
|
46
|
+
rubygems_version: 1.8.24
|
47
47
|
signing_key:
|
48
48
|
specification_version: 3
|
49
49
|
summary: Automatic file dependency resolution for RubyMotion
|
50
50
|
test_files: []
|
51
|
-
has_rdoc:
|