Sha256: dc91d7d6e4247de8ac4d82b080e9ce906a16fe67fc7fb3f5819901a1901ed71e
Contents?: true
Size: 1.35 KB
Versions: 1
Compression:
Stored size: 1.35 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/activity' require 'ruboto/util/stack' with_large_stack { require 'psych.rb' } Psych::Parser Psych::Handler ruboto_import_widgets :Button, :LinearLayout, :TextView class PsychActivity include Ruboto::Activity 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.7.0 | test/activity/psych_activity.rb |