s3-static-site 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ .DS_STORE
data/Gemfile CHANGED
@@ -1,14 +1,3 @@
1
- source "http://rubygems.org"
1
+ source :rubygems
2
2
 
3
- gem "aws-s3"
4
- gem "capistrano"
5
- gem "haml"
6
-
7
- # Add dependencies to develop your gem here.
8
- # Include everything needed to run rake, tests, features, etc.
9
- group :development do
10
- gem "shoulda", ">= 0"
11
- gem "bundler", "~> 1.0.0"
12
- gem "jeweler", "~> 1.5.2"
13
- gem "rcov", ">= 0"
14
- end
3
+ gemspec
@@ -1,45 +1,45 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ s3-static-site (0.2.0)
5
+ aws-sdk
6
+ capistrano
7
+ haml
8
+
1
9
  GEM
2
10
  remote: http://rubygems.org/
3
11
  specs:
4
- aws-s3 (0.6.2)
5
- builder
6
- mime-types
7
- xml-simple
8
- builder (3.0.0)
9
- capistrano (2.5.19)
12
+ aws-sdk (1.5.7)
13
+ httparty (~> 0.7)
14
+ json (~> 1.4)
15
+ nokogiri (>= 1.4.4)
16
+ uuidtools (~> 2.1)
17
+ capistrano (2.12.0)
10
18
  highline
11
19
  net-scp (>= 1.0.0)
12
20
  net-sftp (>= 2.0.0)
13
21
  net-ssh (>= 2.0.14)
14
- net-ssh-gateway (>= 1.0.0)
15
- git (1.2.5)
16
- haml (3.0.25)
17
- highline (1.6.1)
18
- jeweler (1.5.2)
19
- bundler (~> 1.0.0)
20
- git (>= 1.2.5)
21
- rake
22
- mime-types (1.16)
22
+ net-ssh-gateway (>= 1.1.0)
23
+ haml (3.1.6)
24
+ highline (1.6.13)
25
+ httparty (0.8.3)
26
+ multi_json (~> 1.0)
27
+ multi_xml
28
+ json (1.7.3)
29
+ multi_json (1.3.6)
30
+ multi_xml (0.5.1)
23
31
  net-scp (1.0.4)
24
32
  net-ssh (>= 1.99.1)
25
33
  net-sftp (2.0.5)
26
34
  net-ssh (>= 2.0.9)
27
- net-ssh (2.1.0)
28
- net-ssh-gateway (1.0.1)
35
+ net-ssh (2.5.2)
36
+ net-ssh-gateway (1.1.0)
29
37
  net-ssh (>= 1.99.1)
30
- rake (0.8.7)
31
- rcov (0.9.9)
32
- shoulda (2.11.3)
33
- xml-simple (1.0.14)
38
+ nokogiri (1.5.5)
39
+ uuidtools (2.1.3)
34
40
 
35
41
  PLATFORMS
36
42
  ruby
37
43
 
38
44
  DEPENDENCIES
39
- aws-s3
40
- bundler (~> 1.0.0)
41
- capistrano
42
- haml
43
- jeweler (~> 1.5.2)
44
- rcov
45
- shoulda
45
+ s3-static-site!
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011 Josh Delsman
1
+ Copyright (c) 2012 Joshua Delsman/miomoba, Inc.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -1,41 +1 @@
1
- require 'rubygems'
2
- require 'bundler'
3
-
4
- begin
5
- Bundler.setup(:default, :development)
6
- rescue Bundler::BundlerError => e
7
- $stderr.puts e.message
8
- $stderr.puts "Run `bundle install` to install missing gems"
9
- exit e.status_code
10
- end
11
-
12
- require 'rake'
13
- require 'jeweler'
14
-
15
- Jeweler::Tasks.new do |gem|
16
- gem.name = "s3-static-site"
17
- gem.homepage = "http://github.com/voxxit/s3-static-site"
18
- gem.license = "MIT"
19
- gem.summary = %Q{Using Ruby and Capistrano, build and deploy a static website to Amazon S3}
20
- gem.description = %Q{Using Ruby and Capistrano, build and deploy a static website to Amazon S3}
21
- gem.email = "jdelsman@voxxit.com"
22
- gem.authors = ["Josh Delsman"]
23
- end
24
-
25
- Jeweler::RubygemsDotOrgTasks.new
26
-
27
- require 'rake/testtask'
28
- Rake::TestTask.new(:test) do |test|
29
- test.libs << 'lib' << 'test'
30
- test.pattern = 'test/**/test_*.rb'
31
- test.verbose = true
32
- end
33
-
34
- require 'rcov/rcovtask'
35
- Rcov::RcovTask.new do |test|
36
- test.libs << 'test'
37
- test.pattern = 'test/**/test_*.rb'
38
- test.verbose = true
39
- end
40
-
41
- task :default => :test
1
+ require 'rake'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -10,7 +10,7 @@ Capistrano::Configuration.instance(true).load do
10
10
  set(name, *args, &block) if !exists?(name)
11
11
  end
12
12
 
13
- _cset :deployment_path, `pwd`.gsub("\n", "") + "/public/"
13
+ _cset :deployment_path, `pwd`.gsub("\n", "") + "/public"
14
14
 
15
15
  def base_file_path(file)
16
16
  file.gsub(deployment_path, "")
@@ -22,8 +22,11 @@ Capistrano::Configuration.instance(true).load do
22
22
 
23
23
  # Establishes the connection to Amazon S3
24
24
  def establish_connection!
25
- AWS::S3::Base.establish_connection!(
26
- :access_key_id => access_key_id,
25
+ # Send logging to STDOUT
26
+ AWS.config(:logger => Logger.new(STDOUT))
27
+
28
+ AWS::S3.new(
29
+ :access_key_id => access_key_id,
27
30
  :secret_access_key => secret_access_key
28
31
  )
29
32
  end
@@ -33,22 +36,18 @@ Capistrano::Configuration.instance(true).load do
33
36
  namespace :s3 do
34
37
  desc "Empties bucket of all files. Caution when using this command, as it cannot be undone!"
35
38
  task :empty do
36
- establish_connection!
37
-
38
- puts "Emptying bucket..."
39
-
40
- AWS::S3::Bucket.find(bucket).delete_all
39
+ _s3 = establish_connection!
40
+ _s3.buckets[bucket].clear!
41
41
  end
42
42
 
43
43
  desc "Upload files to the bucket in the current state"
44
44
  task :upload_files do
45
- establish_connection!
45
+ _s3 = establish_connection!
46
46
 
47
47
  files.each do |file|
48
48
  if !File.directory?(file)
49
49
  path = base_file_path(file)
50
-
51
- puts "Uploading #{path}..."
50
+ path.gsub!(/^\//, "") # Remove preceding slash for S3
52
51
 
53
52
  contents = case File.extname(path)
54
53
  when ".haml"
@@ -65,14 +64,13 @@ Capistrano::Configuration.instance(true).load do
65
64
  open(file)
66
65
  end
67
66
 
68
- AWS::S3::S3Object.store(path, contents, bucket, :access => :public_read)
67
+ _s3.buckets[bucket].objects[path].write(contents, :acl => :public_read)
69
68
  end
70
69
  end
71
70
  end
72
71
  end
73
72
 
74
73
  task :update do
75
- s3.empty
76
74
  s3.upload_files
77
75
  end
78
76
 
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |gem|
4
+ gem.authors = ["Josh Delsman"]
5
+ gem.email = ["jdelsman@voxxit.com"]
6
+ gem.description = "Using Ruby and Capistrano, build and deploy a static website to Amazon S3"
7
+ gem.summary = "Using Ruby and Capistrano, build and deploy a static website to Amazon S3"
8
+ gem.homepage = "http://github.com/voxxit/s3-static-site"
9
+ gem.licenses = ["MIT"]
10
+ gem.files = `git ls-files`.split($\)
11
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
12
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
+ gem.name = "s3-static-site"
14
+ gem.require_paths = ["lib"]
15
+ gem.version = "0.2.0"
16
+
17
+ # Gem dependencies
18
+ gem.add_dependency("aws-sdk")
19
+ gem.add_dependency("capistrano")
20
+ gem.add_dependency("haml")
21
+ end
metadata CHANGED
@@ -1,106 +1,73 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: s3-static-site
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
4
5
  prerelease:
5
- version: 0.1.0
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Josh Delsman
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-02-22 00:00:00 -05:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: aws-s3
18
- requirement: &id001 !ruby/object:Gem::Requirement
12
+ date: 2012-07-18 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: aws-sdk
16
+ requirement: !ruby/object:Gem::Requirement
19
17
  none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
24
22
  type: :runtime
25
23
  prerelease: false
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
28
31
  name: capistrano
29
- requirement: &id002 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
30
33
  none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: "0"
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
35
38
  type: :runtime
36
39
  prerelease: false
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
39
47
  name: haml
40
- requirement: &id003 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
41
49
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- version: "0"
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
46
54
  type: :runtime
47
55
  prerelease: false
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
50
- name: shoulda
51
- requirement: &id004 !ruby/object:Gem::Requirement
52
- none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: "0"
57
- type: :development
58
- prerelease: false
59
- version_requirements: *id004
60
- - !ruby/object:Gem::Dependency
61
- name: bundler
62
- requirement: &id005 !ruby/object:Gem::Requirement
63
- none: false
64
- requirements:
65
- - - ~>
66
- - !ruby/object:Gem::Version
67
- version: 1.0.0
68
- type: :development
69
- prerelease: false
70
- version_requirements: *id005
71
- - !ruby/object:Gem::Dependency
72
- name: jeweler
73
- requirement: &id006 !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
74
57
  none: false
75
- requirements:
76
- - - ~>
77
- - !ruby/object:Gem::Version
78
- version: 1.5.2
79
- type: :development
80
- prerelease: false
81
- version_requirements: *id006
82
- - !ruby/object:Gem::Dependency
83
- name: rcov
84
- requirement: &id007 !ruby/object:Gem::Requirement
85
- none: false
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: "0"
90
- type: :development
91
- prerelease: false
92
- version_requirements: *id007
93
- description: Using Ruby and Capistrano, build and deploy a static website to Amazon S3
94
- email: jdelsman@voxxit.com
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ description: Using Ruby and Capistrano, build and deploy a static website to Amazon
63
+ S3
64
+ email:
65
+ - jdelsman@voxxit.com
95
66
  executables: []
96
-
97
67
  extensions: []
98
-
99
- extra_rdoc_files:
100
- - LICENSE.txt
101
- - README.rdoc
102
- files:
103
- - .document
68
+ extra_rdoc_files: []
69
+ files:
70
+ - .gitignore
104
71
  - Gemfile
105
72
  - Gemfile.lock
106
73
  - LICENSE.txt
@@ -108,39 +75,30 @@ files:
108
75
  - Rakefile
109
76
  - VERSION
110
77
  - lib/s3-static-site.rb
111
- - test/helper.rb
112
- - test/test_s3-static-site.rb
113
- has_rdoc: true
78
+ - s3-static-site.gemspec
114
79
  homepage: http://github.com/voxxit/s3-static-site
115
- licenses:
80
+ licenses:
116
81
  - MIT
117
82
  post_install_message:
118
83
  rdoc_options: []
119
-
120
- require_paths:
84
+ require_paths:
121
85
  - lib
122
- required_ruby_version: !ruby/object:Gem::Requirement
86
+ required_ruby_version: !ruby/object:Gem::Requirement
123
87
  none: false
124
- requirements:
125
- - - ">="
126
- - !ruby/object:Gem::Version
127
- hash: 4424967007506553392
128
- segments:
129
- - 0
130
- version: "0"
131
- required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ! '>='
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
93
  none: false
133
- requirements:
134
- - - ">="
135
- - !ruby/object:Gem::Version
136
- version: "0"
94
+ requirements:
95
+ - - ! '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
137
98
  requirements: []
138
-
139
99
  rubyforge_project:
140
- rubygems_version: 1.5.2
100
+ rubygems_version: 1.8.24
141
101
  signing_key:
142
102
  specification_version: 3
143
103
  summary: Using Ruby and Capistrano, build and deploy a static website to Amazon S3
144
- test_files:
145
- - test/helper.rb
146
- - test/test_s3-static-site.rb
104
+ test_files: []
data/.document DELETED
@@ -1,5 +0,0 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
@@ -1,21 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler'
3
-
4
- begin
5
- Bundler.setup(:default, :development)
6
- rescue Bundler::BundlerError => e
7
- $stderr.puts e.message
8
- $stderr.puts "Run `bundle install` to install missing gems"
9
- exit e.status_code
10
- end
11
-
12
- require 'test/unit'
13
- require 'shoulda'
14
-
15
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
16
- $LOAD_PATH.unshift(File.dirname(__FILE__))
17
-
18
- require 's3-static-site'
19
-
20
- class Test::Unit::TestCase
21
- end
@@ -1,4 +0,0 @@
1
- require 'helper'
2
-
3
- class TestS3StaticSite < Test::Unit::TestCase
4
- end