sidekiq-spy 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +1 -0
- data/CHANGELOG.md +5 -0
- data/README.md +3 -0
- data/bin/sidekiq-spy +10 -0
- data/lib/sidekiq-spy/config.rb +17 -2
- data/lib/sidekiq-spy/version.rb +1 -1
- data/sidekiq-spy.gemspec +1 -15
- data/test/sidekiq-spy/config_test.rb +37 -3
- metadata +18 -20
- data/ext/mkrf_conf.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97f98f4a68df8e56708112a5f61bb7e1ed08e1f7
|
4
|
+
data.tar.gz: bed604a760716cf97f6679324a2f8f0e2225bd5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88dcfc4471f4b926e529920da8d91edbd8d0c54ea5c443e8b9a166a971b8c47f3c0af805df3f27195972d9669b8a528121f14aeca944427d7a4c0ed73620bf13
|
7
|
+
data.tar.gz: c5a76d8c6371a232f328193edcb83b7d7d364e712643aa79397a6325659039e31186c942c64769f6739301fc6d8249cefd23e92a39504618f01b1e4f5395f5be
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.1.1
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,11 @@ For many of commits by [tiredpixel](http://www.tiredpixel.com), the commit
|
|
6
6
|
message provides information and examples.
|
7
7
|
|
8
8
|
|
9
|
+
## 0.3.2
|
10
|
+
|
11
|
+
- [#11] curses fix for bundle exec on Ruby 2.1.0 and earlier
|
12
|
+
|
13
|
+
|
9
14
|
## 0.3.1
|
10
15
|
|
11
16
|
- major refactoring of data structures
|
data/README.md
CHANGED
data/bin/sidekiq-spy
CHANGED
@@ -23,6 +23,14 @@ OptionParser.new do |opts|
|
|
23
23
|
"Redis connection string URL"
|
24
24
|
) { |o| options[:url] = o }
|
25
25
|
|
26
|
+
opts.on("-U", "--username USERNAME",
|
27
|
+
"Redis username"
|
28
|
+
) { |o| options[:username] = o }
|
29
|
+
|
30
|
+
opts.on("-P", "--password PASSWORD",
|
31
|
+
"Redis password"
|
32
|
+
) { |o| options[:password] = o }
|
33
|
+
|
26
34
|
opts.on("-h", "--host HOSTNAME",
|
27
35
|
"Redis hostname (default: 127.0.0.1)"
|
28
36
|
) { |o| options[:host] = o }
|
@@ -85,6 +93,8 @@ end.parse!
|
|
85
93
|
@app.configure do |c|
|
86
94
|
params = [
|
87
95
|
:url,
|
96
|
+
:username,
|
97
|
+
:password,
|
88
98
|
:host,
|
89
99
|
:port,
|
90
100
|
:database,
|
data/lib/sidekiq-spy/config.rb
CHANGED
@@ -4,6 +4,8 @@ require 'uri'
|
|
4
4
|
module SidekiqSpy
|
5
5
|
class Config
|
6
6
|
|
7
|
+
attr_accessor :username
|
8
|
+
attr_accessor :password
|
7
9
|
attr_accessor :host
|
8
10
|
attr_accessor :port
|
9
11
|
attr_accessor :database
|
@@ -11,6 +13,8 @@ module SidekiqSpy
|
|
11
13
|
attr_accessor :interval
|
12
14
|
|
13
15
|
def initialize
|
16
|
+
@username = nil
|
17
|
+
@password = nil
|
14
18
|
@host = '127.0.0.1'
|
15
19
|
@port = 6379
|
16
20
|
@database = 0
|
@@ -21,13 +25,24 @@ module SidekiqSpy
|
|
21
25
|
def url=(url)
|
22
26
|
url = URI.parse(url)
|
23
27
|
|
28
|
+
@username = url.user if url.user && !url.user.empty?
|
29
|
+
@password = url.password if url.password && !url.password.empty?
|
24
30
|
@host = url.host unless url.host.empty?
|
25
|
-
@port = url.port
|
31
|
+
@port = url.port if url.port
|
26
32
|
@database = url.path.tr('/', '').to_i unless url.path.empty?
|
27
33
|
end
|
28
34
|
|
29
35
|
def url
|
30
|
-
|
36
|
+
url = URI('')
|
37
|
+
|
38
|
+
url.scheme = 'redis'
|
39
|
+
url.user = @username
|
40
|
+
url.password = @password
|
41
|
+
url.host = @host
|
42
|
+
url.port = @port
|
43
|
+
url.path = "/#{@database}"
|
44
|
+
|
45
|
+
url.to_s
|
31
46
|
end
|
32
47
|
|
33
48
|
end
|
data/lib/sidekiq-spy/version.rb
CHANGED
data/sidekiq-spy.gemspec
CHANGED
@@ -18,24 +18,10 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.extensions += [
|
22
|
-
'ext/mkrf_conf.rb',
|
23
|
-
]
|
24
|
-
|
25
21
|
spec.add_dependency "sidekiq", "~> 2.15"
|
26
|
-
|
22
|
+
spec.add_dependency "curses", ">= 1.0.1"
|
27
23
|
|
28
24
|
spec.add_development_dependency "bundler", "~> 1.3", "!= 1.5.0"
|
29
25
|
spec.add_development_dependency "rake"
|
30
26
|
spec.add_development_dependency "mocha", "~> 0.14"
|
31
|
-
|
32
|
-
if RUBY_VERSION >= '2.1'
|
33
|
-
# This is only for development; note that RUBY_VERSION is evaluated at
|
34
|
-
# build-time, not install-time. ext/mkrf_conf.rb takes care of the install-
|
35
|
-
# time dependency; this takes care of the development-time dependency.
|
36
|
-
# Note that this doesn't work in Gemfile, since :ruby_21 is not a valid
|
37
|
-
# platform in Ruby 1.9.3 .
|
38
|
-
# BEWARE: repetition; SEE: ext/mkrf_conf.rb
|
39
|
-
spec.add_development_dependency "curses", "~> 1.0"
|
40
|
-
end
|
41
27
|
end
|
@@ -31,17 +31,51 @@ describe SidekiqSpy::Config do
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
describe "#url" do
|
34
|
+
describe "#url=" do
|
35
35
|
before do
|
36
36
|
@config = SidekiqSpy::Config.new
|
37
|
+
end
|
38
|
+
|
39
|
+
it "sets connection string URL when db" do
|
40
|
+
@config.url = 'redis://da.example.com:237/15'
|
37
41
|
|
42
|
+
@config.url.must_equal 'redis://da.example.com:237/15'
|
43
|
+
end
|
44
|
+
|
45
|
+
it "sets connection string URL when no db" do
|
46
|
+
@config.url = 'redis://da.example.com:237'
|
47
|
+
|
48
|
+
@config.url.must_equal 'redis://da.example.com:237/0'
|
49
|
+
end
|
50
|
+
|
51
|
+
it "sets connection string URL when auth" do
|
52
|
+
@config.url = 'redis://the:dolphins@da.example.com:238/5'
|
53
|
+
|
54
|
+
@config.url.must_equal 'redis://the:dolphins@da.example.com:238/5'
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
describe "#url" do
|
59
|
+
before do
|
60
|
+
@config = SidekiqSpy::Config.new
|
61
|
+
end
|
62
|
+
|
63
|
+
it "returns connection string URL" do
|
38
64
|
@config.host = 'da.example.com'
|
39
65
|
@config.port = 237
|
40
66
|
@config.database = 42
|
67
|
+
|
68
|
+
@config.url.must_equal 'redis://da.example.com:237/42'
|
41
69
|
end
|
42
70
|
|
43
|
-
it "returns connection string URL" do
|
44
|
-
@config.
|
71
|
+
it "returns connection string URL when auth" do
|
72
|
+
@config.username = 'the'
|
73
|
+
@config.password = 'dolphins'
|
74
|
+
@config.host = 'da.example.com'
|
75
|
+
@config.port = 237
|
76
|
+
@config.database = 42
|
77
|
+
|
78
|
+
@config.url.must_equal 'redis://the:dolphins@da.example.com:237/42'
|
45
79
|
end
|
46
80
|
end
|
47
81
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-spy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tiredpixel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.15'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: curses
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.0.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.0.1
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,28 +86,13 @@ dependencies:
|
|
72
86
|
- - "~>"
|
73
87
|
- !ruby/object:Gem::Version
|
74
88
|
version: '0.14'
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
|
-
name: curses
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - "~>"
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: '1.0'
|
82
|
-
type: :development
|
83
|
-
prerelease: false
|
84
|
-
version_requirements: !ruby/object:Gem::Requirement
|
85
|
-
requirements:
|
86
|
-
- - "~>"
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '1.0'
|
89
89
|
description: Sidekiq monitoring in the console. A bit like Sidekiq::Web. But without
|
90
90
|
the web.
|
91
91
|
email:
|
92
92
|
- tp@tiredpixel.com
|
93
93
|
executables:
|
94
94
|
- sidekiq-spy
|
95
|
-
extensions:
|
96
|
-
- ext/mkrf_conf.rb
|
95
|
+
extensions: []
|
97
96
|
extra_rdoc_files: []
|
98
97
|
files:
|
99
98
|
- ".gitignore"
|
@@ -106,7 +105,6 @@ files:
|
|
106
105
|
- README.md
|
107
106
|
- Rakefile
|
108
107
|
- bin/sidekiq-spy
|
109
|
-
- ext/mkrf_conf.rb
|
110
108
|
- lib/sidekiq-spy.rb
|
111
109
|
- lib/sidekiq-spy/app.rb
|
112
110
|
- lib/sidekiq-spy/config.rb
|
@@ -163,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
161
|
version: '0'
|
164
162
|
requirements: []
|
165
163
|
rubyforge_project:
|
166
|
-
rubygems_version: 2.2.
|
164
|
+
rubygems_version: 2.2.2
|
167
165
|
signing_key:
|
168
166
|
specification_version: 4
|
169
167
|
summary: Sidekiq monitoring in the console.
|
data/ext/mkrf_conf.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'rubygems/dependency_installer'
|
2
|
-
|
3
|
-
# SEE: http://en.wikibooks.org/wiki/Ruby_Programming/RubyGems#How_to_install_different_versions_of_gems_depending_on_which_version_of_ruby_the_installee_is_using
|
4
|
-
|
5
|
-
di = Gem::DependencyInstaller.new
|
6
|
-
|
7
|
-
begin
|
8
|
-
if RUBY_VERSION >= '2.1'
|
9
|
-
puts "Installing curses because Ruby #{RUBY_VERSION}"
|
10
|
-
|
11
|
-
# BEWARE: repetition; SEE: sidekiq-spy.gemspec
|
12
|
-
di.install "curses", "~> 1.0"
|
13
|
-
else
|
14
|
-
puts "Not installing curses because Ruby #{RUBY_VERSION}"
|
15
|
-
end
|
16
|
-
rescue => e
|
17
|
-
warn "#{$0}: #{e}"
|
18
|
-
|
19
|
-
exit!
|
20
|
-
end
|
21
|
-
|
22
|
-
puts "Writing fake Rakefile"
|
23
|
-
|
24
|
-
# Write fake Rakefile for rake since Makefile isn't used
|
25
|
-
File.open(File.join(File.dirname(__FILE__), 'Rakefile'), 'w') do |f|
|
26
|
-
f.write("task :default" + $/)
|
27
|
-
end
|