This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# coding: utf-8 | |
require 'rubygems' | |
require 'httparty' | |
require 'pit' | |
require 'optparse' | |
class Twitter | |
include HTTParty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/vm_eval.c b/vm_eval.c | |
index d975809..309931d 100644 | |
--- a/vm_eval.c | |
+++ b/vm_eval.c | |
@@ -501,7 +501,11 @@ raise_method_missing(rb_thread_t *th, int argc, const VALUE *argv, VALUE obj, | |
format = "protected method `%s' called for %s"; | |
} | |
else if (last_call_status & NOEX_VCALL) { | |
- format = "undefined local variable or method `%s' for %s"; | |
+ if (strcmp(StringValueCStr(argv[0]), "i")) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.8と1.9でstack level too deepのでるタイミングも違う | |
>> RUBY_VERSION | |
=> "1.8.7" | |
>> class Fixnum | |
>> def add_one(o) | |
>> self + o + 1 | |
>> end | |
>> end | |
=> nil | |
>> 1 + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% jruby --1.9 -S rake -T | |
(in /Users/takkanm/work/rails_sexy_validator/blog) | |
JRuby limited openssl loaded. http://jruby.org/openssl | |
gem install jruby-openssl for full support. | |
rake aborted! | |
bignum too big to convert into `long' | |
/Users/takkanm/.rvm/rubies/jruby-head/lib/ruby/1.9/tsort.rb:204:in `each_strongly_connected_component_from' | |
/Users/takkanm/.rvm/gems/ruby-1.8.7-p302/gems/bundler-1.0.2/lib/bundler/spec_set.rb:130:in `tsort_each_child' | |
/Users/takkanm/.rvm/gems/ruby-1.8.7-p302/gems/bundler-1.0.2/lib/bundler/spec_set.rb:130:in `each' | |
/Users/takkanm/.rvm/gems/ruby-1.8.7-p302/gems/bundler-1.0.2/lib/bundler/spec_set.rb:130:in `tsort_each_child' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% jruby -S gem list | |
*** LOCAL GEMS *** | |
rake (0.8.7) | |
takkanm@takkanm.local ~/work/rails_sexy_validator/blog | |
% jruby -S gem install bundler rails | |
JRuby limited openssl loaded. http://jruby.org/openssl | |
gem install jruby-openssl for full support. | |
^C% takkanm@takkanm.local ~/work/rails_sexy_validator/blog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% jruby -S gem list | |
*** LOCAL GEMS *** | |
rake (0.8.7) | |
takkanm@takkanm.local ~/work/rails_sexy_validator/blog | |
% jruby -S gem list | |
*** LOCAL GEMS *** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'drb' | |
d = DRbObject.new_with_uri('druby://m-mimura-4.local:12346') | |
d.hello "message" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define BASE_PIN 7 // 7番ピンに1番目のLEDが接続されている | |
#define PIN_NUM 7 // 7つのLED | |
#define DELAY_TIME 50 // 遅延させる時間(50 msec) | |
void setup() { | |
int i; | |
// LEDの接続されているピンをデジタル出力として設定 | |
for (i = 0; i < PIN_NUM; i++) { | |
pinMode (BASE_PIN + i, OUTPUT); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'メソッドチェーン' do | |
subject { {a:1, b:2, c:3} } | |
its('values.sum') { should == 6} | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby-1.9.2-p290 :001 > o = Object.new | |
=> #<Object:0x007fb4ea0615e8> | |
ruby-1.9.2-p290 :002 > o.instance_eval {|obj| p obj; p self } | |
#<Object:0x007fb4ea0615e8> | |
#<Object:0x007fb4ea0615e8> | |
=> #<Object:0x007fb4ea0615e8> | |
ruby-1.9.2-p290 :003 > o.instance_exec {|obj| p obj; p self } | |
nil | |
#<Object:0x007fb4ea0615e8> | |
=> #<Object:0x007fb4ea0615e8> |
OlderNewer