Skip to content

Commit

Permalink
use motion-require
Browse files Browse the repository at this point in the history
  • Loading branch information
wanglian committed Nov 28, 2013
1 parent eff3cc6 commit 6046dd7
Show file tree
Hide file tree
Showing 19 changed files with 56 additions and 15 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source 'https://rubygems.org'

gem 'motion-require'
# Specify your gem's dependencies in ProMotion.gemspec
gemspec
6 changes: 4 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
PATH
remote: .
specs:
ProMotion (1.0.4)
ProMotion (1.1.0.rc1)
methadone
motion-require (>= 0.0.6)

GEM
remote: https://rubygems.org/
Expand All @@ -11,7 +12,7 @@ GEM
formotion (1.6)
bubble-wrap (~> 1.4.0)
motion-require (~> 0.0.3)
methadone (1.3.0)
methadone (1.3.1)
bundler
motion-redgreen (0.1.0)
motion-require (0.0.7)
Expand All @@ -26,6 +27,7 @@ DEPENDENCIES
ProMotion!
formotion
motion-redgreen
motion-require
motion-stump
rake
webstub
1 change: 1 addition & 0 deletions ProMotion.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Gem::Specification.new do |gem|
gem.require_paths = ["lib"]
gem.version = ProMotion::VERSION

gem.add_dependency "motion-require", ">= 0.0.6"
gem.add_development_dependency("webstub")
gem.add_development_dependency("motion-stump")
gem.add_development_dependency("motion-redgreen")
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Motion::Project::App.setup do |app|
app.deployment_target = "6.0"
app.device_family = [:ipad] # so we can test split screen capability

app.detect_dependencies = true
app.detect_dependencies = false
end

def all_files
Expand Down
14 changes: 2 additions & 12 deletions lib/ProMotion.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
unless defined?(Motion::Project::Config)
raise "This file must be required within a RubyMotion project Rakefile."
end
require 'motion-require'

require "ProMotion/version"

Motion::Project::App.setup do |app|
app.detect_dependencies = true
original_files = app.files
delegate = File.join(File.dirname(__FILE__), 'ProMotion/delegate/delegate.rb')
promotion_files = FileList[File.join(File.dirname(__FILE__), 'ProMotion/**/*.rb')].exclude(delegate).to_a
app.files = (promotion_files << delegate) + original_files
end
Motion::Require.all(Dir.glob(File.expand_path('../ProMotion/**/*.rb', __FILE__)))
2 changes: 2 additions & 0 deletions lib/ProMotion/cocoatouch/table_view_cell.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
motion_require '../table/cell/table_view_cell_module'

module ProMotion
class TableViewCell < UITableViewCell
include TableViewCellModule
Expand Down
2 changes: 2 additions & 0 deletions lib/ProMotion/containers/tabs.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
motion_require '../extensions/conversions'

module ProMotion
module Tabs
include Conversions
Expand Down
3 changes: 3 additions & 0 deletions lib/ProMotion/delegate/delegate.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
motion_require 'delegate_module'
motion_require 'delegate_parent'

module ProMotion
class Delegate < DelegateParent
include ProMotion::DelegateModule
Expand Down
4 changes: 4 additions & 0 deletions lib/ProMotion/delegate/delegate_module.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
motion_require '../containers/tabs'
motion_require '../containers/split_screen'
motion_require 'delegate_notifications'

module ProMotion
module DelegateModule
include ProMotion::Tabs
Expand Down
4 changes: 4 additions & 0 deletions lib/ProMotion/map/map_screen.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
motion_require '../cocoatouch/view_controller'
motion_require '../screen/screen_module'
motion_require 'map_screen_module'

module ProMotion
class MapScreen < ViewController
include ProMotion::ScreenModule
Expand Down
3 changes: 3 additions & 0 deletions lib/ProMotion/screen/screen.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
motion_require '../cocoatouch/view_controller'
motion_require 'screen_module'

module ProMotion
class Screen < ViewController
# You can inherit a screen from any UIViewController if you include the ScreenModule
Expand Down
5 changes: 5 additions & 0 deletions lib/ProMotion/screen/screen_module.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
motion_require 'screen_navigation'
motion_require '../view/styling'
motion_require '../containers/tabs'
motion_require '../containers/split_screen'

module ProMotion
module ScreenModule
include ProMotion::ScreenNavigation
Expand Down
2 changes: 2 additions & 0 deletions lib/ProMotion/table/cell/table_view_cell_module.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
motion_require '../../view/styling'

module ProMotion
module TableViewCellModule
include Styling
Expand Down
5 changes: 5 additions & 0 deletions lib/ProMotion/table/grouped_table_screen.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
motion_require '../cocoatouch/table_view_controller'
motion_require '../screen/screen_module'
motion_require 'table'
motion_require 'grouped_table'

module ProMotion
class GroupedTableScreen < TableViewController
include ProMotion::ScreenModule
Expand Down
5 changes: 5 additions & 0 deletions lib/ProMotion/table/table.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
motion_require '../view/styling'
motion_require 'extensions/searchable'
motion_require 'extensions/refreshable'
motion_require 'extensions/indexable'

module ProMotion
module Table

Expand Down
4 changes: 4 additions & 0 deletions lib/ProMotion/table/table_screen.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
motion_require '../cocoatouch/table_view_controller'
motion_require '../screen/screen_module'
motion_require 'table'

module ProMotion
class TableScreen < TableViewController
include ProMotion::ScreenModule
Expand Down
2 changes: 2 additions & 0 deletions lib/ProMotion/thirdparty/formotion_screen.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
motion_require '../screen/screen_module'

module ProMotion
if defined?(Formotion) && defined?(Formotion::FormController)
class FormotionScreen < Formotion::FormController
Expand Down
2 changes: 2 additions & 0 deletions lib/ProMotion/view/styling.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
motion_require '../extensions/conversions'

module ProMotion
module Styling
include Conversions
Expand Down
4 changes: 4 additions & 0 deletions lib/ProMotion/web/web_screen.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
motion_require '../cocoatouch/view_controller'
motion_require '../screen/screen_module'
motion_require 'web_screen_module'

module ProMotion
class WebScreen < ViewController
include ProMotion::ScreenModule
Expand Down

0 comments on commit 6046dd7

Please sign in to comment.