Skip to content

Instantly share code, notes, and snippets.

$(document).ready ->
$('*[data-controls-modal]').modalController()
$.fn.modalController = (options) ->
new ModalController(this, options)
$.fn.modal = (options) ->
new Modal(this, options)
class ModalController
$(document).ready ->
$('.actions-modal').actionsModal()
$.fn.actionsModal = (options) ->
new ActionsModal(this, options)
class ActionsModal
constructor: (@modal, @options) ->
@switchers = $('.switchers a', @modal)
@switchers.click @switch
require 'ostruct'
class Shell
def initialize
@io = IO.popen 'bash -l', 'r+'
end
def exec?(cmd)
exec(cmd).status == 0
end
require 'delegate'
class Foo
def me
puts "meee"
end
end
foo = Foo.new
delegator = SimpleDelegator.new(foo)
From 30a818e0f29ab169d18a36962a97d93640eb4eff Mon Sep 17 00:00:00 2001
From: Ian Leitch <[email protected]>
Date: Sat, 18 Feb 2012 17:18:19 +0000
Subject: [PATCH] Mutex#try_lock when locked by the current thread returns
false in 19.
---
kernel/common/load_order19.txt | 1 +
kernel/common/mutex.rb | 11 -----------
kernel/common/mutex18.rb | 12 ++++++++++++
=> class Foo
=> p = Proc.new {}
=> define_method :a, p
=> define_method :b, p
=> end
=>
=> foo = Foo.new
=> foo.method(:a)
[]
=> foo.method(:b)
diff --git a/kernel/bootstrap/block_environment.rb b/kernel/bootstrap/block_environment.rb
index ccc91b4..80cb6df 100644
--- a/kernel/bootstrap/block_environment.rb
+++ b/kernel/bootstrap/block_environment.rb
@@ -23,6 +23,8 @@ module Rubinius
end
class AsMethod < Executable
+ attr_reader :block_env
+
diff --git a/kernel/bootstrap/block_environment.rb b/kernel/bootstrap/block_environment.rb
index ccc91b4..c13e0a5 100644
--- a/kernel/bootstrap/block_environment.rb
+++ b/kernel/bootstrap/block_environment.rb
@@ -23,6 +23,8 @@ module Rubinius
end
class AsMethod < Executable
+ attr_reader :block_env
+
diff --git a/kernel/bootstrap/kernel.rb b/kernel/bootstrap/kernel.rb
index 06c3458..8aec7d5 100644
--- a/kernel/bootstrap/kernel.rb
+++ b/kernel/bootstrap/kernel.rb
@@ -52,13 +52,6 @@ module Kernel
respond_to_all?(meth.to_sym, include_private);
end
- def respond_to_all?(meth, include)
- Rubinius.primitive :object_respond_to
diff --git a/kernel/bootstrap/kernel.rb b/kernel/bootstrap/kernel.rb
index 06c3458..2dcb3f5 100644
--- a/kernel/bootstrap/kernel.rb
+++ b/kernel/bootstrap/kernel.rb
@@ -47,18 +47,6 @@ module Kernel
raise PrimitiveFailure, "Kernel#object_id primitive failed"
end
- def respond_to?(meth, include_private=false)
- Rubinius.primitive :object_respond_to_public