thread_queues 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +17 -0
- data/Gemfile.lock +78 -0
- data/LICENSE.txt +20 -0
- data/README.md +71 -0
- data/Rakefile +50 -0
- data/VERSION +1 -0
- data/lib/thread_queues/blocking_queue.rb +52 -0
- data/lib/thread_queues/buffered_queue.rb +61 -0
- data/lib/thread_queues.rb +13 -0
- data/shippable.yml +9 -0
- data/spec/spec_helper.rb +32 -0
- data/spec/thread_queues/blocking_queue_spec.rb +43 -0
- data/spec/thread_queues/buffered_queue_spec.rb +52 -0
- data/spec/thread_queues_spec.rb +4 -0
- data/thread_queues.gemspec +72 -0
- metadata +146 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9ea8098a4b776f92b6830ca986b09277cd5ecc43
|
4
|
+
data.tar.gz: 8d07b550c6eaa33739303921c0503a6eaebab004
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 57e4074340c6f1edb561bcef380d2eecebd7aeccc8e61f02ebbbc5a27a4adc5b9a1510e23b5fb3d960b612fe9bb126f6522ec7aa5597df6c1664ee8c192c67f1
|
7
|
+
data.tar.gz: e04edca9a185a43bf926da9bb7a21e9a9e85828b866f71f6fd2f7aa079ee767d85667304b492dc5fd60e64a7a0a609a3cac15bcf6f1446752e88eb6b2f3394f1
|
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
gem "string-cases"
|
7
|
+
gem "codeclimate-test-reporter", group: :test, require: nil
|
8
|
+
|
9
|
+
# Add dependencies to develop your gem here.
|
10
|
+
# Include everything needed to run rake, tests, features, etc.
|
11
|
+
group :development do
|
12
|
+
gem "rspec", "~> 2.8.0"
|
13
|
+
gem "rdoc", "~> 3.12"
|
14
|
+
gem "bundler", "~> 1.0"
|
15
|
+
gem "jeweler", "~> 2.0.1"
|
16
|
+
gem "simplecov", ">= 0"
|
17
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
addressable (2.3.6)
|
5
|
+
builder (3.2.2)
|
6
|
+
codeclimate-test-reporter (0.4.2)
|
7
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
8
|
+
descendants_tracker (0.0.4)
|
9
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
10
|
+
diff-lcs (1.1.3)
|
11
|
+
docile (1.1.5)
|
12
|
+
faraday (0.9.0)
|
13
|
+
multipart-post (>= 1.2, < 3)
|
14
|
+
git (1.2.8)
|
15
|
+
github_api (0.12.2)
|
16
|
+
addressable (~> 2.3)
|
17
|
+
descendants_tracker (~> 0.0.4)
|
18
|
+
faraday (~> 0.8, < 0.10)
|
19
|
+
hashie (>= 3.3)
|
20
|
+
multi_json (>= 1.7.5, < 2.0)
|
21
|
+
nokogiri (~> 1.6.3)
|
22
|
+
oauth2
|
23
|
+
hashie (3.3.2)
|
24
|
+
highline (1.6.21)
|
25
|
+
jeweler (2.0.1)
|
26
|
+
builder
|
27
|
+
bundler (>= 1.0)
|
28
|
+
git (>= 1.2.5)
|
29
|
+
github_api
|
30
|
+
highline (>= 1.6.15)
|
31
|
+
nokogiri (>= 1.5.10)
|
32
|
+
rake
|
33
|
+
rdoc
|
34
|
+
json (1.8.1)
|
35
|
+
jwt (1.2.0)
|
36
|
+
mini_portile (0.6.1)
|
37
|
+
multi_json (1.10.1)
|
38
|
+
multi_xml (0.5.5)
|
39
|
+
multipart-post (2.0.0)
|
40
|
+
nokogiri (1.6.4)
|
41
|
+
mini_portile (~> 0.6.0)
|
42
|
+
oauth2 (1.0.0)
|
43
|
+
faraday (>= 0.8, < 0.10)
|
44
|
+
jwt (~> 1.0)
|
45
|
+
multi_json (~> 1.3)
|
46
|
+
multi_xml (~> 0.5)
|
47
|
+
rack (~> 1.2)
|
48
|
+
rack (1.5.2)
|
49
|
+
rake (10.4.2)
|
50
|
+
rdoc (3.12.2)
|
51
|
+
json (~> 1.4)
|
52
|
+
rspec (2.8.0)
|
53
|
+
rspec-core (~> 2.8.0)
|
54
|
+
rspec-expectations (~> 2.8.0)
|
55
|
+
rspec-mocks (~> 2.8.0)
|
56
|
+
rspec-core (2.8.0)
|
57
|
+
rspec-expectations (2.8.0)
|
58
|
+
diff-lcs (~> 1.1.2)
|
59
|
+
rspec-mocks (2.8.0)
|
60
|
+
simplecov (0.9.1)
|
61
|
+
docile (~> 1.1.0)
|
62
|
+
multi_json (~> 1.0)
|
63
|
+
simplecov-html (~> 0.8.0)
|
64
|
+
simplecov-html (0.8.0)
|
65
|
+
string-cases (0.0.0)
|
66
|
+
thread_safe (0.3.4)
|
67
|
+
|
68
|
+
PLATFORMS
|
69
|
+
ruby
|
70
|
+
|
71
|
+
DEPENDENCIES
|
72
|
+
bundler (~> 1.0)
|
73
|
+
codeclimate-test-reporter
|
74
|
+
jeweler (~> 2.0.1)
|
75
|
+
rdoc (~> 3.12)
|
76
|
+
rspec (~> 2.8.0)
|
77
|
+
simplecov
|
78
|
+
string-cases
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2014 kaspernj
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
[![Build Status](https://api.shippable.com/projects/54842b6dd46935d5fbbf8e53/badge?branchName=master)](https://app.shippable.com/projects/54842b6dd46935d5fbbf8e53/builds/latest)
|
2
|
+
[![Code Climate](https://codeclimate.com/github/kaspernj/thread_queues/badges/gpa.svg)](https://codeclimate.com/github/kaspernj/thread_queues)
|
3
|
+
[![Test Coverage](https://codeclimate.com/github/kaspernj/thread_queues/badges/coverage.svg)](https://codeclimate.com/github/kaspernj/thread_queues)
|
4
|
+
|
5
|
+
# ThreadQueues
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem "thead_queues"
|
11
|
+
```
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
### BlockingQueue
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
queue = ThreadQueues::BlockingQueue.new
|
19
|
+
|
20
|
+
Thread.new do
|
21
|
+
3.times do |count|
|
22
|
+
queue.push(count)
|
23
|
+
end
|
24
|
+
|
25
|
+
queue.close
|
26
|
+
end
|
27
|
+
|
28
|
+
3.times do |count|
|
29
|
+
queue.pop #=> 0|1|2
|
30
|
+
end
|
31
|
+
|
32
|
+
queue.pop #=> EOFError
|
33
|
+
```
|
34
|
+
|
35
|
+
### BufferedQueue
|
36
|
+
|
37
|
+
Example buffered 5 results before blocking and waiting for results to be read.
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
queue = ThreadQueues::BufferedQueue.new(5)
|
41
|
+
|
42
|
+
Thread.new do
|
43
|
+
10.times do |count|
|
44
|
+
queue.push(count)
|
45
|
+
end
|
46
|
+
|
47
|
+
queue.close
|
48
|
+
end
|
49
|
+
|
50
|
+
10.times do |count|
|
51
|
+
queue.pop #=> 0|1|2|3|4|5|6|7|8|9
|
52
|
+
end
|
53
|
+
|
54
|
+
queue.pop #=> EOFError
|
55
|
+
```
|
56
|
+
|
57
|
+
## Contributing to thread_queues
|
58
|
+
|
59
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
60
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
61
|
+
* Fork the project.
|
62
|
+
* Start a feature/bugfix branch.
|
63
|
+
* Commit and push until you are happy with your contribution.
|
64
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
65
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
66
|
+
|
67
|
+
## Copyright
|
68
|
+
|
69
|
+
Copyright (c) 2014 kaspernj. See LICENSE.txt for
|
70
|
+
further details.
|
71
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
|
17
|
+
gem.name = "thread_queues"
|
18
|
+
gem.homepage = "http://github.com/kaspernj/thread_queues"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = "Thread-queues for Ruby"
|
21
|
+
gem.description = "Do thread-related work with BlockingQueue and BufferedQueue in Ruby."
|
22
|
+
gem.email = "k@spernj.org"
|
23
|
+
gem.authors = ["kaspernj"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rspec/core'
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
31
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
32
|
+
end
|
33
|
+
|
34
|
+
desc "Code coverage detail"
|
35
|
+
task :simplecov do
|
36
|
+
ENV['COVERAGE'] = "true"
|
37
|
+
Rake::Task['spec'].execute
|
38
|
+
end
|
39
|
+
|
40
|
+
task :default => :spec
|
41
|
+
|
42
|
+
require 'rdoc/task'
|
43
|
+
Rake::RDocTask.new do |rdoc|
|
44
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
45
|
+
|
46
|
+
rdoc.rdoc_dir = 'rdoc'
|
47
|
+
rdoc.title = "thread_queues #{version}"
|
48
|
+
rdoc.rdoc_files.include('README*')
|
49
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
50
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.0
|
@@ -0,0 +1,52 @@
|
|
1
|
+
class ThreadQueues::BlockingQueue
|
2
|
+
def initialize
|
3
|
+
@que = []
|
4
|
+
@mutex = Mutex.new
|
5
|
+
@cond_read = ConditionVariable.new
|
6
|
+
@cond_write = ConditionVariable.new
|
7
|
+
@num_waiting = 0
|
8
|
+
end
|
9
|
+
|
10
|
+
def push(obj)
|
11
|
+
loop do
|
12
|
+
@mutex.synchronize do
|
13
|
+
raise EOFError, "Cannot write to closed queue" if @closed
|
14
|
+
|
15
|
+
if @num_waiting > 0 && @que.empty?
|
16
|
+
@que.push(obj)
|
17
|
+
@cond_write.signal
|
18
|
+
return nil
|
19
|
+
else
|
20
|
+
@cond_read.wait @mutex
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def pop
|
27
|
+
loop do
|
28
|
+
@mutex.synchronize do
|
29
|
+
raise EOFError, "Queue is empty and closed" if @que.empty? && @closed
|
30
|
+
|
31
|
+
if @que.empty?
|
32
|
+
@num_waiting += 1
|
33
|
+
|
34
|
+
begin
|
35
|
+
@cond_read.signal
|
36
|
+
@cond_write.wait @mutex
|
37
|
+
ensure
|
38
|
+
@num_waiting -= 0
|
39
|
+
end
|
40
|
+
else
|
41
|
+
return @que.shift
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def close
|
48
|
+
@mutex.synchronize do
|
49
|
+
@closed = true
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require "monitor"
|
2
|
+
|
3
|
+
class ThreadQueues::BufferedQueue
|
4
|
+
def initialize(max_queued)
|
5
|
+
@que = []
|
6
|
+
@mutex = Mutex.new
|
7
|
+
@cond_read = ConditionVariable.new
|
8
|
+
@cond_write = ConditionVariable.new
|
9
|
+
@num_waiting = 0
|
10
|
+
@max_queued = max_queued
|
11
|
+
end
|
12
|
+
|
13
|
+
def push(obj)
|
14
|
+
loop do
|
15
|
+
@mutex.synchronize do
|
16
|
+
raise EOFError, "Cannot write to closed queue" if @closed
|
17
|
+
|
18
|
+
if length <= @max_queued
|
19
|
+
@que.push(obj)
|
20
|
+
@cond_write.signal
|
21
|
+
return nil
|
22
|
+
else
|
23
|
+
@cond_read.wait @mutex
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def pop
|
30
|
+
loop do
|
31
|
+
@mutex.synchronize do
|
32
|
+
raise EOFError, "Queue is empty and closed" if @que.empty? && @closed
|
33
|
+
|
34
|
+
if @que.empty?
|
35
|
+
@num_waiting += 1
|
36
|
+
|
37
|
+
begin
|
38
|
+
@cond_read.signal
|
39
|
+
@cond_write.wait @mutex
|
40
|
+
ensure
|
41
|
+
@num_waiting -= 0
|
42
|
+
end
|
43
|
+
else
|
44
|
+
obj = @que.shift
|
45
|
+
@cond_read.signal
|
46
|
+
return obj
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def length
|
53
|
+
return @que.length
|
54
|
+
end
|
55
|
+
|
56
|
+
def close
|
57
|
+
@mutex.synchronize do
|
58
|
+
@closed = true
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require "string-cases"
|
2
|
+
|
3
|
+
class ThreadQueues
|
4
|
+
def self.const_missing(name)
|
5
|
+
require_relative "thread_queues/#{::StringCases.camel_to_snake(name)}"
|
6
|
+
|
7
|
+
if ::ThreadQueues.const_defined?(name)
|
8
|
+
return ::ThreadQueues.const_get(name)
|
9
|
+
end
|
10
|
+
|
11
|
+
super
|
12
|
+
end
|
13
|
+
end
|
data/shippable.yml
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require "codeclimate-test-reporter"
|
2
|
+
CodeClimate::TestReporter.start
|
3
|
+
|
4
|
+
require 'simplecov'
|
5
|
+
|
6
|
+
module SimpleCov::Configuration
|
7
|
+
def clean_filters
|
8
|
+
@filters = []
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
SimpleCov.configure do
|
13
|
+
clean_filters
|
14
|
+
load_adapter 'test_frameworks'
|
15
|
+
end
|
16
|
+
|
17
|
+
ENV["COVERAGE"] && SimpleCov.start do
|
18
|
+
add_filter "/.rvm/"
|
19
|
+
end
|
20
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
21
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
22
|
+
|
23
|
+
require 'rspec'
|
24
|
+
require 'thread_queues'
|
25
|
+
|
26
|
+
# Requires supporting files with custom matchers and macros, etc,
|
27
|
+
# in ./support/ and its subdirectories.
|
28
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
29
|
+
|
30
|
+
RSpec.configure do |config|
|
31
|
+
|
32
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe ThreadQueues::BlockingQueue do
|
4
|
+
it "can read and write when writing is slow" do
|
5
|
+
queue = ThreadQueues::BlockingQueue.new
|
6
|
+
|
7
|
+
Thread.new do
|
8
|
+
3.times do |count|
|
9
|
+
sleep 0.01
|
10
|
+
queue.push(count)
|
11
|
+
end
|
12
|
+
|
13
|
+
queue.close
|
14
|
+
end
|
15
|
+
|
16
|
+
3.times do |count|
|
17
|
+
read = queue.pop
|
18
|
+
read.should eq count
|
19
|
+
end
|
20
|
+
|
21
|
+
expect { queue.pop }.to raise_error(EOFError)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "can read and write when reading is slow" do
|
25
|
+
queue = ThreadQueues::BlockingQueue.new
|
26
|
+
|
27
|
+
Thread.new do
|
28
|
+
3.times do |count|
|
29
|
+
queue.push(count)
|
30
|
+
end
|
31
|
+
|
32
|
+
queue.close
|
33
|
+
end
|
34
|
+
|
35
|
+
3.times do |count|
|
36
|
+
sleep 0.01
|
37
|
+
read = queue.pop
|
38
|
+
read.should eq count
|
39
|
+
end
|
40
|
+
|
41
|
+
expect { queue.pop }.to raise_error(EOFError)
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe ThreadQueues::BufferedQueue do
|
4
|
+
it "should work when slow reading" do
|
5
|
+
queue = ThreadQueues::BufferedQueue.new(5)
|
6
|
+
|
7
|
+
$thread_finished = false
|
8
|
+
$thread_work = Thread.new do
|
9
|
+
10.times do |count|
|
10
|
+
queue.push count
|
11
|
+
end
|
12
|
+
$thread_finished = true
|
13
|
+
end
|
14
|
+
|
15
|
+
sleep 0.01
|
16
|
+
|
17
|
+
4.times do |count|
|
18
|
+
queue.pop.should eq count
|
19
|
+
$thread_finished.should eq false
|
20
|
+
sleep 0.01
|
21
|
+
end
|
22
|
+
|
23
|
+
queue.pop.should eq 4
|
24
|
+
sleep 0.01
|
25
|
+
$thread_finished.should eq true
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should work when slow writing" do
|
29
|
+
queue = ThreadQueues::BufferedQueue.new(5)
|
30
|
+
|
31
|
+
$thread_finished = false
|
32
|
+
$thread_work = Thread.new do
|
33
|
+
10.times do |count|
|
34
|
+
queue.push count
|
35
|
+
sleep 0.01
|
36
|
+
end
|
37
|
+
$thread_finished = true
|
38
|
+
end
|
39
|
+
|
40
|
+
sleep 0.01
|
41
|
+
|
42
|
+
4.times do |count|
|
43
|
+
queue.pop.should eq count
|
44
|
+
$thread_finished.should eq false
|
45
|
+
end
|
46
|
+
|
47
|
+
queue.pop.should eq 4
|
48
|
+
sleep 0.07
|
49
|
+
queue.length.should eq 5
|
50
|
+
$thread_finished.should eq true
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: thread_queues 0.0.0 ruby lib
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = "thread_queues"
|
9
|
+
s.version = "0.0.0"
|
10
|
+
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
13
|
+
s.authors = ["kaspernj"]
|
14
|
+
s.date = "2014-12-07"
|
15
|
+
s.description = "Do thread-related work with BlockingQueue and BufferedQueue in Ruby."
|
16
|
+
s.email = "k@spernj.org"
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE.txt",
|
19
|
+
"README.md"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
".document",
|
23
|
+
".rspec",
|
24
|
+
"Gemfile",
|
25
|
+
"Gemfile.lock",
|
26
|
+
"LICENSE.txt",
|
27
|
+
"README.md",
|
28
|
+
"Rakefile",
|
29
|
+
"VERSION",
|
30
|
+
"lib/thread_queues.rb",
|
31
|
+
"lib/thread_queues/blocking_queue.rb",
|
32
|
+
"lib/thread_queues/buffered_queue.rb",
|
33
|
+
"shippable.yml",
|
34
|
+
"spec/spec_helper.rb",
|
35
|
+
"spec/thread_queues/blocking_queue_spec.rb",
|
36
|
+
"spec/thread_queues/buffered_queue_spec.rb",
|
37
|
+
"spec/thread_queues_spec.rb",
|
38
|
+
"thread_queues.gemspec"
|
39
|
+
]
|
40
|
+
s.homepage = "http://github.com/kaspernj/thread_queues"
|
41
|
+
s.licenses = ["MIT"]
|
42
|
+
s.rubygems_version = "2.4.0"
|
43
|
+
s.summary = "Thread-queues for Ruby"
|
44
|
+
|
45
|
+
if s.respond_to? :specification_version then
|
46
|
+
s.specification_version = 4
|
47
|
+
|
48
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
49
|
+
s.add_runtime_dependency(%q<string-cases>, [">= 0"])
|
50
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
|
51
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
52
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0"])
|
53
|
+
s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
|
54
|
+
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
55
|
+
else
|
56
|
+
s.add_dependency(%q<string-cases>, [">= 0"])
|
57
|
+
s.add_dependency(%q<rspec>, ["~> 2.8.0"])
|
58
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
59
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
60
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
61
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
62
|
+
end
|
63
|
+
else
|
64
|
+
s.add_dependency(%q<string-cases>, [">= 0"])
|
65
|
+
s.add_dependency(%q<rspec>, ["~> 2.8.0"])
|
66
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
67
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
68
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
69
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
metadata
ADDED
@@ -0,0 +1,146 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: thread_queues
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- kaspernj
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-12-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: string-cases
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.8.0
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.8.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rdoc
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.12'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.12'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: jeweler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2.0.1
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 2.0.1
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: Do thread-related work with BlockingQueue and BufferedQueue in Ruby.
|
98
|
+
email: k@spernj.org
|
99
|
+
executables: []
|
100
|
+
extensions: []
|
101
|
+
extra_rdoc_files:
|
102
|
+
- LICENSE.txt
|
103
|
+
- README.md
|
104
|
+
files:
|
105
|
+
- ".document"
|
106
|
+
- ".rspec"
|
107
|
+
- Gemfile
|
108
|
+
- Gemfile.lock
|
109
|
+
- LICENSE.txt
|
110
|
+
- README.md
|
111
|
+
- Rakefile
|
112
|
+
- VERSION
|
113
|
+
- lib/thread_queues.rb
|
114
|
+
- lib/thread_queues/blocking_queue.rb
|
115
|
+
- lib/thread_queues/buffered_queue.rb
|
116
|
+
- shippable.yml
|
117
|
+
- spec/spec_helper.rb
|
118
|
+
- spec/thread_queues/blocking_queue_spec.rb
|
119
|
+
- spec/thread_queues/buffered_queue_spec.rb
|
120
|
+
- spec/thread_queues_spec.rb
|
121
|
+
- thread_queues.gemspec
|
122
|
+
homepage: http://github.com/kaspernj/thread_queues
|
123
|
+
licenses:
|
124
|
+
- MIT
|
125
|
+
metadata: {}
|
126
|
+
post_install_message:
|
127
|
+
rdoc_options: []
|
128
|
+
require_paths:
|
129
|
+
- lib
|
130
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
131
|
+
requirements:
|
132
|
+
- - ">="
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0'
|
135
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
requirements: []
|
141
|
+
rubyforge_project:
|
142
|
+
rubygems_version: 2.4.0
|
143
|
+
signing_key:
|
144
|
+
specification_version: 4
|
145
|
+
summary: Thread-queues for Ruby
|
146
|
+
test_files: []
|