This file contains hidden or 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
package com.junivi.lang; | |
public interface Block { | |
} | |
This file contains hidden or 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 'rubygems' | |
require 'andand' | |
require 'benchmark' | |
include Benchmark | |
t = 1_000_000 | |
class A | |
attr_accessor :foo | |
end |
This file contains hidden or 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 'rubygems' | |
require 'ruby_parser' | |
require 'parse_tree' | |
require 'benchmark' | |
require 'pp' | |
include Benchmark | |
a = <<-EOF | |
class A | |
def foo |
This file contains hidden or 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
T = 1_000_000 | |
ARGS = [] | |
OBJECTS = [] | |
ALPHA = ('a'..'z').to_a | |
require 'benchmark' | |
class G0 | |
def bar(*args) | |
1 |
This file contains hidden or 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 'benchmark' | |
include Benchmark | |
class A | |
def foo(a, b, c) | |
1 | |
end | |
end | |
This file contains hidden or 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
it 'resets the session' do should_receive(:reset_session); logout_killing_session! end | |
it 'kills my auth_token cookie' do should_receive(:kill_remember_cookie!); logout_killing_session! end | |
it 'nils the current user' do logout_killing_session!; current_user.should be_nil end | |
it 'kills :user_id session' do | |
session.stub!(:[]=) | |
session.should_receive(:[]=).with(:user_id, nil).at_least(:once) | |
logout_killing_session! | |
end |
This file contains hidden or 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
class A | |
attr_accessor :b | |
end | |
class B | |
end | |
def change_A x | |
x.b = 1 | |
end |
This file contains hidden or 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
a = [1] | |
def bar x | |
x << 2 | |
end | |
bar a | |
puts a | |
def foo(bar) | |
def bar.baz | |
1 |
This file contains hidden or 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
transformations = ImageTagOptionParser.new(options) | |
final_filepath = "#{prefix}/resources/images/#{file}?#{transformations}" | |
class ImageTagOptionParser | |
KEYS = %w{scale constrain crop cropresize} | |
attr_accessor :transform | |
def initialize(options = {}) | |
options.reject!{|key, value| (key == "scale" && value.to_s == "100")} | |
first_valid_key = KEYS.find{|key| !options[key].blank?} |
This file contains hidden or 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
def create_user(user_options = {}, other_options = {}) | |
base_options = { :login => 'unique', :email => '[email protected]', | |
:first_name => 'bob', :last_name => 'testerperson', :address => "123 Main St", | |
:city => "Santa Carla", :state => "CA", :zip => "95000", :subscription => "Tier 1", | |
:role => 'Member', | |
:password => 'quire69', :password_confirmation => 'quire69',:accept_terms => true } | |
post :create, {:user => (base_options.merge(user_options))}.merge(other_options) | |
end | |
it 'should set permissions on create' do |
OlderNewer