Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Get deploy working for ruby 1.9.2

When I tried running this in Ruby 1.9.2 I got the error:

undefined method `to_ruby' for #<Syck::Map:0x007fd625e11948>

This fixes that by using load_file which is supported across the
different ruby versions. (I've tested with 1.8.7, 1.9.2 and 1.9.3)
  • Loading branch information...
commit 0227b7d640e41244525923283795b75e7c4b35eb 1 parent dfc1bc2
@thechrisoshow authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/s3deploy.rb
10 lib/s3deploy.rb
@@ -1,7 +1,7 @@
require "s3deploy/version"
require "AWS/S3"
require "digest/md5"
-require "yaml" unless defined? YAML
+require "yaml"

i had it like this before but got warnings that i tried to load yaml twice. But maybe that was just something with my system :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
class S3deploy
@@ -112,7 +112,7 @@ def upload_file(local, remote, simulate, options = {})
options[:access] = :public_read
if @options["cache_regex"] && remote =~["cache_regex"])
- options[:"Cache-Control"] = "public, max-age=31557600"
+ options[:"Cache-Control"] = "public, max-age=31557600"
options[:content_type] = "text/html; charset=#{@options["html_charset"]}" if @options["html_charset"] && remote =~ /.+\.(html|htm)(\.gz)?$/i
@@ -159,9 +159,9 @@ def all_files(path = ".")
def import_settings(file)
- settings = YAML::parse_file(file).to_ruby if File.file? file
+ settings = YAML::load_file(file) if File.file? file
if settings && settings.class == Hash
settings.delete_if { |k,v| k != "aws_region" && v.nil? }
@@ -172,7 +172,7 @@ def import_settings(file)
def set_aws_region(region)
unless AWS_REGIONS.include? region.downcase
- raise "#{region} is not a valid region, please select from #{AWS_REGIONS.join(", ")} or leave it blank for US Standard."
+ raise "#{region} is not a valid region, please select from #{AWS_REGIONS.join(", ")} or leave it blank for US Standard."
AWS::S3::DEFAULT_HOST.replace "s3-#{region}"

2 comments on commit 0227b7d


Nice cleanup, guess i have to make my editor show trailing whitespace. :)


I use SublimeText - it's amazing. It makes for slightly annoying commits though!

Please sign in to comment.
Something went wrong with that request. Please try again.