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
# This a sample YML file from Rails 2.3. The objective is to propose a yml based on this | |
# one which will reduce error messsages duplication, as outline in this post: | |
# | |
# http://groups.google.com/group/rails-i18n/browse_thread/thread/3085a78831ed8fae | |
# | |
# Proposals are available below and also check the forks at the right. | |
en: | |
activerecord: | |
models: | |
admin: "Admin" |
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
module ActiveSupport | |
module Notifications | |
autoload :Instrumenter, 'active_support/notifications/instrumenter' | |
autoload :Event, 'active_support/notifications/instrumenter' | |
autoload :Fanout, 'active_support/notifications/fanout' | |
class << self | |
attr_writer :notifier | |
delegate :publish, :subscribe, :to => :notifier | |
delegate :instrument, :to => :instrumenter |
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 Bubble::Cli::Add < Base | |
class_option :force, :aliases => "-f", :type => :boolean, :default => false, | |
:desc => "Force" | |
def first_step | |
end | |
def second_step | |
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
[ Carlhuda ] | |
actionmailer/lib/action_mailer/railtie.rb:17 (was actionmailer/lib/action_mailer/rails.rb) | |
actionmailer/lib/action_mailer/railtie.rb:23 (was actionmailer/lib/action_mailer/rails.rb) | |
actionpack/lib/action_controller/railtie.rb:17 (was actionpack/lib/action_controller/rails.rb) | |
actionpack/lib/action_controller/railtie.rb:37 (was actionpack/lib/action_controller/rails.rb) | |
actionpack/lib/action_view/template/handlers.rb:13 | |
activerecord/lib/active_record/railtie.rb:74 (was activerecord/lib/active_record/rails.rb) | |
activesupport/lib/active_support/testing/performance.rb:321 | |
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 <%= class_name %> < ActionMailer::Base | |
delivers_from "mail@<%= Rails.application.name %>.com" | |
<% for action in actions -%> | |
# Subject can be set in your I18n file at config/locales/en.yml | |
# with the following lookup: | |
# | |
# en.actionmailer.<%= file_name %>.<%= action_name %>.subject | |
# | |
def <%= action %> |
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 Notifier < ActionMailer::Base | |
delivers_from "[email protected]" | |
# Subject can be set in your I18n file at config/locales/en.yml | |
# with the following lookup: | |
# | |
# en.actionmailer.notifier.foo.subject | |
# | |
def foo | |
@greeting = "Hi" |
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
Host gitproxy | |
User git | |
HostName ssh.github.com | |
Port 443 |
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
# = YERB | |
# | |
# Who needs HAML when you have YAML + ERB? ;) | |
# | |
# See example.yaml below for an example. You can run this code | |
# by cloning this gist and then `ruby _yerb.rb example.yaml`. | |
# | |
# Notice that you need Ruby 1.9 so the hash order is preserved. | |
# Obviously, this is just for fun. Definitely slow as hell. | |
# |
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 "rack/openid" | |
require 'devise/strategies/base' | |
require 'uri' | |
module Devise | |
module Strategies | |
# Default strategy for signing in a user, based on openid | |
# Redirects to sign_in page if it's not authenticated | |
class OpenId < Warden::Strategies::Base | |
include Devise::Strategies::Base |
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
Warden::Strategies.add(:openid) do | |
def valid? | |
!params["openid_identifier"].blank? | |
end | |
def authenticate! | |
if resp = env[Rack::OpenID::RESPONSE] | |
RAILS_DEFAULT_LOGGER.info "Attempting OpenID auth: #{env["rack.openid.response"].inspect}" | |
case resp.status | |
when :success |