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
Feature: User login | |
In order to use application | |
As a user | |
I want to be able to login and logout from the application | |
Scenario: Access restricted to an anonymous user | |
Given Anonymous user | |
When I go to the home page | |
Then I should be on the login page |
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
class Module | |
def name_finder(*methods) | |
methods.each do |method| | |
raise TypeError.new("method name is not symbol") unless method.is_a?(Symbol) | |
metaclass = class << self; self; end | |
metaclass.send(:define_method, method) do | |
instance_variable_get(self.find_by_name(method.to_s)) | |
end | |
end | |
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
# == Schema Information | |
# Schema version: 20090420101231 | |
# | |
# Table name: loop_locks | |
# | |
# entity_id :integer(4) not null | |
# loop :string(255) not null | |
# created_at :datetime not null | |
# timeout_at :datetime not null | |
# |
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
def from_russia? | |
if MAXMIND_GEOIP_DB | |
info = MAXMIND_GEOIP_DB.look_up(ip_address) || {} | |
info[:country_code].to_s.upcase == 'RU' | |
else | |
false | |
end | |
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
task :hello do | |
puts 'hello' | |
end | |
task :hello do | |
puts 'world!' | |
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
task :hello do | |
puts 'hello' | |
end | |
task :before do | |
puts 'before all' | |
end | |
task :hello => :before |
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
task :hello do | |
puts 'hello' | |
end | |
Rake.application[:hello].clear | |
task :hello do | |
puts 'hello, world' | |
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
diff --git a/Library/Formula/mysql.rb b/Library/Formula/mysql.rb | |
index 1f2ecdc..b6f3c01 100644 | |
--- a/Library/Formula/mysql.rb | |
+++ b/Library/Formula/mysql.rb | |
@@ -1,5 +1,11 @@ | |
require 'formula' | |
+class PerconaXtradb < Formula | |
+ url 'http://www.percona.com/percona-builds/Percona-Server/Percona-Server-5.1.45-10/source/percona-xtradb-1.0.6-10.tar.gz' | |
+ md5 'd20bc3befd6e732c40fd41a9adcec9d9' |
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
begin | |
require 'capistrano/recipes/deploy/strategy/fast_remote_cache' | |
rescue LoadError | |
require 'capistrano/recipes/deploy/strategy/remote_cache' | |
end | |
module Capistrano | |
module Deploy | |
module Strategy | |
RsyncRemoteCache = Class.new(defined?(FastRemoteCache) ? FastRemoteCache : RemoteCache) |
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
(n=(c=IRB.conf)[:PROMPT][:NULL]).map{|k,v|n[k]=v.to_s};c[:MAIN_CONTEXT].prompt_mode=c[:AUTO_INDENT]=:NULL;class IRB::InputMethod;def prompt=(p);@prompt=p.gsub(/^(\s*)/){'8=='+'='*$1.size}+'D ';end;end |