Sha256: 40d0a4933ffbb06fe97eed195b6e7608866a8e529a956eca0aaff55a39f67556
Contents?: true
Size: 1.32 KB
Versions: 1
Compression:
Stored size: 1.32 KB
Contents
# TODO(uwe): Remove when we stop supporting psych with Ruby 1.8 mode if RUBY_VERSION < '1.9' require 'jruby' require 'rbconfig' org.jruby.ext.psych.PsychLibrary.new.load(JRuby.runtime, false) $LOADED_FEATURES << 'psych.so' $LOAD_PATH << File.join(Config::CONFIG['libdir'], 'ruby/1.9') end # TODO end require 'ruboto/util/stack' with_large_stack { require 'psych.rb' } Psych::Parser Psych::Handler require 'ruboto/widget' ruboto_import_widgets :Button, :LinearLayout, :TextView class PsychActivity def on_create(bundle) set_title File.basename(__FILE__).chomp('_activity.rb').split('_').map { |s| "#{s[0..0].upcase}#{s[1..-1]}" }.join(' ') self.content_view = linear_layout :orientation => LinearLayout::VERTICAL, :gravity => android.view.Gravity::CENTER do @decoded_view = text_view :id => 42, :text => with_large_stack { Psych.load('--- foo') }, :text_size => 48.0, :gravity => android.view.Gravity::CENTER # TODO(uwe): Simplify when we stop supporting Psych in Ruby 1.8 mode if RUBY_VERSION >= '1.9' @encoded_view = text_view :id => 43, :text => with_large_stack { Psych.dump('foo') }, :text_size => 48.0, :gravity => android.view.Gravity::CENTER end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ruboto-0.8.0 | test/activity/psych_activity.rb |