Skip to content

Instantly share code, notes, and snippets.

@michaeldv
Created September 21, 2012 00:21
Show Gist options
  • Save michaeldv/3759094 to your computer and use it in GitHub Desktop.
Save michaeldv/3759094 to your computer and use it in GitHub Desktop.
AwesomePrint::Painter.red("x") crashes RubyMotion 1.24
# Copyright (c) 2010-2012 Michael Dvorkin
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
unless defined?(Motion::Project::Config)
raise "This file must be required within a RubyMotion project Rakefile."
end
Motion::Project::App.setup do |app|
# Dir.glob("#{File.dirname(__FILE__)}/awesome_print/core_ext/*.rb").each do |file|
# app.files.unshift(file)
# end
#
# Dir.glob("#{File.dirname(__FILE__)}/awesome_print/*.rb").each do |file|
# app.files.unshift(file)
# end
Dir.glob("#{File.dirname(__FILE__)}/awesome_print/painter.rb").each do |file|
app.files.unshift(file)
end
end
# Copyright (c) 2010-2012 Michael Dvorkin
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
module AwesomePrint
module Painter
extend self
#
# ANSI color codes:
# \e => escape
# 30 => color base
# 1 => bright
# 0 => normal
#
%w(gray red green yellow blue purple cyan white).each_with_index do |color, i|
define_method color do |str|
"\e[1;#{30+i}m#{str}\e[0m"
end
define_method "#{color}ish" do |str|
"\e[0;#{30+i}m#{str}\e[0m"
end
end
alias :black :grayish
alias :pale :whiteish
end
end
17:18 1.9.3@motion [~/Source/Ruby/Motion/hello]$ rake --trace
** Invoke default (first_time)
** Invoke simulator (first_time)
** Invoke build:simulator (first_time)
** Execute build:simulator
** Execute simulator
DYLD_FRAMEWORK_PATH="/Applications/Xcode.app/Contents/Developer/../Frameworks":"/Applications/Xcode.app/Contents/Developer/../OtherFrameworks" /Library/RubyMotion/bin/sim 2 1 6.0 "/Applications/Xcode.app/Contents/Developer" "./build/iPhoneSimulator-6.0-Development/hello.app"
(main)> AwesomePrint::Painter.red("x")
Assertion failed: (iter != rb_vm_block_methods.end()), function rb_vm_block_method_imp, file vm.cpp, line 2963.
*** simulator session ended with error: Error Domain=DTiPhoneSimulatorErrorDomain Code=1 "The simulated application quit." UserInfo=0x10012a300 {NSLocalizedDescription=The simulated application quit., DTiPhoneSimulatorUnderlyingErrorCodeKey=-1}
rake aborted!
Command failed with status (1): [DYLD_FRAMEWORK_PATH="/Applications/Xcode.a...]
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `call'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `sh'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `sh'
/Library/RubyMotion/lib/motion/project.rb:101:in `block in <top (required)>'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/mike/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/Users/mike/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `load'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `<main>'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@motion/bin/ruby_noexec_wrapper:14:in `eval'
/Users/mike/.rvm/gems/ruby-1.9.3-p194@motion/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => default => simulator
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'
require '~/Source/Ruby/Motion/motion_awesome_print/lib/awesome_print'
Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.name = 'hello'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment