s3deployer 0.0.1.dev

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/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm 1.9.3@s3deployer --create
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source :rubygems
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,22 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ s3deployer (0.0.1)
5
+ aws-s3
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ aws-s3 (0.6.2)
11
+ builder
12
+ mime-types
13
+ xml-simple
14
+ builder (3.0.0)
15
+ mime-types (1.17.2)
16
+ xml-simple (1.1.1)
17
+
18
+ PLATFORMS
19
+ ruby
20
+
21
+ DEPENDENCIES
22
+ s3deployer!
data/README.markdown ADDED
@@ -0,0 +1,7 @@
1
+ = Deploy A Pile of Stuff to S3
2
+ After rewriting a script to deploy an app to S3, I eventually got sick of it and
3
+ just made this gem.
4
+
5
+ Have fun.
6
+
7
+ Examples are in example.rb
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,3 @@
1
+ class S3Deployer
2
+ VERSION = "0.0.1.dev"
3
+ end
data/lib/s3deployer.rb ADDED
@@ -0,0 +1,29 @@
1
+ require 'aws/s3'
2
+ class S3Deployer
3
+ attr_accessor :directory_to_deploy, :bucket_name
4
+ def initialize(bucket_name, directory_to_deploy)
5
+ @directory_to_deploy = directory_to_deploy
6
+ @bucket_name = bucket_name
7
+ end
8
+ def deploy
9
+ iterate_through_and_deploy(directory_to_deploy)
10
+ end
11
+
12
+ def iterate_through_and_deploy(dir)
13
+ Dir.foreach(dir) do |item|
14
+ next if item[0] == "."
15
+ item_location = "#{dir}/#{item}"
16
+ if File.directory?(item_location)
17
+ iterate_through_and_deploy(item_location)
18
+ else
19
+ upload_item(item_location)
20
+ end
21
+ end
22
+ end
23
+
24
+ def upload_item(item)
25
+ s3_name = item.gsub(directory_to_deploy,'')
26
+ puts "uploading #{item} as #{s3_name}"
27
+ AWS::S3::S3Object.store(s3_name, open(item), bucket_name)
28
+ end
29
+ end
@@ -0,0 +1,16 @@
1
+ $:.push("lib")
2
+ require 's3deployer/version'
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 's3deployer'
6
+ s.version = S3Deployer::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ['Zee Spencer']
9
+ s.email = ['zee@zeespencer.com']
10
+ s.homepage = 'https://github.com/zspencer/s3deployer'
11
+ s.description = "A simple way to deploy a directory to Amazon s3"
12
+ s.summary = "A simple way to deploy a directory to Amazon s3"
13
+ s.files = `git ls-files`.split("\n")
14
+ s.require_paths = ['lib']
15
+ s.add_dependency("aws-s3")
16
+ end
metadata ADDED
@@ -0,0 +1,64 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: s3deployer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1.dev
5
+ prerelease: 6
6
+ platform: ruby
7
+ authors:
8
+ - Zee Spencer
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-03-10 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: aws-s3
16
+ requirement: &70098732123500 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70098732123500
25
+ description: A simple way to deploy a directory to Amazon s3
26
+ email:
27
+ - zee@zeespencer.com
28
+ executables: []
29
+ extensions: []
30
+ extra_rdoc_files: []
31
+ files:
32
+ - .rvmrc
33
+ - Gemfile
34
+ - Gemfile.lock
35
+ - README.markdown
36
+ - Rakefile
37
+ - lib/s3deployer.rb
38
+ - lib/s3deployer/version.rb
39
+ - s3deployer.gemspec
40
+ homepage: https://github.com/zspencer/s3deployer
41
+ licenses: []
42
+ post_install_message:
43
+ rdoc_options: []
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ! '>'
56
+ - !ruby/object:Gem::Version
57
+ version: 1.3.1
58
+ requirements: []
59
+ rubyforge_project:
60
+ rubygems_version: 1.8.17
61
+ signing_key:
62
+ specification_version: 3
63
+ summary: A simple way to deploy a directory to Amazon s3
64
+ test_files: []