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
<!doctype html> | |
<!--[if lt IE 7 ]> <html lang="en"> <![endif]--> | |
<!--[if IE 7 ]> <html lang="en"> <![endif]--> | |
<!--[if IE 8 ]> <html lang="en"> <![endif]--> | |
<!--[if (gte IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title></title> | |
<meta name="description" content=""> |
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
= render "boilerplate/doctype" | |
= render "boilerplate/html_tag_browser_hacks" | |
%head | |
= render "boilerplate/meta_tags" | |
= render "boilerplate/title_tags" | |
= render "boilerplate/css" | |
= render "boilerplate/css_addons" #blank file, override with your addons | |
= render "boilerplate/head_javascript" | |
= render "boilerplate/head_javascript_addons" #blank file, override with your addons | |
= render "boilerplate/body" |
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
#/railties-3.0.5/lib/rails/engine.rb | |
def eager_load! | |
config.eager_load_paths.each do |load_path| | |
matcher = /\A#{Regexp.escape(load_path)}\/(.*)\.rb\Z/ | |
Dir.glob("#{load_path}/**/*.rb").sort.each do |file| | |
require_dependency file.sub(matcher, '\1') | |
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
#activesupport-3.0.5/lib/active_support/dependencies.rb | |
def require_dependency(file_name, message = "No such file to load -- %s") | |
unless file_name.is_a?(String) | |
raise ArgumentError, "the file name must be a String -- you passed #{file_name.inspect}" | |
end | |
Dependencies.depend_on(file_name, false, message) | |
end | |
def depend_on(file_name, swallow_load_errors = false, message = "No such file to load -- %s.rb") |
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
["/rails_apps/my_app/app/controllers", | |
"/rails_apps/my_app/app/helpers", | |
"/rails_apps/my_app/app/models", | |
"/rails_plugins/my_engine/app/controllers", | |
"/rails_plugins/my_engine/app/helpers", | |
"/rails_plugins/my_engine/app/models"] |
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 'active_support/dependencies' | |
module ActiveSupport::Dependencies | |
alias_method :require_or_load_without_multiple, :require_or_load | |
def require_or_load(file_name, const_path = nil) | |
if file_name.starts_with?(Rails.root.to_s + '/app') | |
relative_name = file_name.gsub(Rails.root.to_s, '') | |
@engine_paths ||= Rails::Application.railties.engines.collect{|engine| engine.config.root.to_s } | |
@engine_paths.each do |path| | |
engine_file = File.join(path, relative_name) | |
require_or_load_without_multiple(engine_file, const_path) if File.file?(engine_file) |
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
.gist{ | |
margin: 15px 0 !important; | |
} | |
.gist-file{ | |
border: none !important; | |
} | |
.gist-meta{ | |
border: 1px solid #D2d2d2 !important; |
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
defaults: &defaults | |
some_api_key: abc123 | |
an_erb_yetting: <%= "erb stuff works" %> | |
some_array: | |
- element1 | |
- element2 | |
development: | |
<<: *defaults | |
api_key: abc123dev |
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
# in any environment | |
Yetting.some_api_key #=> "abc123" | |
Yetting.an_erb_yetting #=> "erb stuff works" | |
Yetting.some_array #=> ["element1", "element2"] | |
# in the development environment | |
Yetting.api_key #=> "abc123dev" |
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
MainYetting.api_key | |
SecondaryYetting.api_key |
OlderNewer