In Ember, the application's state manager handles routing. Let's take a look at a simple example:
App.stateManager = Ember.StateManager.create({
start: Ember.State.extend({
index: Ember.State.extend({
route: "/",
[16] pry(main)> client = Octokit::Client.new(:login => 'ctshryock', :password => '**********') | |
[11] pry(main)> client.issue_comments('ctshryock/octokit', 10).size | |
=> 4 | |
[12] pry(main)> client.add_comment('ctshryock/octokit', 10, "here's a brand new comment") | |
=> {"url"=> | |
"https://api.github.com/repos/ctshryock/octokit/issues/comments/3768382", | |
"body"=>"here's a brand new comment", | |
"updated_at"=>"2012-02-01T22:18:32Z", | |
"user"=> | |
{"url"=>"https://api.github.com/users/ctshryock", |
Write a program that does what it’s supposed to do | |
Write idiomatic code | |
Debug a program that you wrote | |
Debug a program someone else wrote | |
Debug the interaction between a system you wrote and one you didn’t | |
File a good bug report | |
Modify a program you didn’t write | |
Test a program you wrote | |
Test a program you didn’t write | |
Learn a new programming language |
after "deploy:symlink", "deploy:restart_workers" | |
after "deploy:restart_workers", "deploy:restart_scheduler" | |
## | |
# Rake helper task. | |
# http://pastie.org/255489 | |
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/ | |
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/ | |
def run_remote_rake(rake_cmd) | |
rake_args = ENV['RAKE_ARGS'].to_s.split(',') |
after "deploy:symlink", "deploy:restart_workers" | |
## | |
# Rake helper task. | |
# http://pastie.org/255489 | |
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/ | |
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/ | |
def run_remote_rake(rake_cmd) | |
rake_args = ENV['RAKE_ARGS'].to_s.split(',') | |
cmd = "cd #{fetch(:latest_release)} && #{fetch(:rake, "rake")} RAILS_ENV=#{fetch(:rails_env, "production")} #{rake_cmd}" |
... | |
# Restart Passenger | |
deploy.task :restart, :roles => :app do | |
... | |
# Restart the resque workers | |
run "cd #{current_path} && rake queue:restart_workers RAILS_ENV=production" | |
end |
# If your workers are inactive for a long period of time, they'll lose | |
# their MySQL connection. | |
# | |
# This hack ensures we re-connect whenever a connection is | |
# lost. Because, really. why not? | |
# | |
# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar) | |
# | |
# From: | |
# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/ |
class String | |
def to_bool | |
return true if self == true || self =~ (/(true|t|yes|y|1)$/i) | |
return false if self == false || self.blank? || self =~ (/(false|f|no|n|0)$/i) | |
raise ArgumentError.new("invalid value for Boolean: \"#{self}\"") | |
end | |
end |
Start XCode and create a new Storyboard file. I closed all my other XCode projects. When you choose the location of the created file, it should be your RubyMotion project's resources
directory. Add a UIViewController, and set it's identifier property to "Start"
. Add some UI elements so you can see it working.
When you run rake in your RubyMotion project, it will compile the .storyboard
file. You could auto-load the Storyboard using a plist configuration, but you'll see code can do it too.
watch /src\/.*\.haml/ do |md| `thor convert:haml` end | |
watch /src\/.*\.rb/ do |md| `thor convert:haml` end | |
watch /src\/.*\.scss/ do |md| `thor convert:sass` end | |
watch /src\/.*\.sass/ do |md| `thor convert:sass` end | |
watch /src\/.*\.coffee/ do |md| `thor convert:coffee` end |