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
module ActionController | |
module Flash | |
class FlasHash < Hash | |
def method_missing(m, *a, &b) | |
end | |
end | |
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
module ActionDispatch | |
module Flash | |
class FlashHash < Hash | |
def method_missing(m, *a, &b) | |
end | |
end | |
end | |
end | |
module ActionController |
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
config.after_initialize do | |
Jpmobile::Emoticon::CONVERSION_TABLE_TO_AU = Hash[*(Jpmobile::Emoticon::CONVERSION_TABLE_TO_AU.map do |k,v| | |
[k, ""] | |
end | |
).flatten] | |
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
begin | |
require "rubygems" | |
require "bundler" | |
if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.20") | |
raise RuntimeError, "Your bundler version is too old." + | |
"Run `gem install bundler` to upgrade." | |
end | |
# Set up load paths for all bundled gems |
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 Rails::Boot | |
def run | |
load_initializer | |
Rails::Initializer.class_eval do | |
def load_gems | |
@bundler_loaded ||= Bundler.require :default, Rails.env | |
end | |
Rails::Initializer.run(:set_load_path) |
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
module ActionController | |
module Session | |
class MemCacheStore < AbstractStore | |
private | |
def get_session(env, sid) | |
sid ||= generate_sid | |
begin | |
session = @pool.get(sid) || {} | |
rescue MemCache::MemCacheError, Errno::ECONNREFUSED | |
session = {} |
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 Hoge | |
include ActiveModel::AttributeMethods | |
def initialize(*args) | |
super(*args) | |
args.first.each do |k,v| | |
send("#{k}=", v) | |
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
前提 /^携帯でアクセスしている$/ do | |
header('HTTP_USER_AGENT', 'KDDI-CA39 UP.Browser/6.2.0.13.1.5 (GUI) MMP/2.0') | |
header('HTTP_X_UP_SUBNO', 'subscriber') | |
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
# coding: utf-8 | |
module Mail | |
class Message | |
def from_with_patch_rfc_violation | |
str = from_without_patch_rfc_violation | |
begin | |
str = str.join | |
rescue |
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
if Rails.env == "production" | |
filename = File.join(File.dirname(__FILE__), '..', 'email.yml') | |
if File.file?(filename) | |
config = YAML::load_file(filename) | |
if config.is_a?(Hash) && config.has_key?(Rails.env) | |
config[Rails.env].each do |k, v| | |
v.symbolize_keys! if v.respond_to?(:symbolize_keys!) | |
ActionMailer::Base.send("#{k}=", v) |