happening 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -4
- data/lib/happening.rb +14 -0
- data/test/s3/request_test.rb +1 -1
- metadata +6 -5
- /data/lib/{aws.rb → happening/aws.rb} +0 -0
- /data/lib/{log.rb → happening/log.rb} +0 -0
- /data/lib/{s3 → happening/s3}/item.rb +0 -0
- /data/lib/{s3 → happening/s3}/request.rb +0 -0
data/README.md
CHANGED
@@ -97,10 +97,12 @@ Deleting
|
|
97
97
|
Happening support the simple S3 PUT upload:
|
98
98
|
|
99
99
|
EM.run do
|
100
|
-
on_error = Proc.new {|
|
101
|
-
|
102
|
-
item
|
103
|
-
|
100
|
+
on_error = Proc.new {|response| puts "An error occured: #{response.response_header.status}"; EM.stop }
|
101
|
+
item = Happening::S3::Item.new('bucket', 'item_id', :aws_access_key_id => 'Your-ID', :aws_secret_access_key => 'secret')
|
102
|
+
item.delete(:on_error => on_error) do |response|
|
103
|
+
puts "Deleted!"
|
104
|
+
EM.stop
|
105
|
+
end
|
104
106
|
end
|
105
107
|
|
106
108
|
Amazon returns no content on delete, so having a success handler is usually not needed for delete operations.
|
data/lib/happening.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'em-http'
|
3
|
+
require 'openssl'
|
4
|
+
require 'active_support'
|
5
|
+
|
6
|
+
require File.dirname(__FILE__) + '/happening/log'
|
7
|
+
require File.dirname(__FILE__) + '/happening/aws'
|
8
|
+
require File.dirname(__FILE__) + '/happening/s3/request'
|
9
|
+
require File.dirname(__FILE__) + '/happening/s3/item'
|
10
|
+
|
11
|
+
module Happening
|
12
|
+
class Error < RuntimeError
|
13
|
+
end
|
14
|
+
end
|
data/test/s3/request_test.rb
CHANGED
@@ -4,7 +4,7 @@ class ItemTest < Test::Unit::TestCase
|
|
4
4
|
context "An Happening::S3::Request instance" do
|
5
5
|
|
6
6
|
setup do
|
7
|
-
Happening::Log.level = Logger::
|
7
|
+
Happening::Log.level = Logger::ERROR
|
8
8
|
@response_stub = stub()
|
9
9
|
@response_stub.stubs(:errback)
|
10
10
|
@response_stub.stubs(:callback)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: happening
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Weiss
|
@@ -44,10 +44,11 @@ extra_rdoc_files:
|
|
44
44
|
files:
|
45
45
|
- LICENSE.txt
|
46
46
|
- README.md
|
47
|
-
- lib/
|
48
|
-
- lib/
|
49
|
-
- lib/
|
50
|
-
- lib/s3/
|
47
|
+
- lib/happening.rb
|
48
|
+
- lib/happening/aws.rb
|
49
|
+
- lib/happening/log.rb
|
50
|
+
- lib/happening/s3/item.rb
|
51
|
+
- lib/happening/s3/request.rb
|
51
52
|
has_rdoc: true
|
52
53
|
homepage: http://github.com/peritor/happening
|
53
54
|
licenses: []
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|