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
CarrierWave.configure do |config| | |
config.fog_credentials = { | |
:provider => 'AWS', | |
:aws_access_key_id => ENV['S3_KEY'], | |
:aws_secret_access_key => ENV['S3_SECRET'] | |
} | |
config.fog_directory = 'superfuntimes' | |
config.fog_host = 's3.amazonaws.com' # optional, defaults to nil | |
config.fog_public = true # optional, defaults to true | |
config.fog_attributes = {'Cache-Control'=>'max-age=315576000'} # optional, defaults to {} |
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
Fog.credentials_path = Rails.root.join('config/fog_credentials.yml') | |
CarrierWave.configure do |config| | |
config.permissions = 0666 | |
config.fog_credentials = { provider: 'AWS' } | |
config.fog_directory = 'buckets-r-us' | |
# config.fog_host = 's3.amazonaws.com' # optional, defaults to nil | |
config.fog_public = true # optional, defaults to true | |
config.fog_attributes = {'Cache-Control'=>'max-age=315576000'} # optional, defaults to {} |
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
default: | |
aws_access_key_id: <%= ENV['S3_KEY'] %> | |
aws_secret_access_key: <%= ENV['S3_SECRET'] %> |
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
Fog.mock! | |
Fog.credentials_path = Rails.root.join 'config/fog_credentials.yml' | |
connection = Fog::Storage.new provider: 'AWS' | |
connection.directories.create key: 'buckets-r-us' |
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 'spec_helper' | |
require 'carrierwave/test/matchers' | |
describe CoverArtUploader do | |
include CarrierWave::Test::Matchers | |
before do | |
@uploader = CoverArtUploader.new(CoverArt.create, :image) | |
@uploader.store!(File.open("#{Rails.root}/spec/uploaders/fruit.jpg", "r")) | |
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
context "widget" do | |
setup do | |
@request.stubs(:cookies).returns(@request.cookie_jar) | |
end | |
should "have sensible defaults" do | |
widget = widget 'title' do | |
haml_concat('this is my content') | |
end | |
assert_match %r{<section class='widget'><div class='widget'><header><a tabindex='0' title='click to show/hide'><h3>}, widget | |
assert_match %r{<h3>title</h3>}, widget |
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 widget(title, options = {}, &block) | |
options = (options.is_a? Hash) ? options : { options => true } | |
collapsed = ( | |
(options.has_key?(:<) || options.has_key?(:collapsed)) && \ | |
cookies["widget_#{title.parameterize.downcase}"] != 'expanded' | |
) \ | |
|| cookies["widget_#{title.parameterize.downcase}"] == 'collapsed' \ | |
|| options.has_key?(:ajax) | |
widget_class = options.fetch(:class, "") | |
widget_class << ' collapsed' if collapsed |
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
context "widget" do | |
should "have sensible defaults" do | |
widget = widget 'title' do | |
haml_concat('this is my content') | |
end | |
assert_match %r{<section class='widget'><div class='widget'><header><a tabindex='0' title='click to show/hide'><h3>}, widget | |
assert_match %r{<h3>title</h3>}, widget | |
assert_match %r{<div class='widget-content'>this is my content</div>}, widget | |
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
def widget(title, options = {}, &block) | |
options = (options.is_a? Hash) ? options : { options => true } | |
collapsed = ( | |
(options.has_key?(:<) || options.has_key?(:collapsed)) && \ | |
cookies["widget_#{title.parameterize.downcase}"] != 'expanded' | |
) \ | |
|| cookies["widget_#{title.parameterize.downcase}"] == 'collapsed' \ | |
|| options.has_key?(:ajax) | |
widget_class = options.fetch(:class, "") | |
widget_class << ' collapsed' if collapsed |
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
source "http://24.40.50.193:3001" | |
source :rubygems | |
gem "rails", "= 3.0.11" | |
gem "rake", "~> 0.9.2" | |
gem "mysql2", "~> 0.2.7" | |
gem "activerecord-sqlserver-adapter", "~> 3.0.12" # must match rails minor version | |
gem "ruby-odbc", "~> 0.99992" |