Sha256: 5c326f5cab8db0c6280fdd7f48f9b7b98cfbbe527623b76d80070e200d1b2135
Contents?: true
Size: 1.13 KB
Versions: 7
Compression:
Stored size: 1.13 KB
Contents
require 'rubygems' require 'rspec' require 'rails' require 'active_record' require "carrierwave" require 'carrierwave/orm/activerecord' require 'carrierwave/processing/mini_magick' $LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require "carrierwave-aliyun" module Rails class <<self def root [File.expand_path(__FILE__).split('/')[0..-3].join('/'),"spec"].join("/") end end end ActiveRecord::Migration.verbose = false ActiveRecord::Base.raise_in_transactional_callbacks = true # 测试的时候需要修改这个地方 ALIYUN_ACCESS_ID = ENV['ALIYUN_ACCESS_ID'] || '' ALIYUN_ACCESS_KEY = ENV['ALIYUN_ACCESS_KEY'] || '' ALIYUN_BUCKET = ENV['ALIYUN_BUCKET'] || 'carrierwave-aliyun-test' ALIYUN_AREA = ENV['ALIYUN_AREA'] || 'cn-beijing' CarrierWave.configure do |config| config.storage = :aliyun config.aliyun_access_id = ALIYUN_ACCESS_ID config.aliyun_access_key = ALIYUN_ACCESS_KEY config.aliyun_bucket = ALIYUN_BUCKET config.aliyun_area = ALIYUN_AREA config.aliyun_internal = false end def load_file(fname) File.open([Rails.root,fname].join("/")) end
Version data entries
7 entries across 7 versions & 2 rubygems