nsq-cluster 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af4e1c18926766a3b124a0e962e60b9395f0330e
4
- data.tar.gz: 9fc20529ef3b4d5c58e82e43617bb679d52327f9
3
+ metadata.gz: bb2f06489d4c76e38f2dbf70297322f3a715e0ef
4
+ data.tar.gz: 601c63715a0a16028dae656bdf3e8da83cb6df7f
5
5
  SHA512:
6
- metadata.gz: c0d65780e1ff49e975ebb9450ada77d62551dcd405d1c030970fe84c0446d75e920a545359c5f05a04f7809887de5f79fe6318f35bb6e92a93ba7c7ca87ef550
7
- data.tar.gz: 3e979a9a31a934cfd093bf4fa8dbcf14dc90960659c2d9129e9957a07207ba70c042fde6fafec1db99165b3d0a543f56ae16f816d85f796acccfb68a7c179d1f
6
+ metadata.gz: 8564b8c8a1215bacee880cf3c4ae0f8799e4b2bad7fa2cba869b44ed5d6c7233e0d1df3efdaaa4fed84722926128880c70dd3b4d4c2a321e745a0e1cb4fe7036
7
+ data.tar.gz: 7366cc51ba05e8ad2e6402a1bc5446d62d159b5702d68189f7fb0202ff4e6f8e0ec5c73158c19e400ae9d4df54d285d6e974b64b22557245c167a67c508e7136
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nsq-cluster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
- - Brendan Schwartz
7
+ - Wistia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
@@ -95,7 +95,7 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: Setup nsqd, nsqlookupd, and nsqadmin in a jiffy. Great for testing!
98
- email: brendan@wistia.com
98
+ email: dev@wistia.com
99
99
  executables:
100
100
  - nsq-cluster
101
101
  extensions: []
@@ -103,15 +103,8 @@ extra_rdoc_files:
103
103
  - LICENSE
104
104
  - README.md
105
105
  files:
106
- - ".document"
107
- - ".ruby-gemset"
108
- - ".ruby-version"
109
- - Gemfile
110
- - Gemfile.lock
111
106
  - LICENSE
112
107
  - README.md
113
- - Rakefile
114
- - VERSION
115
108
  - bin/nsq-cluster
116
109
  - lib/nsq-cluster.rb
117
110
  - lib/nsq-cluster/http_wrapper.rb
@@ -119,11 +112,6 @@ files:
119
112
  - lib/nsq-cluster/nsqd.rb
120
113
  - lib/nsq-cluster/nsqlookupd.rb
121
114
  - lib/nsq-cluster/process_wrapper.rb
122
- - nsq-cluster.gemspec
123
- - test/helper.rb
124
- - test/nsq_cluster_spec.rb
125
- - test/nsqd_spec.rb
126
- - test/nsqlookupd_spec.rb
127
115
  homepage: http://github.com/wistia/nsq-cluster
128
116
  licenses:
129
117
  - MIT
data/.document DELETED
@@ -1,5 +0,0 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
data/.ruby-gemset DELETED
@@ -1 +0,0 @@
1
- nsq-cluster
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- ruby-2.1.2
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- gemspec
data/Gemfile.lock DELETED
@@ -1,93 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- nsq-cluster (0.1.2)
5
- nsq-cluster
6
-
7
- GEM
8
- remote: http://rubygems.org/
9
- specs:
10
- activesupport (4.1.0)
11
- i18n (~> 0.6, >= 0.6.9)
12
- json (~> 1.7, >= 1.7.7)
13
- minitest (~> 5.1)
14
- thread_safe (~> 0.1)
15
- tzinfo (~> 1.1)
16
- addressable (2.3.6)
17
- builder (3.2.2)
18
- descendants_tracker (0.0.4)
19
- thread_safe (~> 0.3, >= 0.3.1)
20
- docile (1.1.3)
21
- faraday (0.9.0)
22
- multipart-post (>= 1.2, < 3)
23
- git (1.2.6)
24
- github_api (0.11.3)
25
- addressable (~> 2.3)
26
- descendants_tracker (~> 0.0.1)
27
- faraday (~> 0.8, < 0.10)
28
- hashie (>= 1.2)
29
- multi_json (>= 1.7.5, < 2.0)
30
- nokogiri (~> 1.6.0)
31
- oauth2
32
- hashie (2.1.1)
33
- highline (1.6.21)
34
- i18n (0.6.9)
35
- jeweler (2.0.1)
36
- builder
37
- bundler (>= 1.0)
38
- git (>= 1.2.5)
39
- github_api
40
- highline (>= 1.6.15)
41
- nokogiri (>= 1.5.10)
42
- rake
43
- rdoc
44
- json (1.8.1)
45
- json (1.8.1-java)
46
- jwt (0.1.11)
47
- multi_json (>= 1.5)
48
- mini_portile (0.5.3)
49
- minitest (5.3.2)
50
- multi_json (1.9.2)
51
- multi_xml (0.5.5)
52
- multipart-post (2.0.0)
53
- nokogiri (1.6.1)
54
- mini_portile (~> 0.5.0)
55
- nokogiri (1.6.1-java)
56
- mini_portile (~> 0.5.0)
57
- oauth2 (0.9.3)
58
- faraday (>= 0.8, < 0.10)
59
- jwt (~> 0.1.8)
60
- multi_json (~> 1.3)
61
- multi_xml (~> 0.5)
62
- rack (~> 1.2)
63
- rack (1.5.2)
64
- rake (10.2.2)
65
- rdoc (3.12.2)
66
- json (~> 1.4)
67
- shoulda (3.5.0)
68
- shoulda-context (~> 1.0, >= 1.0.1)
69
- shoulda-matchers (>= 1.4.1, < 3.0)
70
- shoulda-context (1.2.1)
71
- shoulda-matchers (2.6.0)
72
- activesupport (>= 3.0.0)
73
- simplecov (0.8.2)
74
- docile (~> 1.1.0)
75
- multi_json
76
- simplecov-html (~> 0.8.0)
77
- simplecov-html (0.8.0)
78
- thread_safe (0.3.3)
79
- thread_safe (0.3.3-java)
80
- tzinfo (1.1.0)
81
- thread_safe (~> 0.1)
82
-
83
- PLATFORMS
84
- java
85
- ruby
86
-
87
- DEPENDENCIES
88
- bundler (~> 1.0)
89
- jeweler (~> 2.0.1)
90
- nsq-cluster!
91
- rdoc (~> 3.12)
92
- shoulda
93
- simplecov
data/Rakefile DELETED
@@ -1,51 +0,0 @@
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 = "nsq-cluster"
18
- gem.homepage = "http://github.com/wistia/nsq-cluster"
19
- gem.license = "MIT"
20
- gem.summary = %Q{Easily setup and manage a local NSQ cluster}
21
- gem.description = %Q{Setup nsqd, nsqlookupd, and nsqadmin in a jiffy. Great for testing!}
22
- gem.email = "brendan@wistia.com"
23
- gem.authors = ["Brendan Schwartz"]
24
- # dependencies defined in Gemfile
25
- end
26
- Jeweler::RubygemsDotOrgTasks.new
27
-
28
- require 'rake/testtask'
29
- Rake::TestTask.new(:test) do |test|
30
- test.libs << 'lib' << 'test'
31
- test.pattern = 'test/**/*_spec.rb'
32
- test.verbose = true
33
- end
34
-
35
- desc "Code coverage detail"
36
- task :simplecov do
37
- ENV['COVERAGE'] = "true"
38
- Rake::Task['test'].execute
39
- end
40
-
41
- task :default => :test
42
-
43
- require 'rdoc/task'
44
- Rake::RDocTask.new do |rdoc|
45
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
46
-
47
- rdoc.rdoc_dir = 'rdoc'
48
- rdoc.title = "nsq-cluster #{version}"
49
- rdoc.rdoc_files.include('README*')
50
- rdoc.rdoc_files.include('lib/**/*.rb')
51
- end
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.1.2
data/nsq-cluster.gemspec DELETED
@@ -1,77 +0,0 @@
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: nsq-cluster 0.1.2 ruby lib
6
-
7
- Gem::Specification.new do |s|
8
- s.name = "nsq-cluster"
9
- s.version = "0.1.2"
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 = ["Brendan Schwartz"]
14
- s.date = "2014-07-17"
15
- s.description = "Setup nsqd, nsqlookupd, and nsqadmin in a jiffy. Great for testing!"
16
- s.email = "brendan@wistia.com"
17
- s.executables = ["nsq-cluster"]
18
- s.extra_rdoc_files = [
19
- "LICENSE",
20
- "README.md"
21
- ]
22
- s.files = [
23
- ".document",
24
- ".ruby-gemset",
25
- ".ruby-version",
26
- "Gemfile",
27
- "Gemfile.lock",
28
- "LICENSE",
29
- "README.md",
30
- "Rakefile",
31
- "VERSION",
32
- "bin/nsq-cluster",
33
- "lib/nsq-cluster.rb",
34
- "lib/nsq-cluster/http_wrapper.rb",
35
- "lib/nsq-cluster/nsqadmin.rb",
36
- "lib/nsq-cluster/nsqd.rb",
37
- "lib/nsq-cluster/nsqlookupd.rb",
38
- "lib/nsq-cluster/process_wrapper.rb",
39
- "nsq-cluster.gemspec",
40
- "test/helper.rb",
41
- "test/nsq_cluster_spec.rb",
42
- "test/nsqd_spec.rb",
43
- "test/nsqlookupd_spec.rb"
44
- ]
45
- s.homepage = "http://github.com/wistia/nsq-cluster"
46
- s.licenses = ["MIT"]
47
- s.rubygems_version = "2.2.2"
48
- s.summary = "Easily setup and manage a local NSQ cluster"
49
-
50
- if s.respond_to? :specification_version then
51
- s.specification_version = 4
52
-
53
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
54
- s.add_runtime_dependency(%q<nsq-cluster>, [">= 0"])
55
- s.add_development_dependency(%q<shoulda>, [">= 0"])
56
- s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
57
- s.add_development_dependency(%q<bundler>, ["~> 1.0"])
58
- s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
59
- s.add_development_dependency(%q<simplecov>, [">= 0"])
60
- else
61
- s.add_dependency(%q<nsq-cluster>, [">= 0"])
62
- s.add_dependency(%q<shoulda>, [">= 0"])
63
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
64
- s.add_dependency(%q<bundler>, ["~> 1.0"])
65
- s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
66
- s.add_dependency(%q<simplecov>, [">= 0"])
67
- end
68
- else
69
- s.add_dependency(%q<nsq-cluster>, [">= 0"])
70
- s.add_dependency(%q<shoulda>, [">= 0"])
71
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
72
- s.add_dependency(%q<bundler>, ["~> 1.0"])
73
- s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
74
- s.add_dependency(%q<simplecov>, [">= 0"])
75
- end
76
- end
77
-
data/test/helper.rb DELETED
@@ -1,34 +0,0 @@
1
- require 'json'
2
- require 'simplecov'
3
- require 'minitest/autorun'
4
- require 'minitest/pride'
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_profile 'test_frameworks'
15
- end
16
-
17
- ENV["COVERAGE"] && SimpleCov.start do
18
- add_filter "/.rvm/"
19
- end
20
- require 'rubygems'
21
- require 'bundler'
22
- begin
23
- Bundler.setup(:default, :development)
24
- rescue Bundler::BundlerError => e
25
- $stderr.puts e.message
26
- $stderr.puts "Run `bundle install` to install missing gems"
27
- exit e.status_code
28
- end
29
- require 'shoulda'
30
-
31
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
32
- $LOAD_PATH.unshift(File.dirname(__FILE__))
33
- require 'nsq-cluster'
34
-
@@ -1,12 +0,0 @@
1
- require 'helper'
2
-
3
- describe NsqCluster do
4
-
5
- it 'should start up a cluster for realsies' do
6
- cluster = NsqCluster.new(nsqd_count: 1, nsqlookupd_count: 1)
7
- cluster.nsqd.length.must_equal 1
8
- cluster.nsqlookupd.length.must_equal 1
9
- cluster.destroy
10
- end
11
-
12
- end
data/test/nsqd_spec.rb DELETED
@@ -1,159 +0,0 @@
1
- require 'helper'
2
-
3
- describe Nsqd do
4
-
5
- before do
6
- @cluster = NsqCluster.new(nsqd_count: 1, nsqlookupd_count: 1)
7
- @nsqd = @cluster.nsqd.first
8
- sleep 0.1
9
- end
10
-
11
- after do
12
- @cluster.destroy
13
- end
14
-
15
- describe 'api endpoints' do
16
- describe '#ping' do
17
- it 'should return status 200' do
18
- @nsqd.ping.code.must_equal '200'
19
- end
20
- end
21
-
22
- describe '#info' do
23
- it 'should return status 200' do
24
- @nsqd.info.code.must_equal '200'
25
- end
26
- end
27
-
28
- describe '#stats' do
29
- it 'should return status 200' do
30
- @nsqd.stats.code.must_equal '200'
31
- end
32
-
33
- it 'should return JSON' do
34
- JSON.parse(@nsqd.stats.body).must_be_kind_of Hash
35
- end
36
- end
37
-
38
- describe '#pub' do
39
- it 'should return status 200' do
40
- resp = @nsqd.pub('test', 'a message')
41
- resp.code.must_equal '200'
42
- end
43
- end
44
-
45
- describe '#mpub' do
46
- it 'should return status 200' do
47
- resp = @nsqd.mpub('test', 'a message', 'another message', 'last message')
48
- resp.code.must_equal '200'
49
- end
50
-
51
- it 'should create multiple messages' do
52
- resp = @nsqd.mpub('test', 'a message', 'another message', 'last message')
53
-
54
- topic = JSON.parse(@nsqd.stats.body)['data']['topics'].select do |t|
55
- t['topic_name'] == 'test'
56
- end.first
57
-
58
- topic['message_count'].must_equal 3
59
- end
60
- end
61
-
62
- describe '#create' do
63
- it 'should return status 200' do
64
- resp1 = @nsqd.create(topic: 'test')
65
- resp2 = @nsqd.create(topic: 'test', channel: 'default')
66
- resp1.code.must_equal '200'
67
- resp2.code.must_equal '200'
68
- end
69
-
70
- it 'should raise error if topic is not specified' do
71
- proc { @nsqd.create(channel: 'default') }.must_raise RuntimeError
72
- end
73
- end
74
-
75
- describe '#delete' do
76
- before do
77
- @nsqd.create(topic: 'test')
78
- end
79
-
80
- context 'an existing channel' do
81
- it 'should return status 200' do
82
- @nsqd.create(topic: 'test', channel: 'default')
83
- resp = @nsqd.delete(topic: 'test', channel: 'default')
84
- resp.code.must_equal '200'
85
- end
86
- end
87
-
88
- context 'a non-existant channel' do
89
- it 'should return status 500' do
90
- resp = @nsqd.delete(topic: 'test', channel: 'default')
91
- resp.code.must_equal '500'
92
- end
93
- end
94
- end
95
-
96
- describe '#pause' do
97
- before do
98
- @nsqd.create(topic: 'test')
99
- end
100
-
101
- context 'an existing channel' do
102
- it 'should return status 200' do
103
- @nsqd.create(topic: 'test', channel: 'default')
104
- resp = @nsqd.pause(topic: 'test', channel: 'default')
105
- resp.code.must_equal '200'
106
- end
107
- end
108
-
109
- context 'a non-existant channel' do
110
- it 'should return status 500' do
111
- resp = @nsqd.pause(topic: 'test', channel: 'default')
112
- resp.code.must_equal '500'
113
- end
114
- end
115
- end
116
-
117
- describe '#unpause' do
118
- before do
119
- @nsqd.create(topic: 'test')
120
- end
121
-
122
- context 'an existing channel' do
123
- it 'should return status 200' do
124
- @nsqd.create(topic: 'test', channel: 'default')
125
- resp = @nsqd.unpause(topic: 'test', channel: 'default')
126
- resp.code.must_equal '200'
127
- end
128
- end
129
-
130
- context 'a non-existant channel' do
131
- it 'should return status 500' do
132
- resp = @nsqd.unpause(topic: 'test', channel: 'default')
133
- resp.code.must_equal '500'
134
- end
135
- end
136
- end
137
-
138
- describe '#empty' do
139
- before do
140
- @nsqd.create(topic: 'test')
141
- end
142
-
143
- context 'an existing channel' do
144
- it 'should return status 200' do
145
- @nsqd.create(topic: 'test', channel: 'default')
146
- resp = @nsqd.empty(topic: 'test', channel: 'default')
147
- resp.code.must_equal '200'
148
- end
149
- end
150
-
151
- context 'a non-existant channel' do
152
- it 'should return status 500' do
153
- resp = @nsqd.empty(topic: 'test', channel: 'default')
154
- resp.code.must_equal '500'
155
- end
156
- end
157
- end
158
- end
159
- end
@@ -1,65 +0,0 @@
1
- require 'helper'
2
-
3
- describe Nsqlookupd do
4
-
5
- before do
6
- @cluster = NsqCluster.new(nsqd_count: 1, nsqlookupd_count: 1)
7
- @nsqd = @cluster.nsqd.first
8
- @nsqlookupd = @cluster.nsqlookupd.first
9
- sleep 0.1
10
- end
11
-
12
- after do
13
- @cluster.destroy
14
- end
15
-
16
- describe 'api endpoints' do
17
- describe '#ping' do
18
- it 'should return status 200' do
19
- @nsqlookupd.ping.code.must_equal '200'
20
- end
21
- end
22
-
23
- describe '#info' do
24
- it 'should return status 200' do
25
- @nsqlookupd.info.code.must_equal '200'
26
- end
27
- end
28
-
29
- describe '#nodes' do
30
- it 'should return status 200' do
31
- @nsqlookupd.nodes.code.must_equal '200'
32
- end
33
- end
34
-
35
- describe '#topic' do
36
- it 'should return status 200' do
37
- @nsqlookupd.topics.code.must_equal '200'
38
- end
39
- end
40
-
41
- describe '#channels' do
42
- it 'should return status 200' do
43
- @nsqlookupd.channels('default').code.must_equal '200'
44
- end
45
- end
46
-
47
- describe '#lookup' do
48
- context 'an existing topic' do
49
- before do
50
- @nsqd.create(topic: 'test')
51
- end
52
-
53
- it 'should return status 200' do
54
- @nsqlookupd.lookup('test').code.must_equal '200'
55
- end
56
- end
57
-
58
- context 'a non-existant topic' do
59
- it 'should return status 500' do
60
- @nsqlookupd.lookup('wtf').code.must_equal '500'
61
- end
62
- end
63
- end
64
- end
65
- end