massive_sitemap-writer-s3 0.0.1.rc1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ rvm:
2
+ - 1.9.2
3
+ script: "bundle exec rake spec"
data/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ # Changes
2
+
3
+ ## v0.0.x - ???
4
+
5
+ ## v0.0.1 - 13-02-2012
6
+ _inital release_
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in massive_sitemap-writer-s3.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # MassiveSitemap S3 Writer
2
+
3
+ [![](http://travis-ci.org/rngtng/massive_sitemap-writer-s3.png)](http://travis-ci.org/rngtng/massive_sitemap-writer-s3)
4
+
5
+ S3 Writer extension for [MassiveSitemap](http://rngtng/massive_sitemap)
6
+
7
+ ## Usage
8
+
9
+ ## Dependencies
10
+
11
+ * S3 gem
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ require 'rspec/core/rake_task'
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
7
+
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1.rc1
@@ -0,0 +1,43 @@
1
+ require 's3'
2
+ require 'massive_sitemap/writer/gzip_file'
3
+
4
+ module MassiveSitemap
5
+ module Writer
6
+ class S3 < MassiveSitemap::Writer::GzipFile
7
+
8
+ def initalize(service, bucket, options = {})
9
+ @service = service
10
+ @bucket = service.buckets.find(bucket)
11
+ # read sreams, tale filename (without ext as filter),order DESC
12
+ # delete last file
13
+ # delete random files
14
+ super(options)
15
+ end
16
+
17
+ protected
18
+ def close_stream(stream)
19
+ super
20
+ @bucket.objects.build(::File.basename(filename)).tap do |object|
21
+ object.content = ::File.open(filename)
22
+ object.save
23
+ end
24
+ # add to stream
25
+ # @streams << current
26
+ end
27
+
28
+ def init?
29
+ # check if file is part of streams, fail if so
30
+ #if !options[:force_overwrite] && streams.include?(filename)
31
+ # raise FileExistsException, "Can not create file: #{filename} exits"
32
+ #end
33
+ super
34
+ end
35
+
36
+ def streams
37
+ # @streams
38
+ super
39
+ end
40
+
41
+ end
42
+ end
43
+ end
@@ -0,0 +1 @@
1
+ require 'massive_sitemap/writer/s3'
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "massive_sitemap-writer-s3"
6
+ s.version = File.read("VERSION").to_s.strip
7
+ s.authors = ["Tobias Bielohlawek"]
8
+ s.email = ["tobi@soundcloud.com"]
9
+ s.homepage = "http://github.com/rngtng/massive_sitemap-writer-s3"
10
+ s.summary = %q{Amazon S3 Writer extension for MassiveSitemap}
11
+ s.description = %q{Amazon S3 Writer extension for MassiveSitemap}
12
+
13
+ s.files = `git ls-files`.split("\n")
14
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
16
+ s.require_paths = ["lib"]
17
+
18
+ %w(s3 massive_sitemap).each do |gem|
19
+ s.add_runtime_dependency *gem.split(' ')
20
+ end
21
+
22
+ %w(rake rspec).each do |gem|
23
+ s.add_development_dependency *gem.split(' ')
24
+ end
25
+ end
data/spec/s3_spec.rb ADDED
@@ -0,0 +1,12 @@
1
+ require "spec_helper"
2
+
3
+ describe MassiveSitemap::Writer::S3 do
4
+ let(:service) { }
5
+ let(:bucket) { "example" }
6
+ let(:writer) { MassiveSitemap::Writer::S3.new(service, bucket) }
7
+
8
+ it "works" do
9
+ # writer.close_stream(stream)
10
+
11
+ end
12
+ end
@@ -0,0 +1,3 @@
1
+ $:.unshift File.expand_path("../../lib", __FILE__)
2
+ require 'bundler/setup'
3
+ require 'massive_sitemap-writer-s3'
metadata ADDED
@@ -0,0 +1,103 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: massive_sitemap-writer-s3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1.rc1
5
+ prerelease: 6
6
+ platform: ruby
7
+ authors:
8
+ - Tobias Bielohlawek
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-02-13 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: s3
16
+ requirement: &70170132137220 !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: *70170132137220
25
+ - !ruby/object:Gem::Dependency
26
+ name: massive_sitemap
27
+ requirement: &70170132136760 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70170132136760
36
+ - !ruby/object:Gem::Dependency
37
+ name: rake
38
+ requirement: &70170132136240 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *70170132136240
47
+ - !ruby/object:Gem::Dependency
48
+ name: rspec
49
+ requirement: &70170132135780 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *70170132135780
58
+ description: Amazon S3 Writer extension for MassiveSitemap
59
+ email:
60
+ - tobi@soundcloud.com
61
+ executables: []
62
+ extensions: []
63
+ extra_rdoc_files: []
64
+ files:
65
+ - .gitignore
66
+ - .travis.yml
67
+ - CHANGELOG.md
68
+ - Gemfile
69
+ - README.md
70
+ - Rakefile
71
+ - VERSION
72
+ - lib/massive_sitemap-writer-s3.rb
73
+ - lib/massive_sitemap/writer/s3.rb
74
+ - massive_sitemap-writer-s3.gemspec
75
+ - spec/s3_spec.rb
76
+ - spec/spec_helper.rb
77
+ homepage: http://github.com/rngtng/massive_sitemap-writer-s3
78
+ licenses: []
79
+ post_install_message:
80
+ rdoc_options: []
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ! '>'
93
+ - !ruby/object:Gem::Version
94
+ version: 1.3.1
95
+ requirements: []
96
+ rubyforge_project:
97
+ rubygems_version: 1.8.15
98
+ signing_key:
99
+ specification_version: 3
100
+ summary: Amazon S3 Writer extension for MassiveSitemap
101
+ test_files:
102
+ - spec/s3_spec.rb
103
+ - spec/spec_helper.rb