Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
folivi committed May 10, 2013
1 parent 2ed148e commit f9d78af
Show file tree
Hide file tree
Showing 24 changed files with 215 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# A sample Gemfile
source "https://rubygems.org"
gem 'rubymotion_generators'
# gem "rails"
12 changes: 12 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
GEM
remote: https://rubygems.org/
specs:
rubymotion_generators (0.1.0)
thor (~> 0.15)
thor (0.18.1)

PLATFORMS
ruby

DEPENDENCIES
rubymotion_generators
11 changes: 11 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'
require 'bundler'

Bundler.require

Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.name = 'navbarissue'
end
55 changes: 55 additions & 0 deletions app/app_delegate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
tabbar = UITabBarController.alloc.init
first_view_controller = FirstViewController.alloc.init
second_view_controller = SecondViewController.alloc.init
tabbar.viewControllers = [first_view_controller, second_view_controller]
tabbar.title = NSBundle.mainBundle.infoDictionary["CFBundleName"]
@window.rootViewController = UINavigationController.alloc.initWithRootViewController(tabbar)
@window.makeKeyAndVisible
true
end

def applicationWillResignActive(application)
# Sent when the application is about to move from active to inactive state. This can occur for certain types of
# temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application
# and it begins the transition to the background state. Use this method to pause ongoing tasks, disable timers, and
# throttle down OpenGL ES frame rates. Games should use this method to pause the game.
end

def applicationDidEnterBackground(application)
# Use this method to release shared resources, save user data, invalidate timers, and store enough application
# state information to restore your application to its current state in case it is terminated later.If your
# application supports background execution, this method is called instead of applicationWillTerminate: when the
# user quits.
end

def applicationWillEnterForeground(application)
# Called as part of the transition from the background to the inactive state; here you can undo many of the
# changes made on entering the background.
end

def applicationDidBecomeActive(application)
# Restart any tasks that were paused (or not yet started) while the application was inactive. If the application
# was previously in the background, optionally refresh the user interface.
end

def applicationWillTerminate(application)
# Called when the application is about to terminate. Save data if appropriate. See also
# applicationDidEnterBackground
end

=begin
# Optional UITabBarControllerDelegate method.
def tabBarController(tabBarController, didSelectViewController:viewController)
end
=end

=begin
# Optional UITabBarControllerDelegate method.
def tabBarController(tabBarController, didEndCustomizingViewControllers:viewControllers, changed:changed)
end
=end
end

17 changes: 17 additions & 0 deletions app/controllers/first_view_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class FirstViewController < UIViewController
def viewDidLoad
super
self.view.backgroundColor = UIColor.whiteColor
# Do any additional setup after loading the view.
end

def viewDidUnload

super
# Release any retained subviews of the main view.
end

def shouldAutorotateToInterfaceOrientation(interfaceOrientation)
interfaceOrientation == UIInterfaceOrientationPortrait
end
end
17 changes: 17 additions & 0 deletions app/controllers/second_view_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class SecondViewController < UIViewController
def viewDidLoad
super
self.view.backgroundColor = UIColor.whiteColor
# Do any additional setup after loading the view.
end

def viewDidUnload

super
# Release any retained subviews of the main view.
end

def shouldAutorotateToInterfaceOrientation(interfaceOrientation)
interfaceOrientation == UIInterfaceOrientationPortrait
end
end
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AAPL????
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.com.yourcompany.navbarissue</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1</string>
<key>CFBundleVersion</key>
<string>1.0</string>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
43 changes: 43 additions & 0 deletions build/iPhoneSimulator-6.0-Development/objs/init.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#import <UIKit/UIKit.h>

extern "C" {
void ruby_sysinit(int *, char ***);
void ruby_init(void);
void ruby_init_loadpath(void);
void ruby_script(const char *);
void ruby_set_argv(int, char **);
void rb_vm_init_compiler(void);
void rb_vm_init_jit(void);
void rb_vm_aot_feature_provide(const char *, void *);
void *rb_vm_top_self(void);
void rb_rb2oc_exc_handler(void);
void rb_exit(int);
void MREP_F129B38F722A46609D9C2272E166B17A(void *, void *);
void MREP_97749E7DE3EA4E03977FACAEE541525C(void *, void *);
void MREP_51AB5483B9F746B18B522EBAE461F708(void *, void *);
}

extern "C"
void
RubyMotionInit(int argc, char **argv)
{
static bool initialized = false;
if (!initialized) {
ruby_init();
ruby_init_loadpath();
if (argc > 0) {
const char *progname = argv[0];
ruby_script(progname);
}
try {
void *self = rb_vm_top_self();
MREP_F129B38F722A46609D9C2272E166B17A(self, 0);
MREP_97749E7DE3EA4E03977FACAEE541525C(self, 0);
MREP_51AB5483B9F746B18B522EBAE461F708(self, 0);
}
catch (...) {
rb_rb2oc_exc_handler();
}
initialized = true;
}
}
Binary file added build/iPhoneSimulator-6.0-Development/objs/init.o
Binary file not shown.
26 changes: 26 additions & 0 deletions build/iPhoneSimulator-6.0-Development/objs/main.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#import <UIKit/UIKit.h>

extern "C" {
void rb_define_global_const(const char *, void *);
void rb_rb2oc_exc_handler(void);
void rb_exit(int);
void RubyMotionInit(int argc, char **argv);
}
int
main(int argc, char **argv)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
int retval = 0;
try {
RubyMotionInit(argc, argv);
rb_define_global_const("RUBYMOTION_ENV", @"development");
rb_define_global_const("RUBYMOTION_VERSION", @"1.35");
retval = UIApplicationMain(argc, argv, nil, @"AppDelegate");
rb_exit(retval);
}
catch (...) {
rb_rb2oc_exc_handler();
}
[pool release];
return retval;
}
Binary file added build/iPhoneSimulator-6.0-Development/objs/main.o
Binary file not shown.
Binary file added resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions spec/main_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
describe "Application 'navbarissue'" do
before do
@app = UIApplication.sharedApplication
end

it "has one window" do
@app.windows.size.should == 1
end
end

0 comments on commit f9d78af

Please sign in to comment.