Method: Octopress::Deploy::S3#initialize
- Defined in:
- lib/octopress-deploy/s3.rb
#initialize(options) ⇒ S3
Returns a new instance of S3.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/octopress-deploy/s3.rb', line 8 def initialize() begin require 'aws-sdk-v1' rescue LoadError abort "Deploying to S3 requires the aws-sdk-v1 gem. Install with `gem install aws-sdk-v1`." end = @local = [:site_dir] || '_site' @bucket_name = [:bucket_name] @access_key = [:access_key_id] || ENV['AWS_ACCESS_KEY_ID'] @secret_key = [:secret_access_key] || ENV['AWS_SECRET_ACCESS_KEY'] @region = [:region] || ENV['AWS_DEFAULT_REGION'] || 'us-east-1' @distro_id = [:distribution_id] || ENV['AWS_DISTRIBUTION_ID'] @remote_path = ([:remote_path] || '/').sub(/^\//,'') @verbose = [:verbose] @incremental = [:incremental] @delete = [:delete] @headers = [:headers] || [] @remote_path = @remote_path.sub(/^\//,'') # remove leading slash @pull_dir = [:dir] connect end |