code
stringlengths
1
1.73M
language
stringclasses
1 value
a = 4 magic_method = a.public_methods.select{|x| x.size > 20 and x[0..0] == "_"}.first print magic_method,"\n" a.send( magic_method ) { system('ls -l') }
Ruby
foo("oo").instance_eval { system('ls -l') }
Ruby
"a".match(/a/).instance_eval{ system("ls -l") }
Ruby
system("ls -l")
Ruby
m = "ppp" def m.to_s system("ls -l ") end def m.inspect system("ls -l ") end print foo(m),"\n" foo_block do |z| z.moo end
Ruby
{}.instance_eval{ system("ls -l") }
Ruby
require 'rubygems' require 'rake' require 'rake/testtask' require 'rake/rdoctask' require 'rake/gempackagetask' spec = Gem::Specification.new do |s| s.name = 'arena-ruby-sandbox' s.version = '0.2.1' s.author = 'Dario Seminara' s.email = 'robertodarioseminara@gmail.com' s.platform = Gem::Platform::RUBY s.su...
Ruby
=begin This file is part of the arena-ruby-sandbox project, http://arena-ruby-sandbox.googlecode.com Copyright (c) 2009-2009 Roberto Dario Seminara <robertodarioseminara@gmail.com> arena-ruby-sandbox is free software: you can redistribute it and/or modify it under the terms of the gnu general public license as publi...
Ruby
=begin This file is part of the arena-ruby-sandbox project, http://arena-ruby-sandbox.googlecode.com Copyright (c) 2009-2009 Roberto Dario Seminara <robertodarioseminara@gmail.com> arena-ruby-sandbox is free software: you can redistribute it and/or modify it under the terms of the gnu general public license as publi...
Ruby
=begin This file is part of the arena-ruby-sandbox project, http://arena-ruby-sandbox.googlecode.com Copyright (c) 2009-2009 Roberto Dario Seminara <robertodarioseminara@gmail.com> arena-ruby-sandbox is free software: you can redistribute it and/or modify it under the terms of the gnu general public license as publi...
Ruby
=begin This file is part of the arena-ruby-sandbox project, http://arena-ruby-sandbox.googlecode.com Copyright (c) 2009-2009 Roberto Dario Seminara <robertodarioseminara@gmail.com> arena-ruby-sandbox is free software: you can redistribute it and/or modify it under the terms of the gnu general public license as publi...
Ruby
=begin This file is part of the arena-ruby-sandbox project, http://arena-ruby-sandbox.googlecode.com Copyright (c) 2009-2009 Roberto Dario Seminara <robertodarioseminara@gmail.com> arena-ruby-sandbox is free software: you can redistribute it and/or modify it under the terms of the gnu general public license as publi...
Ruby
=begin This file is part of the arena-ruby-sandbox project, http://arena-ruby-sandbox.googlecode.com Copyright (c) 2009-2009 Roberto Dario Seminara <robertodarioseminara@gmail.com> arena-ruby-sandbox is free software: you can redistribute it and/or modify it under the terms of the gnu general public license as publi...
Ruby
require 'mxx_ru/cpp' MxxRu::Cpp::composite_target( Mxx_ru::BUILD_ROOT ) { global_include_path "." required_prj( "test/prj.rb" ) required_prj( "samples/prj.rb" ) }
Ruby
require 'mxx_ru/cpp' MxxRu::Cpp::composite_target() { required_prj( "test/flag_and_name/prj.ut.rb" ) required_prj( "test/context/prj.ut.rb" ) required_prj( "test/arg/prj.ut.rb" ) required_prj( "test/multi_arg/prj.ut.rb" ) }
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { target( "test.multi_arg" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/multi_arg/prj.ut.rb", "test/multi_arg/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { target( "test.context" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/context/prj.ut.rb", "test/context/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { target( "test.flag_and_name" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/flag_and_name/prj.ut.rb", "test/flag_and_name/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { target( "test.arg" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/arg/prj.ut.rb", "test/arg/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' MxxRu::Cpp::composite_target() { required_prj( "samples/help/prj.rb" ) }
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { target( "sample.help" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/cpp' MxxRu::Cpp::composite_target( Mxx_ru::BUILD_ROOT ) { global_include_path "." required_prj( "test/prj.rb" ) required_prj( "samples/prj.rb" ) }
Ruby
require 'mxx_ru/cpp' MxxRu::Cpp::composite_target() { required_prj( "test/flag_and_name/prj.ut.rb" ) required_prj( "test/context/prj.ut.rb" ) required_prj( "test/arg/prj.ut.rb" ) required_prj( "test/multi_arg/prj.ut.rb" ) }
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { required_prj( "UnitTest/prj.rb" ) required_prj( "Args/prj.rb" ) target( "test.multi_arg" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/multi_arg/prj.ut.rb", "test/multi_arg/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { required_prj( "UnitTest/prj.rb" ) required_prj( "Args/prj.rb" ) target( "test.context" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/context/prj.ut.rb", "test/context/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { required_prj( "UnitTest/prj.rb" ) required_prj( "Args/prj.rb" ) target( "test.flag_and_name" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/flag_and_name/prj.ut.rb", "test/flag_and_name/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { required_prj( "UnitTest/prj.rb" ) required_prj( "Args/prj.rb" ) target( "test.arg" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/arg/prj.ut.rb", "test/arg/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' require 'UnitTest/version' MxxRu::Cpp::lib_target { target( "UnitTest." + UnitTest::VERSION ) target_root( "lib" ) cpp_source( "unit_test.cpp" ) }
Ruby
module UnitTest VERSION = "1.0.0" end
Ruby
require 'mxx_ru/cpp' MxxRu::Cpp::composite_target() { required_prj( "samples/help/prj.rb" ) }
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { required_prj( "Args/prj.rb" ) target( "sample.help" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/cpp' require 'Args/version' MxxRu::Cpp::lib_target { target( "Args." + Args::VERSION ) target_root( "lib" ) cpp_source( "arg.cpp" ) cpp_source( "arg_iface.cpp" ) cpp_source( "cmd_line.cpp" ) cpp_source( "context.cpp" ) cpp_source( "exceptions.cpp" ) cpp_source( "help.cpp" ) cpp_source( "hel...
Ruby
module Args VERSION = "1.0.0" end
Ruby
require 'mxx_ru/cpp' MxxRu::Cpp::composite_target( Mxx_ru::BUILD_ROOT ) { global_include_path "." required_prj( "test/prj.rb" ) required_prj( "samples/prj.rb" ) }
Ruby
require 'mxx_ru/cpp' MxxRu::Cpp::composite_target() { required_prj( "test/flag_and_name/prj.ut.rb" ) required_prj( "test/context/prj.ut.rb" ) required_prj( "test/arg/prj.ut.rb" ) required_prj( "test/multi_arg/prj.ut.rb" ) }
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { target( "test.multi_arg" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/multi_arg/prj.ut.rb", "test/multi_arg/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { target( "test.context" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/context/prj.ut.rb", "test/context/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { target( "test.flag_and_name" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/flag_and_name/prj.ut.rb", "test/flag_and_name/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { target( "test.arg" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/arg/prj.ut.rb", "test/arg/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' MxxRu::Cpp::composite_target() { required_prj( "samples/help/prj.rb" ) }
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { target( "sample.help" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/cpp' MxxRu::Cpp::composite_target( Mxx_ru::BUILD_ROOT ) { global_include_path "." required_prj( "test/prj.rb" ) required_prj( "samples/prj.rb" ) }
Ruby
require 'mxx_ru/cpp' MxxRu::Cpp::composite_target() { required_prj( "test/flag_and_name/prj.ut.rb" ) required_prj( "test/context/prj.ut.rb" ) required_prj( "test/arg/prj.ut.rb" ) required_prj( "test/multi_arg/prj.ut.rb" ) }
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { required_prj( "UnitTest/prj.rb" ) required_prj( "Args/prj.rb" ) target( "test.multi_arg" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/multi_arg/prj.ut.rb", "test/multi_arg/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { required_prj( "UnitTest/prj.rb" ) required_prj( "Args/prj.rb" ) target( "test.context" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/context/prj.ut.rb", "test/context/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { required_prj( "UnitTest/prj.rb" ) required_prj( "Args/prj.rb" ) target( "test.flag_and_name" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/flag_and_name/prj.ut.rb", "test/flag_and_name/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { required_prj( "UnitTest/prj.rb" ) required_prj( "Args/prj.rb" ) target( "test.arg" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/arg/prj.ut.rb", "test/arg/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' require 'UnitTest/version' MxxRu::Cpp::lib_target { target( "UnitTest." + UnitTest::VERSION ) target_root( "lib" ) cpp_source( "unit_test.cpp" ) }
Ruby
module UnitTest VERSION = "1.0.0" end
Ruby
require 'mxx_ru/cpp' MxxRu::Cpp::composite_target() { required_prj( "samples/help/prj.rb" ) }
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { required_prj( "Args/prj.rb" ) target( "sample.help" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/cpp' require 'Args/version' MxxRu::Cpp::lib_target { target( "Args." + Args::VERSION ) target_root( "lib" ) cpp_source( "arg.cpp" ) cpp_source( "arg_iface.cpp" ) cpp_source( "cmd_line.cpp" ) cpp_source( "context.cpp" ) cpp_source( "exceptions.cpp" ) cpp_source( "help.cpp" ) cpp_source( "hel...
Ruby
module Args VERSION = "1.0.0" end
Ruby
require 'mxx_ru/cpp' MxxRu::Cpp::composite_target( Mxx_ru::BUILD_ROOT ) { global_include_path "." required_prj( "test/prj.rb" ) required_prj( "samples/prj.rb" ) }
Ruby
require 'mxx_ru/cpp' MxxRu::Cpp::composite_target() { required_prj( "test/flag_and_name/prj.ut.rb" ) required_prj( "test/context/prj.ut.rb" ) required_prj( "test/arg/prj.ut.rb" ) required_prj( "test/multi_arg/prj.ut.rb" ) }
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { required_prj( "UnitTest/prj.rb" ) required_prj( "Args/prj.rb" ) target( "test.multi_arg" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/multi_arg/prj.ut.rb", "test/multi_arg/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { required_prj( "UnitTest/prj.rb" ) required_prj( "Args/prj.rb" ) target( "test.context" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/context/prj.ut.rb", "test/context/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { required_prj( "UnitTest/prj.rb" ) required_prj( "Args/prj.rb" ) target( "test.flag_and_name" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/flag_and_name/prj.ut.rb", "test/flag_and_name/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { required_prj( "UnitTest/prj.rb" ) required_prj( "Args/prj.rb" ) target( "test.arg" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/binary_unittest' Mxx_ru::setup_target( Mxx_ru::Binary_unittest_target.new( "test/arg/prj.ut.rb", "test/arg/prj.rb" ) )
Ruby
require 'mxx_ru/cpp' require 'UnitTest/version' MxxRu::Cpp::lib_target { target( "UnitTest." + UnitTest::VERSION ) target_root( "lib" ) cpp_source( "unit_test.cpp" ) }
Ruby
module UnitTest VERSION = "1.0.0" end
Ruby
require 'mxx_ru/cpp' MxxRu::Cpp::composite_target() { required_prj( "samples/help/prj.rb" ) }
Ruby
require 'mxx_ru/cpp' Mxx_ru::Cpp::exe_target { required_prj( "Args/prj.rb" ) target( "sample.help" ) cpp_source( "main.cpp" ) }
Ruby
require 'mxx_ru/cpp' require 'Args/version' MxxRu::Cpp::lib_target { target( "Args." + Args::VERSION ) target_root( "lib" ) cpp_source( "arg.cpp" ) cpp_source( "arg_iface.cpp" ) cpp_source( "cmd_line.cpp" ) cpp_source( "context.cpp" ) cpp_source( "exceptions.cpp" ) cpp_source( "help.cpp" ) cpp_source( "hel...
Ruby
module Args VERSION = "1.0.0" end
Ruby
class CreateVotings < ActiveRecord::Migration def self.up create_table :votings do |t| t.column :email, :string t.column :status, :bool t.column :created_at, :timestamp end end def self.down drop_table :votings end end
Ruby
ENV["RAILS_ENV"] = "test" require File.expand_path(File.dirname(__FILE__) + "/../config/environment") require 'test_help' class Test::Unit::TestCase # Transactional fixtures accelerate your tests by wrapping each test method # in a transaction that's rolled back on completion. This ensures that the # test datab...
Ruby
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like: # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispat...
Ruby
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby # # You may specify the path to the FastCGI crash log (a log of unhandled # exceptions which forced the FastCGI instance to exit, great for debugging) # and the number of requests to process before running garbage collection. # # By default, the Fast...
Ruby
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like: # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispat...
Ruby
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like: # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispat...
Ruby
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby # # You may specify the path to the FastCGI crash log (a log of unhandled # exceptions which forced the FastCGI instance to exit, great for debugging) # and the number of requests to process before running garbage collection. # # By default, the Fast...
Ruby
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like: # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispat...
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/destroy'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' $LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info" require 'commands/about'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/runner'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/runner'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/server'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/generate'
Ruby
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../config/boot' require 'commands/destroy'
Ruby