Oh, sorry for the typo!

<a href="http://gabrielsaldana.org'>http://gabrielsaldana.org</a>


On Fri, Nov 29, 2013 at 4:06 PM, Johnny Dobbins <notifications@github.com>wrote:

> In lib/dpl/provider/s3.rb:
>
> > @@ -31,7 +32,8 @@ def upload_path(filename)
> >        def push_app
> >          Dir.chdir(options.fetch(:local_dir, Dir.pwd)) do
> >            Dir.glob("**/*") do |filename|
> > -            api.buckets[option(:bucket)].objects.create(upload_path(filename), File.read(filename)) unless File.directory?(filename)
> > +            content_type = MIME::Types.type_for(filename).first.to_s
> > +            api.buckets[option(:bucket)].objects.create(upload_path(filename), File.read(filename), :content-type => content_type) unless File.directory?(filename)
>
> :content-type => content_type
>
> caused the following error:
>
> $ dpl --provider=s3 --access-key-id=xxx --secret-access-key=xxx --bucket=dev.wsrcdn.net --local-dir=build --upload-dir=dobbins/test/
> Installing deploy dependencies
> Preparing deploy
> Logging in with Access Key: ****************D5WQ
> No local changes to save
> Deploying application
> /Users/johnny.dobbins/.rvm/gems/ruby-2.0.0-p247/gems/dpl-1.5.2/lib/dpl/provider/s3.rb:36:in `block (2 levels) in push_app': undefined local variable or method `type' for #<DPL::Provider::S3:0x007f800f8e1cf0> (NameError)
>         from /Users/johnny.dobbins/.rvm/gems/ruby-2.0.0-p247/gems/dpl-1.5.2/lib/dpl/provider/s3.rb:34:in `glob'
>         from /Users/johnny.dobbins/.rvm/gems/ruby-2.0.0-p247/gems/dpl-1.5.2/lib/dpl/provider/s3.rb:34:in `block in push_app'
>         from /Users/johnny.dobbins/.rvm/gems/ruby-2.0.0-p247/gems/dpl-1.5.2/lib/dpl/provider/s3.rb:33:in `chdir'
>         from /Users/johnny.dobbins/.rvm/gems/ruby-2.0.0-p247/gems/dpl-1.5.2/lib/dpl/provider/s3.rb:33:in `push_app'
>         from /Users/johnny.dobbins/.rvm/gems/ruby-2.0.0-p247/gems/dpl-1.5.2/lib/dpl/provider.rb:95:in `block in deploy'
>         from /Users/johnny.dobbins/.rvm/gems/ruby-2.0.0-p247/gems/dpl-1.5.2/lib/dpl/cli.rb:41:in `fold'
>         from /Users/johnny.dobbins/.rvm/gems/ruby-2.0.0-p247/gems/dpl-1.5.2/lib/dpl/provider.rb:95:in `deploy'
>         from /Users/johnny.dobbins/.rvm/gems/ruby-2.0.0-p247/gems/dpl-1.5.2/lib/dpl/provider/s3.rb:42:in `deploy'
>         from /Users/johnny.dobbins/.rvm/gems/ruby-2.0.0-p247/gems/dpl-1.5.2/lib/dpl/cli.rb:32:in `run'
>         from /Users/johnny.dobbins/.rvm/gems/ruby-2.0.0-p247/gems/dpl-1.5.2/lib/dpl/cli.rb:7:in `run'
>         from /Users/johnny.dobbins/.rvm/gems/ruby-2.0.0-p247/gems/dpl-1.5.2/bin/dpl:5:in `<top (required)>'
>         from /Users/johnny.dobbins/.rvm/gems/ruby-2.0.0-p247/bin/dpl:23:in `load'
>         from /Users/johnny.dobbins/.rvm/gems/ruby-2.0.0-p247/bin/dpl:23:in `<main>'
>
> I replaced that with
>
> :content_type => content_type
>
> and the problem resolved. I'll be pushing this change up and then merging
> the pull request.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/WiserTogether/dpl/pull/1/files#r8008636>
> .
>