sarcastic_bunny 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/lib/sarcastic_bunny.rb +20 -0
- data/lib/sarcastic_bunny/bunny_ext/channel.rb +9 -0
- data/lib/sarcastic_bunny/bunny_ext/exchange.rb +5 -0
- data/lib/sarcastic_bunny/bunny_ext/session.rb +38 -0
- data/lib/sarcastic_bunny/version.rb +3 -0
- data/sarcastic_bunny.gemspec +19 -0
- metadata +54 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a67d5e6f5ea91135cd1223a1cd40ac515364d4f3
|
4
|
+
data.tar.gz: ab1b4c0d54a2c1122125b6db7c46092c176c3148
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 69948efddaa54c746aa602cae13bb3ab093dc940b61c5e3426ee6fe96af2e0b1e144a3eacd4317f337f99aa93467e7b52095ae3a89913e68cd2f5e8c52d24a69
|
7
|
+
data.tar.gz: f209b55a0d6a2f17f7634d78d8625ca96387d49bd37b8d66257561999b57d53181ab92dd365574cfaa7ee1724070724e1c56dc54c826f2c8c8f2e7e38ab63170
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 The Honest Company
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# SarcasticBunny
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'sarcastic_bunny'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install sarcastic_bunny
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "sarcastic_bunny/version"
|
2
|
+
|
3
|
+
module SarcasticBunny
|
4
|
+
def self.clear!
|
5
|
+
@published_messages = []
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.published_messages
|
9
|
+
@published_messages ||= []
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.publish_message(channel, payload, exchange, routing_key, opts)
|
13
|
+
@published_messages ||= []
|
14
|
+
@published_messages << { channel: channel, payload: payload, exchange: exchange, routing_key: routing_key, opts: opts }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
require 'sarcastic_bunny/bunny_ext/channel'
|
19
|
+
require 'sarcastic_bunny/bunny_ext/exchange'
|
20
|
+
require 'sarcastic_bunny/bunny_ext/session'
|
@@ -0,0 +1,38 @@
|
|
1
|
+
Bunny::Session.class_eval do
|
2
|
+
def open?
|
3
|
+
true
|
4
|
+
end
|
5
|
+
alias connected? open?
|
6
|
+
|
7
|
+
def open_connection
|
8
|
+
true
|
9
|
+
end
|
10
|
+
|
11
|
+
def create_channel(n = nil, consumer_pool_size = 1)
|
12
|
+
Bunny::Channel.new(self, n, Bunny::ConsumerWorkPool.new(consumer_pool_size || 1))
|
13
|
+
end
|
14
|
+
|
15
|
+
def next_channel_id
|
16
|
+
1
|
17
|
+
end
|
18
|
+
|
19
|
+
def release_channel_id(i)
|
20
|
+
true
|
21
|
+
end
|
22
|
+
|
23
|
+
def register_channel(ch)
|
24
|
+
@channels[ch.number] = ch
|
25
|
+
end
|
26
|
+
|
27
|
+
def unregister_channel(ch)
|
28
|
+
n = ch.number
|
29
|
+
|
30
|
+
self.release_channel_id(n)
|
31
|
+
@channels.delete(ch.number)
|
32
|
+
end
|
33
|
+
|
34
|
+
def initialize_transport
|
35
|
+
true
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'sarcastic_bunny/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "sarcastic_bunny"
|
8
|
+
gem.version = SarcasticBunny::VERSION
|
9
|
+
gem.authors = ["Justin Ricaurte"]
|
10
|
+
gem.email = ["justin@honest.com"]
|
11
|
+
gem.description = %q{This is for mocking the bunny gem or maybe the bunny gem is mocking you...}
|
12
|
+
gem.summary = %q{This is for mocking the bunny gem or maybe the bunny gem is mocking you...}
|
13
|
+
gem.homepage = ""
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sarcastic_bunny
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Justin Ricaurte
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-08-28 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: This is for mocking the bunny gem or maybe the bunny gem is mocking you...
|
14
|
+
email:
|
15
|
+
- justin@honest.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- ".gitignore"
|
21
|
+
- Gemfile
|
22
|
+
- LICENSE.txt
|
23
|
+
- README.md
|
24
|
+
- Rakefile
|
25
|
+
- lib/sarcastic_bunny.rb
|
26
|
+
- lib/sarcastic_bunny/bunny_ext/channel.rb
|
27
|
+
- lib/sarcastic_bunny/bunny_ext/exchange.rb
|
28
|
+
- lib/sarcastic_bunny/bunny_ext/session.rb
|
29
|
+
- lib/sarcastic_bunny/version.rb
|
30
|
+
- sarcastic_bunny.gemspec
|
31
|
+
homepage: ''
|
32
|
+
licenses: []
|
33
|
+
metadata: {}
|
34
|
+
post_install_message:
|
35
|
+
rdoc_options: []
|
36
|
+
require_paths:
|
37
|
+
- lib
|
38
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
requirements: []
|
49
|
+
rubyforge_project:
|
50
|
+
rubygems_version: 2.1.11
|
51
|
+
signing_key:
|
52
|
+
specification_version: 4
|
53
|
+
summary: This is for mocking the bunny gem or maybe the bunny gem is mocking you...
|
54
|
+
test_files: []
|