Permalink
Browse files

Revert "replace aws/s3 with fog"

This reverts commit 29ce2b1.
  • Loading branch information...
1 parent 9f490ef commit 67a793d630c7647bcb3273a7b42cd5dbb2e61359 @geemus geemus committed Dec 1, 2011
Showing with 19 additions and 34 deletions.
  1. +1 −1 Gemfile
  2. +6 −19 Gemfile.lock
  3. +12 −14 Rakefile
View
@@ -3,8 +3,8 @@ source "http://rubygems.org"
gemspec
group :development do
+ gem "aws-s3"
gem "fakefs"
- gem "fog"
gem "parka", ">= 0.6.2"
gem "rake", ">= 0.8.7"
gem "rr", "~> 1.0.2"
View
@@ -11,33 +11,20 @@ GEM
remote: http://rubygems.org/
specs:
addressable (2.2.6)
+ aws-s3 (0.6.2)
+ builder
+ mime-types
+ xml-simple
builder (3.0.0)
crack (0.3.1)
diff-lcs (1.1.2)
- excon (0.7.7)
fakefs (0.3.1)
- fog (1.1.1)
- builder
- excon (~> 0.7.4)
- formatador (~> 0.2.0)
- mime-types
- multi_json (~> 1.0.3)
- net-scp (~> 1.0.4)
- net-ssh (>= 2.1.3)
- nokogiri (~> 1.5.0)
- ruby-hmac
- formatador (0.2.1)
fpm (0.3.7)
json
json (1.5.3)
launchy (2.0.5)
addressable (~> 2.2.6)
mime-types (1.17.2)
- multi_json (1.0.4)
- net-scp (1.0.4)
- net-ssh (>= 1.99.1)
- net-ssh (2.2.1)
- nokogiri (1.5.0)
parka (0.6.2)
crack
rest-client
@@ -55,7 +42,6 @@ GEM
rspec-expectations (2.5.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.5.0)
- ruby-hmac (0.4.0)
rubyzip (0.9.4)
sequel (3.20.0)
simplecov (0.4.2)
@@ -77,13 +63,14 @@ GEM
webmock (1.7.7)
addressable (~> 2.2, > 2.2.5)
crack (>= 0.1.7)
+ xml-simple (1.0.15)
PLATFORMS
ruby
DEPENDENCIES
+ aws-s3
fakefs
- fog
fpm
heroku!
parka (>= 0.6.2)
View
@@ -89,31 +89,29 @@ end
def resource(name)
File.expand_path("../dist/resources/#{name}", __FILE__)
end
-def storage
- return @storage if @storage
+
+def s3_connect
+ return if @s3_connected
+
+ require "aws/s3"
unless ENV["HEROKU_RELEASE_ACCESS"] && ENV["HEROKU_RELEASE_SECRET"]
puts "please set HEROKU_RELEASE_ACCESS and HEROKU_RELEASE_SECRET in your environment"
exit 1
end
- require 'fog/aws/storage'
-
- @storage = Fog::Storage.new(
- :aws_access_key_id => ENV["HEROKU_RELEASE_ACCESS"],
- :aws_secret_access_key => ENV["HEROKU_RELEASE_SECRET"],
- :provider => 'AWS'
+ AWS::S3::Base.establish_connection!(
+ :access_key_id => ENV["HEROKU_RELEASE_ACCESS"],
+ :secret_access_key => ENV["HEROKU_RELEASE_SECRET"]
)
+
+ @s3_connected = true
end
def store(package_file, filename, bucket="assets.heroku.com")
+ s3_connect
puts "storing: #{filename}"
- directory = storage.directory.new(:key => bucket)
- directory.files.create(
- :body => File.open(package_file),
- :key => filename,
- :public => true
- )
+ AWS::S3::S3Object.store(filename, File.open(package_file), bucket, :access => :public_read)
end
def tempdir

0 comments on commit 67a793d

Please sign in to comment.