Permalink
Browse files

Upload change to Upyun.com

  • Loading branch information...
1 parent aed39cf commit 59dbf23fdbfcb576caf0aed4362643222c65fc6f @huacnlee huacnlee committed Mar 2, 2012
Showing with 19 additions and 12 deletions.
  1. +2 −1 Gemfile
  2. +8 −2 Gemfile.lock
  3. +4 −1 config/config.yml.default
  4. +5 −8 config/initializers/carrierwave.rb
View
@@ -12,8 +12,9 @@ group :assets do
end
# 上传组件
-gem 'carrierwave', '0.5.6'
+gem 'carrierwave', '0.5.7'
gem 'carrierwave-mongoid', '0.1.2', :require => 'carrierwave/mongoid'
+gem 'carrierwave-upyun', '0.1.3'
gem 'mini_magick','3.3'
# Mongoid 辅助插件
View
@@ -95,11 +95,14 @@ GEM
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
- carrierwave (0.5.6)
+ carrierwave (0.5.7)
activesupport (~> 3.0)
carrierwave-mongoid (0.1.2)
carrierwave (>= 0.5.6)
mongoid (~> 2.1)
+ carrierwave-upyun (0.1.3)
+ carrierwave (>= 0.5.7)
+ rest-client (>= 1.6.7)
cells (3.7.1)
actionpack (~> 3.0)
railties (~> 3.0)
@@ -263,6 +266,8 @@ GEM
resque_mailer (2.0.2)
actionmailer (>= 3.0.0)
resque (>= 1.2.3)
+ rest-client (1.6.7)
+ mime-types (>= 1.16)
rsolr (1.0.6)
builder (>= 2.1.2)
rspec (2.8.0)
@@ -369,8 +374,9 @@ DEPENDENCIES
cancan (~> 1.6.7)
capistrano (= 2.9.0)
capybara
- carrierwave (= 0.5.6)
+ carrierwave (= 0.5.7)
carrierwave-mongoid (= 0.1.2)
+ carrierwave-upyun (= 0.1.3)
cells (= 3.7.1)
chunky_png (= 1.2.5)
coffee-rails (~> 3.2.1)
@@ -5,7 +5,10 @@ defaults: &defaults
admin_emails:
- "admin@admin.com"
google_analytics_key: ""
- upload_url: "http://127.0.0.1:3000/uploads"
+ upload_url: "http://ruby-china-files-dev.b0.upaiyun.com"
+ upyun_username: "test"
+ upyun_password: "123123"
+ upyun_bucket: "ruby-china-files-dev"
google_group_email: "shanghaionrails@googlegroups.com"
email_sender: 'no-reply@ruby-china.org'
aws_access_key_id: ''
@@ -1,10 +1,7 @@
-mongoid_config = YAML.load_file("#{Rails.root}/config/mongoid.yml")[Rails.env]
CarrierWave.configure do |config|
- config.grid_fs_database = mongoid_config['database']
- config.grid_fs_host = mongoid_config['host']
- config.grid_fs_port = mongoid_config['port']
- config.grid_fs_username = mongoid_config['username']
- config.grid_fs_password = mongoid_config['password']
- config.storage = :grid_fs
- config.grid_fs_access_url = Setting.upload_url
+ config.storage = :upyun
+ config.upyun_username = Setting.upyun_username
+ config.upyun_password = Setting.upyun_password
+ config.upyun_bucket = Setting.upyun_bucket
+ config.upyun_bucket_domain = Setting.upload_url.gsub("http://","")
end

0 comments on commit 59dbf23

Please sign in to comment.