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
| ActionController::Base.logger.info "[Base] Loading config/initializers/" + File.basename(__FILE__) | |
| class String | |
| def to_permalink | |
| text = self.dup | |
| replacements = { | |
| # replacement special character(s) to be replaced | |
| "A" => [ "À", "Á", "Â", "Ã", "Å"], | |
| "Ae" => [ "Ä", "Æ" ], | |
| "C" => [ "Ç" ], |
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 AddAttachmentsDataToWrapper < ActiveRecord::Migration | |
| def self.up | |
| add_column :wrappers, :data_file_name, :string | |
| add_column :wrappers, :data_content_type, :string | |
| add_column :wrappers, :data_file_size, :integer | |
| add_column :wrappers, :data_updated_at, :datetime | |
| end | |
| def self.down | |
| remove_column :wrappers, :data_file_name |
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
| #!/usr/bin/env ruby | |
| require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes.rb" | |
| require "#{ENV['TM_SUPPORT_PATH']}/lib/ui.rb" | |
| require "rubygems" | |
| require 'active_support/inflector' | |
| current_word = ENV['TM_CURRENT_WORD'] || "" | |
| def gem_exists?(name) |
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' unless defined? Gem # rubygems is only needed in 1.8 | |
| def unbundled_require(gem) | |
| loaded = false | |
| if defined?(::Bundler) | |
| Gem.path.each do |gems_path| | |
| gem_path = Dir.glob("#{gems_path}/gems/#{gem}*").last |
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
| RSpec::Matchers.define :have_content_type do |content_type| | |
| CONTENT_HEADER_MATCHER = /^(.*?)(?:; charset=(.*))?$/ | |
| chain :with_charset do |charset| | |
| @charset = charset | |
| end | |
| match do |response| | |
| _, content, charset = *content_type_header.match(CONTENT_HEADER_MATCHER).to_a |
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 'spork' | |
| def start_simplecov | |
| require 'simplecov' | |
| SimpleCov.start 'rails' unless ENV["SKIP_COV"] | |
| end | |
| def spork? | |
| defined?(Spork) && Spork.using_spork? |
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/application.rb | |
| #----------------------------------------------------------------------------------------------- | |
| require File.expand_path('../boot', __FILE__) | |
| require 'rails/all' | |
| Bundler.require(:default, Rails.env) if defined?(Bundler) | |
| # Bring in the Railtie that will set Rails' various logger variables to | |
| # instances of Logging::Logger instead of Rails' built-in ActiveSupport::BufferedLogger. |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """nginx_error_rate -- Munin plugin to report the error rate in an access log. | |
| The access log defaults to `/var/log/nginx/access.log`. This may be | |
| customized with the following stanza in your munin plugin conf: | |
| [nginx_error_rate] | |
| env.access_log /path/to/access.log | |
| """ |
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 'rake-pipeline-web-filters' | |
| output "public" | |
| class Rake::Pipeline::DSL::PipelineDSL | |
| def production? | |
| ENV['RAKEP_MODE'] == 'production' | |
| end | |
| end |