s3deploy 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -26,7 +26,7 @@ Create a folder configuration file like this:
26
26
 
27
27
  $ s3deploy init
28
28
 
29
- Then update the newly created .s3deploy.yml with your settings.
29
+ Then update the newly created .s3deploy.yml with your settings (comments in the generated file explains how to set it).
30
30
  You might want to create a default configuration file where you can store information shared between sites, like Amazon access key, secret and region. You do that with this command:
31
31
 
32
32
  $ s3deploy init --default
@@ -43,9 +43,19 @@ If you want to test-drive your configuration you can simulate a deploy
43
43
 
44
44
  $ s3deploy simulate
45
45
 
46
+ ### Other
47
+
48
+ If you want to empty a bucket, you can do it with this command:
49
+
50
+ $ s3deploy empty
51
+
52
+ But beware that all files will be removed, you can simulate emptying the bucket with:
53
+
54
+ $ s3deploy simulate empty
55
+
46
56
  ## Whats next?
47
57
 
48
- 1. Create method for creating a bucket from the settings in the configuration and setting it up as a website.
58
+ 1. Create method for creating a bucket from the settings in the configuration and settings it up as a website.
49
59
 
50
60
  ## Contributing
51
61
 
data/lib/s3deploy.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require "s3deploy/version"
2
2
  require "AWS/S3"
3
3
  require "digest/md5"
4
- require "yaml" unless defined? YAML
4
+ require "yaml"
5
5
 
6
6
  class S3deploy
7
7
 
@@ -112,7 +112,7 @@ class S3deploy
112
112
  options[:access] = :public_read
113
113
 
114
114
  if @options["cache_regex"] && remote =~ Regexp.new(@options["cache_regex"])
115
- options[:"Cache-Control"] = "public, max-age=31557600"
115
+ options[:"Cache-Control"] = "public, max-age=31557600"
116
116
  end
117
117
 
118
118
  options[:content_type] = "text/html; charset=#{@options["html_charset"]}" if @options["html_charset"] && remote =~ /.+\.(html|htm)(\.gz)?$/i
@@ -159,9 +159,9 @@ class S3deploy
159
159
  end
160
160
  files
161
161
  end
162
-
162
+
163
163
  def import_settings(file)
164
- settings = YAML::parse_file(file).to_ruby if File.file? file
164
+ settings = YAML::load_file(file) if File.file? file
165
165
  if settings && settings.class == Hash
166
166
  settings.delete_if { |k,v| k != "aws_region" && v.nil? }
167
167
  else
@@ -172,7 +172,7 @@ class S3deploy
172
172
  def set_aws_region(region)
173
173
 
174
174
  unless AWS_REGIONS.include? region.downcase
175
- raise "#{region} is not a valid region, please select from #{AWS_REGIONS.join(", ")} or leave it blank for US Standard."
175
+ raise "#{region} is not a valid region, please select from #{AWS_REGIONS.join(", ")} or leave it blank for US Standard."
176
176
  end
177
177
 
178
178
  AWS::S3::DEFAULT_HOST.replace "s3-#{region}.amazonaws.com"
@@ -1,3 +1,3 @@
1
1
  class S3deploy
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -0,0 +1,8 @@
1
+ require 'minitest/autorun'
2
+ require 'minitest/pride'
3
+
4
+ require 'S3deploy'
5
+
6
+ describe S3deploy do
7
+
8
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-25 00:00:00.000000000 Z
12
+ date: 2012-09-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-s3
@@ -45,6 +45,7 @@ files:
45
45
  - lib/s3deploy.rb
46
46
  - lib/s3deploy/version.rb
47
47
  - s3deploy.gemspec
48
+ - spec/s3deploy_spec.rb
48
49
  homepage: https://github.com/lindblom/s3deploy
49
50
  licenses: []
50
51
  post_install_message:
@@ -69,4 +70,5 @@ rubygems_version: 1.8.24
69
70
  signing_key:
70
71
  specification_version: 3
71
72
  summary: Deploy static websites to Amazon S3
72
- test_files: []
73
+ test_files:
74
+ - spec/s3deploy_spec.rb