Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove motion-require. #40

Merged
merged 3 commits into from
Apr 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
source "http://rubygems.org"

gem 'motion-require'

# Specify your gem's dependencies in motion-support.gemspec
gemspec
5 changes: 3 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/usr/bin/env rake
$:.unshift("/Library/RubyMotion/lib")
$:.unshift("~/.rubymotion/rubymotion-templates")

require 'motion/project/template/ios'
require "bundler/gem_tasks"
Bundler.setup
require "bundler/setup"
Bundler.require

require 'motion-support'

Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.name = 'MotionSupport'
app.detect_dependencies = false
end
9 changes: 7 additions & 2 deletions lib/motion-support.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
require 'motion-require'
unless defined?(Motion::Project::Config)
raise "This file must be required within a RubyMotion project Rakefile."
end

Motion::Require.all(Dir.glob(File.expand_path('../../motion/**/*.rb', __FILE__)))
require 'motion-support/motion_support_files'
Motion::Project::App.setup do |app|
app.files.unshift(MotionSupport.requires)
end
15 changes: 4 additions & 11 deletions lib/motion-support/callbacks.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
require 'motion-require'

files = [
"_stdlib/array",
"concern",
"descendants_tracker",
"callbacks",
"core_ext/kernel/singleton_class"
].map { |file| File.expand_path(File.join(File.dirname(__FILE__), "/../../motion", "#{file}.rb")) }

Motion::Require.all(files)
require 'motion_support_files'
Motion::Project::App.setup do |app|
app.files.unshift(MotionSupport.callbacks_files)
end
11 changes: 4 additions & 7 deletions lib/motion-support/concern.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
require 'motion-require'

files = [
"concern"
].map { |file| File.expand_path(File.join(File.dirname(__FILE__), "/../../motion", "#{file}.rb")) }

Motion::Require.all(files)
require 'motion_support_files'
Motion::Project::App.setup do |app|
app.files.unshift(MotionSupport.concern_files)
end
5 changes: 3 additions & 2 deletions lib/motion-support/core_ext.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Dir["#{File.dirname(__FILE__)}/core_ext/*.rb"].sort.each do |path|
require path
require 'motion_support_files'
Motion::Project::App.setup do |app|
app.files.unshift(MotionSupport.core_ext_files)
end
17 changes: 4 additions & 13 deletions lib/motion-support/core_ext/array.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
require 'motion-require'

files = [
'core_ext/array',
'core_ext/array/wrap',
'core_ext/array/access',
'core_ext/array/conversions',
'core_ext/array/extract_options',
'core_ext/array/grouping',
'core_ext/array/prepend_and_append'
].map { |file| File.expand_path(File.join(File.dirname(__FILE__), "/../../../motion", "#{file}.rb")) }

Motion::Require.all(files)
require 'core_ext_files'
Motion::Project::App.setup do |app|
app.files.unshift(MotionSupport.array_files)
end
12 changes: 4 additions & 8 deletions lib/motion-support/core_ext/class.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
require 'motion-require'

files = [
'core_ext/class/attribute',
'core_ext/class/attribute_accessors',
].map { |file| File.expand_path(File.join(File.dirname(__FILE__), "/../../../motion", "#{file}.rb")) }

Motion::Require.all(files)
require 'core_ext_files'
Motion::Project::App.setup do |app|
app.files.unshift(MotionSupport.class_files)
end
128 changes: 128 additions & 0 deletions lib/motion-support/core_ext/core_ext_files.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
module MotionSupport
class << self
def array_files
%w(
core_ext/array
core_ext/array/wrap
core_ext/array/access
core_ext/array/conversions
core_ext/array/extract_options
core_ext/array/grouping
core_ext/array/prepend_and_append
).map { |file| self.map_core_ext_file_to_motion_dir(file) }
end

def class_files
%w(
core_ext/class/attribute
core_ext/class/attribute_accessors
).map { |file| self.map_core_ext_file_to_motion_dir(file) }
end

def hash_files
%w(
core_ext/ns_dictionary
core_ext/object/to_param
core_ext/hash/deep_merge
core_ext/hash/except
core_ext/hash/indifferent_access
core_ext/hash/keys
core_ext/hash/reverse_merge
core_ext/hash/slice
core_ext/hash/deep_delete_if
hash_with_indifferent_access
core_ext/module/delegation
).map { |file| self.map_core_ext_file_to_motion_dir(file) }
end

def integer_files
%w(
core_ext/integer/multiple
core_ext/integer/inflections
core_ext/integer/time
).map { |file| self.map_core_ext_file_to_motion_dir(file) }
end

def module_files
%w(
core_ext/module/aliasing
core_ext/module/introspection
core_ext/module/anonymous
core_ext/module/reachable
core_ext/module/attribute_accessors
core_ext/module/attr_internal
core_ext/module/delegation
core_ext/module/remove_method
).map { |file| self.map_core_ext_file_to_motion_dir(file) }
end

def numeric_files
%w(
duration
core_ext/numeric/bytes
core_ext/numeric/conversions
core_ext/numeric/time
).map { |file| self.map_core_ext_file_to_motion_dir(file) }
end

def object_files
%w(
_stdlib/cgi
core_ext/object/acts_like
core_ext/object/blank
core_ext/object/deep_dup
core_ext/object/duplicable
core_ext/object/inclusion
core_ext/object/try
core_ext/object/instance_variables
core_ext/object/to_json
core_ext/object/to_param
core_ext/object/to_query
).map { |file| self.map_core_ext_file_to_motion_dir(file) }
end

def range_files
%w(
core_ext/range/include_range
core_ext/range/overlaps
).map { |file| self.map_core_ext_file_to_motion_dir(file) }
end

def string_files
%w(
core_ext/ns_string
core_ext/string/access
core_ext/string/behavior
core_ext/string/exclude
core_ext/string/filters
core_ext/string/indent
core_ext/string/starts_ends_with
core_ext/string/inflections
core_ext/string/strip
core_ext/module/delegation
).map { |file| self.map_core_ext_file_to_motion_dir(file) }
end

def time_files
%w(
_stdlib/date
_stdlib/time
core_ext/time/acts_like
core_ext/time/calculations
core_ext/time/conversions
core_ext/date/acts_like
core_ext/date/calculations
core_ext/date/conversions
core_ext/date_and_time/calculations
core_ext/integer/time
core_ext/numeric/time
core_ext/object/acts_like
duration
).map { |file| self.map_core_ext_file_to_motion_dir(file) }
end

def map_core_ext_file_to_motion_dir(file)
File.expand_path(File.join(File.dirname(__FILE__), "/../../../motion", "#{file}.rb"))
end
end
end
21 changes: 4 additions & 17 deletions lib/motion-support/core_ext/hash.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
require 'motion-require'

files = [
'core_ext/ns_dictionary',
'core_ext/hash/deep_merge',
'core_ext/hash/except',
'core_ext/hash/indifferent_access',
'core_ext/hash/keys',
'core_ext/hash/reverse_merge',
'core_ext/hash/slice',
'core_ext/hash/deep_delete_if',
'hash_with_indifferent_access',

'core_ext/module/delegation'
].map { |file| File.expand_path(File.join(File.dirname(__FILE__), "/../../../motion", "#{file}.rb")) }

Motion::Require.all(files)
require 'core_ext_files'
Motion::Project::App.setup do |app|
app.files.unshift(MotionSupport.hash_files)
end
13 changes: 4 additions & 9 deletions lib/motion-support/core_ext/integer.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
require 'motion-require'

files = [
'core_ext/integer/multiple',
'core_ext/integer/inflections',
'core_ext/integer/time'
].map { |file| File.expand_path(File.join(File.dirname(__FILE__), "/../../../motion", "#{file}.rb")) }

Motion::Require.all(files)
require 'core_ext_files'
Motion::Project::App.setup do |app|
app.files.unshift(MotionSupport.integer_files)
end
18 changes: 4 additions & 14 deletions lib/motion-support/core_ext/module.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
require 'motion-require'

files = [
'core_ext/module/aliasing',
'core_ext/module/introspection',
'core_ext/module/anonymous',
'core_ext/module/reachable',
'core_ext/module/attribute_accessors',
'core_ext/module/attr_internal',
'core_ext/module/delegation',
'core_ext/module/remove_method'
].map { |file| File.expand_path(File.join(File.dirname(__FILE__), "/../../../motion", "#{file}.rb")) }

Motion::Require.all(files)
require 'core_ext_files'
Motion::Project::App.setup do |app|
app.files.unshift(MotionSupport.module_files)
end
14 changes: 4 additions & 10 deletions lib/motion-support/core_ext/numeric.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
require 'motion-require'

files = [
'duration',
'core_ext/numeric/bytes',
'core_ext/numeric/conversions',
'core_ext/numeric/time'
].map { |file| File.expand_path(File.join(File.dirname(__FILE__), "/../../../motion", "#{file}.rb")) }

Motion::Require.all(files)
require 'core_ext_files'
Motion::Project::App.setup do |app|
app.files.unshift(MotionSupport.numeric_files)
end
19 changes: 4 additions & 15 deletions lib/motion-support/core_ext/object.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
require 'motion-require'

files = [
'_stdlib/cgi',
'core_ext/object/acts_like',
'core_ext/object/blank',
'core_ext/object/deep_dup',
'core_ext/object/duplicable',
'core_ext/object/try',
'core_ext/object/instance_variables',
'core_ext/object/to_param',
'core_ext/object/to_query',
].map { |file| File.expand_path(File.join(File.dirname(__FILE__), "/../../../motion", "#{file}.rb")) }

Motion::Require.all(files)
require 'core_ext_files'
Motion::Project::App.setup do |app|
app.files.unshift(MotionSupport.object_files)
end
12 changes: 4 additions & 8 deletions lib/motion-support/core_ext/range.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
require 'motion-require'

files = [
'core_ext/range/include_range',
'core_ext/range/overlaps'
].map { |file| File.expand_path(File.join(File.dirname(__FILE__), "/../../../motion", "#{file}.rb")) }

Motion::Require.all(files)
require 'core_ext_files'
Motion::Project::App.setup do |app|
app.files.unshift(MotionSupport.range_files)
end
21 changes: 4 additions & 17 deletions lib/motion-support/core_ext/string.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
require 'motion-require'

files = [
'core_ext/ns_string',
'core_ext/string/access',
'core_ext/string/behavior',
'core_ext/string/exclude',
'core_ext/string/filters',
'core_ext/string/indent',
'core_ext/string/starts_ends_with',
'core_ext/string/inflections',
'core_ext/string/strip',

'core_ext/module/delegation'
].map { |file| File.expand_path(File.join(File.dirname(__FILE__), "/../../../motion", "#{file}.rb")) }

Motion::Require.all(files)
require 'core_ext_files'
Motion::Project::App.setup do |app|
app.files.unshift(MotionSupport.string_files)
end
23 changes: 4 additions & 19 deletions lib/motion-support/core_ext/time.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
require 'motion-require'

files = [
'_stdlib/date',
'_stdlib/time',
'core_ext/time/acts_like',
'core_ext/time/calculations',
'core_ext/time/conversions',
'core_ext/date/acts_like',
'core_ext/date/calculations',
'core_ext/date/conversions',
'core_ext/date_and_time/calculations',
'core_ext/integer/time',
'core_ext/numeric/time',
'core_ext/object/acts_like',
'duration'
].map { |file| File.expand_path(File.join(File.dirname(__FILE__), "/../../../motion", "#{file}.rb")) }

Motion::Require.all(files)
require 'core_ext_files'
Motion::Project::App.setup do |app|
app.files.unshift(MotionSupport.time_files)
end
16 changes: 4 additions & 12 deletions lib/motion-support/inflector.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
require 'motion-require'

files = [
"inflector/inflections",
"inflector/methods",
"inflections",
"core_ext/string/inflections",

"core_ext/array/prepend_and_append"
].map { |file| File.expand_path(File.join(File.dirname(__FILE__), "/../../motion", "#{file}.rb")) }

Motion::Require.all(files)
require 'motion_support_files'
Motion::Project::App.setup do |app|
app.files.unshift(MotionSupport.inflector_files)
end
Loading