diff --git a/lib/s3deploy.rb b/lib/s3deploy.rb index 25a2d7e..92bd4e8 100644 --- a/lib/s3deploy.rb +++ b/lib/s3deploy.rb @@ -30,9 +30,9 @@ def config end def deploy! - config.before_deploy if config.before_deploy + config.before_deploy.call if config.before_deploy.respond_to?(:call) @deployer.deploy! - config.after_deploy if config.after_deploy + config.after_deploy.call if config.after_deploy.respond_to?(:call) end def destroy! diff --git a/lib/s3deploy/deployer.rb b/lib/s3deploy/deployer.rb index ed5eb7c..dd70b37 100644 --- a/lib/s3deploy/deployer.rb +++ b/lib/s3deploy/deployer.rb @@ -17,7 +17,7 @@ class Deployer def initialize(opts) @dist_dir = File.expand_path(opts[:dist_dir]) @bucket = opts[:bucket] - @app_path = strip_slashes(opts[:app_path]) || '' + @app_path = strip_slashes(opts[:app_path] || '') @gzip = opts[:gzip] || S3deploy::DEFAULT_GZIP @acl = opts[:acl] || 'public-read' @cache_control = opts[:cache_control] || 'public,max-age=60' @@ -118,7 +118,7 @@ def delete! private def app_path_with_bucket - "#{@bucket}/#{@app_path}" + [@bucket,@app_path].reject(&:empty?).join('/') end def strip_slashes(str) diff --git a/lib/s3deploy/version.rb b/lib/s3deploy/version.rb index 33e1827..ee2e40e 100644 --- a/lib/s3deploy/version.rb +++ b/lib/s3deploy/version.rb @@ -1,4 +1,4 @@ # hi version! module S3deploy - VERSION = '0.2.4' + VERSION = '0.2.5' end