capistrano-s3 0.2.7 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZGFkMzQ2ZTgyZmUxZjA1NzdkYzQ5YmQ2NjA3ZmRjNTExYzNjNjZmMg==
5
- data.tar.gz: !binary |-
6
- M2ViNmVmZjVlMGFhNjVhNDg4NWIxZmEwZTY1MDIxYzBkMjBjYWQ4Nw==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- MWQ0YmJlNWU2Nzc3YmY0NTY5NmNiNTdhZGFjYWRmNjdlNmRiZDkxYWE5N2Jk
10
- YzcxMDdiNzllZjE1ZDYzNzQ1ZmNkMzA3OTRkNWNkYjJkMjcwOGI1Y2Q5NWVl
11
- Njc0MTE1ZmI0ODRmOTNmMDI4NGI2YTlkMTQ5OGU2MGI5MzNjOGY=
12
- data.tar.gz: !binary |-
13
- ZmUzYTczODdmYTJhNWQyYTI2NzljNDJiYzA2NGJiZDk1NTA0ZjAwNmQzZTNh
14
- NmM0ZWZlNTNlZmU5N2U5NTU1NjdjMjdlZjE4OGY3ZGI0OTE5N2EzNTBlYzdi
15
- NWRhZmMxNTMxOTA0ZjVlYmVlNzhkOWY4MWZkZWIwMGUyMjEzZWQ=
2
+ SHA1:
3
+ metadata.gz: b12f7b07b986dd3dee527b494dd54417b118eb27
4
+ data.tar.gz: a9bab13818c1d0b9fa525ab1f8c1d8f72da73730
5
+ SHA512:
6
+ metadata.gz: b1bee700dbef6e1a1bd813fd575cfe62496f99fd34eb6b6b9e851451d20a300625ecf2f054bbc9b5d3bbeef23b1bb3b7853032f2d6643b0af94d22ea01942bfa
7
+ data.tar.gz: a420ef9a7b65dcedabfa08ae6970422517f5196d1a95bbc8e61db6b30448e71df3d3192edae61e4a8daa2d69e978faffd175f1fb5341c3c26b6becf6a6f5c7c4
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
- *.gem
1
+ *.gem
2
+ .last_published
data/.travis.yml ADDED
@@ -0,0 +1,13 @@
1
+ language: ruby
2
+ bundler_args: --without debug release
3
+ rvm:
4
+ - 1.9.3
5
+ - 2.0.0
6
+ - rbx-2
7
+ - jruby-19mode
8
+ - jruby-head
9
+ - ruby-head
10
+ matrix:
11
+ allow_failures:
12
+ - rvm: jruby-head
13
+ - rvm: ruby-head
data/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ # CHANGELOG
2
+
3
+ ## v0.2.9
4
+
5
+ Bugfix : fix gemspec dependencies
6
+
7
+ ## v0.2.8 (yanked)
8
+
9
+ Improvement : lock dependency to Capistrano v2 for current version
10
+ Improvement : Update spec for new AWS SDK
11
+
12
+ ## v0.2.7
13
+
14
+ Bugfix : support non-standard file extensions. (#14) @barvaz
15
+
16
+ ## v0.2.6
17
+
18
+ Feature : Adds ability to specify redirect location for files. (#13) @aledovsky
19
+ Feature : Adds S3 endpoint selection option. (#11) @aledovsky
20
+ Improvement : Require fileutils to support newer rubies. (#10) @douglasjarquin
21
+ Bugfix : Pass a string to the content_type option (#11) @douglasjarquin
data/CONTRIBUTING.md CHANGED
@@ -4,19 +4,25 @@
4
4
 
5
5
  We love to work with people around the globe and make earth a better place for mankind!
6
6
 
7
+ ## Submit a pull request
8
+
7
9
  Please follow theses simples steps to contribute to this project :
8
10
 
9
- 1. Fork the repo.
11
+ 1. Run the tests before & after doing anything.
10
12
 
11
- 2. Rebase your code onto upstream master (this repository) if not up to date.
13
+ 2. Add specs regarding your code modification.
12
14
 
13
15
  3. Squash or fixup your commits to achieve a clean commit log.
14
16
 
15
- 4. Submit a pull request explaining clearly changes.
17
+ 4. Rebase your code onto upstream master (this repository) if not up to date.
18
+
19
+ 5. Submit a pull request explaining changes.
20
+
21
+ Thank you!
16
22
 
17
23
  ## Running the tests
18
24
 
19
- I am sorry [wilson](http://www.youtube.com/watch?v=wO_MYX_Oto0), there is no tests.
25
+ As simple as running the `rake` command. The default `rake` task is `rake spec`.
20
26
 
21
27
  ## Syntax
22
28
 
data/Gemfile CHANGED
@@ -1,2 +1,17 @@
1
1
  source 'https://rubygems.org'
2
+
3
+ group :debug do
4
+ gem 'awesome_print'
5
+ end
6
+
7
+ group :test do
8
+ gem 'rake'
9
+ gem 'rspec'
10
+ gem 'mocha'
11
+ end
12
+
13
+ group :release do
14
+ gem 'gem-release'
15
+ end
16
+
2
17
  gemspec
data/Gemfile.lock CHANGED
@@ -1,41 +1,63 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano-s3 (0.2.7)
5
- aws-sdk
6
- capistrano
7
- mime-types
4
+ capistrano-s3 (0.2.9)
5
+ aws-sdk (>= 1.11)
6
+ capistrano (< 3)
7
+ mime-types (>= 1.23)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- aws-sdk (1.8.5)
12
+ awesome_print (1.2.0)
13
+ aws-sdk (1.42.0)
13
14
  json (~> 1.4)
14
15
  nokogiri (>= 1.4.4)
15
- uuidtools (~> 2.1)
16
- capistrano (2.14.2)
16
+ capistrano (2.15.5)
17
17
  highline
18
18
  net-scp (>= 1.0.0)
19
19
  net-sftp (>= 2.0.0)
20
20
  net-ssh (>= 2.0.14)
21
21
  net-ssh-gateway (>= 1.1.0)
22
- highline (1.6.18)
23
- json (1.7.7)
24
- mime-types (1.22)
25
- net-scp (1.1.0)
22
+ diff-lcs (1.2.5)
23
+ gem-release (0.7.3)
24
+ highline (1.6.21)
25
+ json (1.8.1)
26
+ metaclass (0.0.4)
27
+ mime-types (2.3)
28
+ mini_portile (0.6.0)
29
+ mocha (1.1.0)
30
+ metaclass (~> 0.0.1)
31
+ net-scp (1.2.1)
26
32
  net-ssh (>= 2.6.5)
27
- net-sftp (2.1.1)
33
+ net-sftp (2.1.2)
28
34
  net-ssh (>= 2.6.5)
29
- net-ssh (2.6.7)
35
+ net-ssh (2.9.1)
30
36
  net-ssh-gateway (1.2.0)
31
37
  net-ssh (>= 2.6.5)
32
- nokogiri (1.5.9)
33
- rake (10.0.4)
34
- uuidtools (2.1.3)
38
+ nokogiri (1.6.2.1)
39
+ mini_portile (= 0.6.0)
40
+ rake (10.3.2)
41
+ rspec (3.0.0)
42
+ rspec-core (~> 3.0.0)
43
+ rspec-expectations (~> 3.0.0)
44
+ rspec-mocks (~> 3.0.0)
45
+ rspec-core (3.0.0)
46
+ rspec-support (~> 3.0.0)
47
+ rspec-expectations (3.0.0)
48
+ diff-lcs (>= 1.2.0, < 2.0)
49
+ rspec-support (~> 3.0.0)
50
+ rspec-mocks (3.0.0)
51
+ rspec-support (~> 3.0.0)
52
+ rspec-support (3.0.0)
35
53
 
36
54
  PLATFORMS
37
55
  ruby
38
56
 
39
57
  DEPENDENCIES
58
+ awesome_print
40
59
  capistrano-s3!
60
+ gem-release
61
+ mocha
41
62
  rake
63
+ rspec
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  > Enables static websites deployment to Amazon S3 website buckets using Capistrano.
4
4
 
5
+ [![Build Status](https://travis-ci.org/hooktstudios/capistrano-s3.png?branch=master)](https://travis-ci.org/hooktstudios/capistrano-s3)
5
6
  [![Dependency Status](https://gemnasium.com/hooktstudios/capistrano-s3.png)](https://gemnasium.com/hooktstudios/capistrano-s3)
6
7
  [![Code Climate](https://codeclimate.com/github/hooktstudios/capistrano-s3.png)](https://codeclimate.com/github/hooktstudios/capistrano-s3)
7
8
  [![Gem Version](https://badge.fury.io/rb/capistrano-s3.png)](https://rubygems.org/gems/capistrano-s3)
@@ -14,24 +15,24 @@ To learn how to setup your website bucket, see [Amazon Documentation](http://doc
14
15
 
15
16
  ## Getting started
16
17
 
17
- Create a project `Gemfile` :
18
-
19
18
  ```ruby
19
+ # Gemfile
20
20
  source 'https://rubygems.org'
21
21
  gem 'capistrano-s3'
22
22
  ```
23
23
 
24
24
  ### Setup
25
25
 
26
- Install gem, init capistrano & create a public folder that will be published :
26
+ Install gems with bundle, init capistrano & create your public folder that will be published :
27
27
 
28
28
  bundle install
29
29
  bundle exec capify .
30
30
  mkdir public
31
31
 
32
- ### Credentials
32
+ ### Deploy configuration
33
33
 
34
- Set your S3 bucket credentials :
34
+ Replace `deploy.rb` content generated by capify
35
+ with these simple Amazon S3 configurations :
35
36
 
36
37
  ```ruby
37
38
  # config/deploy.rb
@@ -42,38 +43,27 @@ set :access_key_id, "CHANGETHIS"
42
43
  set :secret_access_key, "CHANGETHIS"
43
44
  ```
44
45
 
45
- _Note_: If you are using S3 in non-default region (e.g. EU), you should provide
46
- corresponding
47
- [endpoint](http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region)
48
- via configuration option
49
- ```ruby
50
- set :s3_endpoint, 's3-eu-west-1.amazonaws.com'
51
- ```
52
-
53
46
  ### Deploying
54
47
 
55
- Add content to you public folder and deploy with :
56
-
57
- cap deploy
48
+ Add content to you public folder and run `cap deploy`.
58
49
 
59
50
  If you want to deploy to multiple buckets, have a look at
60
51
  [Capistrano multistage](https://github.com/capistrano/capistrano/wiki/2.x-Multistage-Extension)
61
52
  and configure a bucket per stage configuration.
62
53
 
63
- #### Redirecting
54
+ ## Advanced options
55
+
56
+ ### Custom endpoint
57
+
58
+ If your bucket is not in the default US Standard region,
59
+ set [endpoint](http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region)
60
+ with :
64
61
 
65
- Use `:redirect_options` to natively redirect (via HTTP 301 status code)
66
- any hosted page. For example:
67
62
  ```ruby
68
- set :redirect_options, {
69
- 'index.html' => 'http://example.org',
70
- 'another.html' => '/test.html',
71
- }
63
+ set :s3_endpoint, 's3-eu-west-1.amazonaws.com'
72
64
  ```
73
- Valid redirect destination should either start with `http` or `https` scheme,
74
- or begin with leading slash `/`.
75
65
 
76
- #### S3 write options
66
+ ### Write options
77
67
 
78
68
  capistrano-s3 sets files `:content_type` and `:acl` to `:public_read`, add or override with :
79
69
 
@@ -85,6 +75,19 @@ set :bucket_write_options, {
85
75
 
86
76
  See aws-sdk [S3Client.put_object doc](http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/S3/Client.html#put_object-instance_method) for all available options.
87
77
 
78
+ ### Redirecting
79
+
80
+ Use `:redirect_options` to natively redirect (via HTTP 301 status code)
81
+ any hosted page. For example:
82
+ ```ruby
83
+ set :redirect_options, {
84
+ 'index.html' => 'http://example.org',
85
+ 'another.html' => '/test.html',
86
+ }
87
+ ```
88
+ Valid redirect destination should either start with `http` or `https` scheme,
89
+ or begin with leading slash `/`.
90
+
88
91
  ## Example of usage
89
92
 
90
93
  Our Ruby stack for static websites :
data/Rakefile CHANGED
@@ -1 +1,11 @@
1
- require 'rake'
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rspec/core'
5
+ require 'rspec/core/rake_task'
6
+
7
+ RSpec::Core::RakeTask.new(:spec) do |spec|
8
+ spec.pattern = FileList['spec/**/*_spec.rb']
9
+ end
10
+
11
+ task :default => "spec"
@@ -1,4 +1,6 @@
1
- # -*- encoding: utf-8 -*-
1
+ # encoding: utf-8
2
+ $:.unshift(File.dirname(__FILE__) + '/lib')
3
+ require 'capistrano/s3/version'
2
4
 
3
5
  Gem::Specification.new do |s|
4
6
  s.authors = ['Jean-Philippe Doyle','Josh Delsman','Aleksandrs Ļedovskis','Douglas Jarquin', 'Amit Barvaz']
@@ -12,14 +14,12 @@ Gem::Specification.new do |s|
12
14
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
13
15
  s.name = 'capistrano-s3'
14
16
  s.require_paths = ['lib']
15
- s.version = '0.2.7'
17
+ s.version = Capistrano::S3::VERSION
16
18
  s.cert_chain = ['certs/j15e.pem']
17
- s.signing_key = File.expand_path('~/.gem/private_key.pem') if $0 =~ /gem\z/
19
+ s.signing_key = File.expand_path("~/.ssh/gem-private_key.pem") if $0 =~ /gem\z/
18
20
 
19
21
  # Gem dependencies
20
- s.add_dependency 'aws-sdk'
21
- s.add_dependency 'capistrano'
22
- s.add_dependency 'mime-types'
23
-
24
- s.add_development_dependency 'rake'
22
+ s.add_dependency 'aws-sdk', '>= 1.11'
23
+ s.add_dependency 'capistrano', '< 3'
24
+ s.add_dependency 'mime-types', '>= 1.23'
25
25
  end
data/certs/j15e.pem CHANGED
@@ -1,20 +1,22 @@
1
1
  -----BEGIN CERTIFICATE-----
2
- MIIDRjCCAi6gAwIBAgIBADANBgkqhkiG9w0BAQUFADBJMRswGQYDVQQDDBJqZWFu
2
+ MIIDmjCCAoKgAwIBAgIBATANBgkqhkiG9w0BAQUFADBJMRswGQYDVQQDDBJqZWFu
3
3
  cGhpbGlwcGUuZG95bGUxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT
4
- 8ixkARkWA2NvbTAeFw0xMzAzMTEyMjM5MjNaFw0xNDAzMTEyMjM5MjNaMEkxGzAZ
4
+ 8ixkARkWA2NvbTAeFw0xNDA0MjkyMDM5MjNaFw0xNTA0MjkyMDM5MjNaMEkxGzAZ
5
5
  BgNVBAMMEmplYW5waGlsaXBwZS5kb3lsZTEVMBMGCgmSJomT8ixkARkWBWdtYWls
6
6
  MRMwEQYKCZImiZPyLGQBGRYDY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
7
- CgKCAQEApQtzOyMoi48Pc0BRF++BXc2ulECpOypwYqnzIdbE5+iLownixYB3KkKm
8
- VxIlo9pYWIp5JR+Uphv/P9vKJAIjfldtlus6o8xFT0HujXyEMMbFMGHH01PvDYkx
9
- vnMw5O6YVdtbsKvjknB4JOcOmxQAeXBunLBJk0huOLALlDW38UZF3AKNVPpR+Gst
10
- gTZCIAPq22wB9I0HYfyCitjrMVK4jTHgjPjNNQn4BhuhkqEWr5JkVtipGCUFyl45
11
- 2ISskOPckLW/qwCq4vyjVK6JIZb2Ei9DHtip44u7KjFEX5QdvHyu81xatMmtKvYn
12
- WWKZ/2HCdWRRiPSuHmBR/QlMlUN69QIDAQABozkwNzAJBgNVHRMEAjAAMB0GA1Ud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a3rDskwP2dQT8vlVvNCiBc7lOw4TJkpd9l5wwep+6umh1GIFt80BZ5VomGo+1Sx
17
+ yUuD+VYOaaOLGDF5qqirIn5VDvjNpYKw6s8XKvKawWu61znAZkiklNz9YTog6mo1
18
+ 0/2ggQHWuMoSM8ZNUWg6UKRvSiT+3S0gGyfrybepm9ZFiQVFrFkgLQ+Lt/0vzBJD
19
+ osc8G2grd5N2ieCykW2dfdKftrAoHy9zstg0CTTkFHaoQesLfEE6HdGImfIe2qpJ
20
+ vo0Ni/EOoxL0d1qrp9TiARbe5JDIK4KWKJcyJrsOCnAUNwfqwf0riBGpsnCRwQi7
21
+ c8m4yoP9xz6wjpS7gxQ=
20
22
  -----END CERTIFICATE-----
data/lib/capistrano/s3.rb CHANGED
@@ -1,40 +1,43 @@
1
1
  require 'capistrano'
2
2
  require 'capistrano/s3/publisher'
3
+ require 'capistrano/s3/version'
3
4
 
4
- unless Capistrano::Configuration.respond_to?(:instance)
5
- abort "capistrano-s3 requires Capistrano 2.0 or newer"
6
- end
7
-
8
- Capistrano::Configuration.instance(true).load do
9
- def _cset(name, *args, &block)
10
- set(name, *args, &block) if !exists?(name)
5
+ module Capistrano
6
+ unless Configuration.respond_to?(:instance)
7
+ abort "capistrano-s3 requires Capistrano 2.0 or newer"
11
8
  end
12
9
 
13
- _cset :deployment_path, Dir.pwd.gsub("\n", "") + "/public"
14
- _cset :bucket_write_options, :acl => :public_read
15
- _cset :s3_endpoint, 's3.amazonaws.com'
16
- _cset :redirect_options, {}
10
+ Configuration.instance(true).load do
11
+ def _cset(name, *args, &block)
12
+ set(name, *args, &block) if !exists?(name)
13
+ end
14
+
15
+ _cset :deployment_path, Dir.pwd.gsub("\n", "") + "/public"
16
+ _cset :bucket_write_options, :acl => :public_read
17
+ _cset :s3_endpoint, 's3.amazonaws.com'
18
+ _cset :redirect_options, {}
17
19
 
18
- # Deployment recipes
19
- namespace :deploy do
20
- namespace :s3 do
21
- desc "Empties bucket of all files. Caution when using this command, as it cannot be undone!"
22
- task :empty do
23
- Publisher.clear!(s3_endpoint, access_key_id, secret_access_key, bucket)
20
+ # Deployment recipes
21
+ namespace :deploy do
22
+ namespace :s3 do
23
+ desc "Empties bucket of all files. Caution when using this command, as it cannot be undone!"
24
+ task :empty do
25
+ S3::Publisher.clear!(s3_endpoint, access_key_id, secret_access_key, bucket)
26
+ end
27
+
28
+ desc "Upload files to the bucket in the current state"
29
+ task :upload_files do
30
+ extra_options = { :write => bucket_write_options, :redirect => redirect_options }
31
+ S3::Publisher.publish!(s3_endpoint, access_key_id, secret_access_key,
32
+ bucket, deployment_path, extra_options)
33
+ end
24
34
  end
25
35
 
26
- desc "Upload files to the bucket in the current state"
27
- task :upload_files do
28
- extra_options = { :write => bucket_write_options, :redirect => redirect_options }
29
- Publisher.publish!(s3_endpoint, access_key_id, secret_access_key,
30
- bucket, deployment_path, extra_options)
36
+ task :update do
37
+ s3.upload_files
31
38
  end
32
- end
33
39
 
34
- task :update do
35
- s3.upload_files
40
+ task :restart do; end
36
41
  end
37
-
38
- task :restart do; end
39
42
  end
40
43
  end
@@ -2,7 +2,7 @@ require 'aws/s3'
2
2
  require 'mime/types'
3
3
  require 'fileutils'
4
4
 
5
- module Publisher
5
+ module Capistrano::S3::Publisher
6
6
 
7
7
  LAST_PUBLISHED_FILE = '.last_published'
8
8
 
@@ -72,9 +72,9 @@ module Publisher
72
72
  :acl => :public_read,
73
73
  }
74
74
 
75
- options.merge!( self.build_content_type_hash(file) )
76
- options.merge!( self.build_redirect_hash(path, extra_options[:redirect]) )
77
- options.merge!(extra_options[:write])
75
+ options.merge!(self.build_content_type_hash(file))
76
+ options.merge!(self.build_redirect_hash(path, extra_options[:redirect]))
77
+ options.merge!(extra_options[:write]) if extra_options[:write]
78
78
 
79
79
  s3.put_object(options)
80
80
  end
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module S3
3
+ VERSION = "0.2.9"
4
+ end
5
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe Capistrano::S3::Publisher do
4
+ before do
5
+ @root = File.expand_path('../', __FILE__)
6
+ publish_file = Capistrano::S3::Publisher::LAST_PUBLISHED_FILE
7
+ FileUtils.rm(publish_file) if File.exist?(publish_file)
8
+ end
9
+
10
+ context "on publish!" do
11
+ it "publish all files" do
12
+ AWS::S3::Client::V20060301.any_instance.expects(:put_object).times(4)
13
+
14
+ path = File.join(@root, 'sample')
15
+ Capistrano::S3::Publisher.publish!('s3.amazonaws.com', 'abc', '123', 'mybucket.amazonaws.com', path, {})
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata></metadata>
5
+ <defs>
6
+ <font id="cantarellregular" horiz-adv-x="748" >
7
+ <font-face units-per-em="2048" ascent="1513" descent="-535" />
8
+ <missing-glyph horiz-adv-x="559" />
9
+ <glyph horiz-adv-x="2048" />
10
+ <glyph horiz-adv-x="2048" />
11
+ <glyph unicode="&#xd;" horiz-adv-x="682" />
12
+ <glyph unicode=" " horiz-adv-x="559" />
13
+ <glyph unicode="&#x09;" horiz-adv-x="559" />
14
+ <glyph unicode="&#xa0;" horiz-adv-x="559" />
15
+ <glyph unicode="A" horiz-adv-x="1382" d="M129 0l506 1421h192l506 -1421h-172l-143 414h-588l-143 -414h-158zM481 561h484l-240 694z" />
16
+ <glyph unicode="&#xe000;" horiz-adv-x="985" d="M0 0v985h985v-985h-985z" />
17
+ </font>
18
+ </defs></svg>
@@ -0,0 +1,8 @@
1
+ require 'capistrano/s3/publisher'
2
+ require 'mocha/api'
3
+
4
+ AWS.stub!
5
+
6
+ RSpec.configure do |config|
7
+ config.mock_framework = :mocha
8
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Philippe Doyle
@@ -12,92 +12,73 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain:
15
- - !binary |-
16
- LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURSakNDQWk2Z0F3SUJB
17
- Z0lCQURBTkJna3Foa2lHOXcwQkFRVUZBREJKTVJzd0dRWURWUVFEREJKcVpX
18
- RnUKY0docGJHbHdjR1V1Wkc5NWJHVXhGVEFUQmdvSmtpYUprL0lzWkFFWkZn
19
- Vm5iV0ZwYkRFVE1CRUdDZ21TSm9tVAo4aXhrQVJrV0EyTnZiVEFlRncweE16
20
- QXpNVEV5TWpNNU1qTmFGdzB4TkRBek1URXlNak01TWpOYU1Fa3hHekFaCkJn
21
- TlZCQU1NRW1wbFlXNXdhR2xzYVhCd1pTNWtiM2xzWlRFVk1CTUdDZ21TSm9t
22
- VDhpeGtBUmtXQldkdFlXbHMKTVJNd0VRWUtDWkltaVpQeUxHUUJHUllEWTI5
23
- dE1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQgpDZ0tDQVFF
24
- QXBRdHpPeU1vaTQ4UGMwQlJGKytCWGMydWxFQ3BPeXB3WXFueklkYkU1K2lM
25
- b3duaXhZQjNLa0ttClZ4SWxvOXBZV0lwNUpSK1VwaHYvUDl2S0pBSWpmbGR0
26
- bHVzNm84eEZUMEh1alh5RU1NYkZNR0hIMDFQdkRZa3gKdm5NdzVPNllWZHRi
27
- c0t2amtuQjRKT2NPbXhRQWVYQnVuTEJKazBodU9MQUxsRFczOFVaRjNBS05W
28
- UHBSK0dzdApnVFpDSUFQcTIyd0I5STBIWWZ5Q2l0anJNVks0alRIZ2pQak5O
29
- UW40Qmh1aGtxRVdyNUprVnRpcEdDVUZ5bDQ1CjJJU3NrT1Bja0xXL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o0Ni/EOoxL0d1qrp9TiARbe5JDIK4KWKJcyJrsOCnAUNwfqwf0riBGpsnCRwQi7
36
+ c8m4yoP9xz6wjpS7gxQ=
37
+ -----END CERTIFICATE-----
38
+ date: 2014-06-05 00:00:00.000000000 Z
44
39
  dependencies:
45
40
  - !ruby/object:Gem::Dependency
46
41
  name: aws-sdk
47
42
  requirement: !ruby/object:Gem::Requirement
48
43
  requirements:
49
- - - ! '>='
44
+ - - ">="
50
45
  - !ruby/object:Gem::Version
51
- version: '0'
46
+ version: '1.11'
52
47
  type: :runtime
53
48
  prerelease: false
54
49
  version_requirements: !ruby/object:Gem::Requirement
55
50
  requirements:
56
- - - ! '>='
51
+ - - ">="
57
52
  - !ruby/object:Gem::Version
58
- version: '0'
53
+ version: '1.11'
59
54
  - !ruby/object:Gem::Dependency
60
55
  name: capistrano
61
56
  requirement: !ruby/object:Gem::Requirement
62
57
  requirements:
63
- - - ! '>='
58
+ - - "<"
64
59
  - !ruby/object:Gem::Version
65
- version: '0'
60
+ version: '3'
66
61
  type: :runtime
67
62
  prerelease: false
68
63
  version_requirements: !ruby/object:Gem::Requirement
69
64
  requirements:
70
- - - ! '>='
65
+ - - "<"
71
66
  - !ruby/object:Gem::Version
72
- version: '0'
67
+ version: '3'
73
68
  - !ruby/object:Gem::Dependency
74
69
  name: mime-types
75
70
  requirement: !ruby/object:Gem::Requirement
76
71
  requirements:
77
- - - ! '>='
72
+ - - ">="
78
73
  - !ruby/object:Gem::Version
79
- version: '0'
74
+ version: '1.23'
80
75
  type: :runtime
81
76
  prerelease: false
82
77
  version_requirements: !ruby/object:Gem::Requirement
83
78
  requirements:
84
- - - ! '>='
79
+ - - ">="
85
80
  - !ruby/object:Gem::Version
86
- version: '0'
87
- - !ruby/object:Gem::Dependency
88
- name: rake
89
- requirement: !ruby/object:Gem::Requirement
90
- requirements:
91
- - - ! '>='
92
- - !ruby/object:Gem::Version
93
- version: '0'
94
- type: :development
95
- prerelease: false
96
- version_requirements: !ruby/object:Gem::Requirement
97
- requirements:
98
- - - ! '>='
99
- - !ruby/object:Gem::Version
100
- version: '0'
81
+ version: '1.23'
101
82
  description: Enables static websites deployment to Amazon S3 website buckets using
102
83
  Capistrano.
103
84
  email:
@@ -106,18 +87,26 @@ executables: []
106
87
  extensions: []
107
88
  extra_rdoc_files: []
108
89
  files:
109
- - .gitignore
90
+ - ".gitignore"
91
+ - ".travis.yml"
92
+ - CHANGELOG.md
110
93
  - CONTRIBUTING.md
111
94
  - Gemfile
112
95
  - Gemfile.lock
113
96
  - LICENSE
114
- - NEWS.md
115
97
  - README.md
116
98
  - Rakefile
117
99
  - capistrano-s3.gemspec
118
100
  - certs/j15e.pem
119
101
  - lib/capistrano/s3.rb
120
102
  - lib/capistrano/s3/publisher.rb
103
+ - lib/capistrano/s3/version.rb
104
+ - spec/publisher_spec.rb
105
+ - spec/sample/fonts/cantarell-regular-webfont.eot
106
+ - spec/sample/fonts/cantarell-regular-webfont.svg
107
+ - spec/sample/fonts/cantarell-regular-webfont.ttf
108
+ - spec/sample/fonts/cantarell-regular-webfont.woff
109
+ - spec/spec_helper.rb
121
110
  homepage: http://github.com/hooktstudios/capistrano-s3
122
111
  licenses:
123
112
  - MIT
@@ -128,18 +117,24 @@ require_paths:
128
117
  - lib
129
118
  required_ruby_version: !ruby/object:Gem::Requirement
130
119
  requirements:
131
- - - ! '>='
120
+ - - ">="
132
121
  - !ruby/object:Gem::Version
133
122
  version: '0'
134
123
  required_rubygems_version: !ruby/object:Gem::Requirement
135
124
  requirements:
136
- - - ! '>='
125
+ - - ">="
137
126
  - !ruby/object:Gem::Version
138
127
  version: '0'
139
128
  requirements: []
140
129
  rubyforge_project:
141
- rubygems_version: 2.0.3
130
+ rubygems_version: 2.2.0
142
131
  signing_key:
143
132
  specification_version: 4
144
133
  summary: Build and deploy a static website to Amazon S3
145
- test_files: []
134
+ test_files:
135
+ - spec/publisher_spec.rb
136
+ - spec/sample/fonts/cantarell-regular-webfont.eot
137
+ - spec/sample/fonts/cantarell-regular-webfont.svg
138
+ - spec/sample/fonts/cantarell-regular-webfont.ttf
139
+ - spec/sample/fonts/cantarell-regular-webfont.woff
140
+ - spec/spec_helper.rb
metadata.gz.sig CHANGED
Binary file
data/NEWS.md DELETED
@@ -1,28 +0,0 @@
1
- # capistrano-s3 changes
2
-
3
- ## New in 0.2.7
4
-
5
- * Bugfix : support non-standard file extensions. (#14) @barvaz
6
-
7
- ## New in 0.2.6
8
-
9
- * Feature : Adds ability to specify redirect location for files. (#13) @aledovsky
10
- * Feature : Adds S3 endpoint selection option. (#11) @aledovsky
11
- * Improvement : Require fileutils to support newer rubies. (#10) @douglasjarquin
12
- * Bugfix : Pass a string to the content_type option (#11) @douglasjarquin
13
-
14
- ## New in 0.2.5
15
-
16
- * Improvement : signed gem.
17
-
18
- ## New in 0.2.4
19
-
20
- * Bugfix : fixed error when .last_publish doesn't exist yet.
21
-
22
- ## New in 0.2.3
23
-
24
- * Bugfix : fixed error when no specific bucket_write_options is set.
25
-
26
- ## New in 0.2.2
27
-
28
- * Bugfix : fixed an error caused previously by removing SASS & HAML dependency.