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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c1eeb7d31dc8ab0fc09db02331d9116b847af2d
4
- data.tar.gz: 6fcef234faf6569e59c79195bcd657a5751e82ed
3
+ metadata.gz: 97f98f4a68df8e56708112a5f61bb7e1ed08e1f7
4
+ data.tar.gz: bed604a760716cf97f6679324a2f8f0e2225bd5f
5
5
  SHA512:
6
- metadata.gz: 5495713387031f47cdea190c120b51a1226a05b2cbf95e7dc6b83310f40bf0034c5dfc407d01445df23420953b4833d460fdb40dadde42d1af45d3079552d057
7
- data.tar.gz: 868f3381360522b426f5ae2ac0565cc3e7860c55d0a6afb449fc2e2104c70529473fafbe49163ad0e9bb59a6dd5af0526f52f5821baa3456e6af98ce1b6c386d
6
+ metadata.gz: 88dcfc4471f4b926e529920da8d91edbd8d0c54ea5c443e8b9a166a971b8c47f3c0af805df3f27195972d9669b8a528121f14aeca944427d7a4c0ed73620bf13
7
+ data.tar.gz: c5a76d8c6371a232f328193edcb83b7d7d364e712643aa79397a6325659039e31186c942c64769f6739301fc6d8249cefd23e92a39504618f01b1e4f5395f5be
@@ -1 +1 @@
1
- ruby-2.1.0
1
+ 2.1.1
@@ -2,6 +2,7 @@ language: ruby
2
2
  before_install:
3
3
  - "gem install bundler -v '~> 1.5, != 1.5.0'"
4
4
  rvm:
5
+ - 2.1.1
5
6
  - 2.1.0
6
7
  - 2.0.0
7
8
  - 1.9.3
@@ -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
@@ -42,6 +42,9 @@ Install using:
42
42
 
43
43
  $ gem install sidekiq-spy
44
44
 
45
+ The default Ruby version supported is defined in `.ruby-version`.
46
+ Any other versions supported are defined in `.travis.yml`.
47
+
45
48
 
46
49
  ## Usage
47
50
 
@@ -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,
@@ -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 unless url.path.empty?
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
- "redis://#{@host}:#{@port}/#{@database}"
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
@@ -1,5 +1,5 @@
1
1
  module SidekiqSpy
2
2
 
3
- VERSION = '0.3.1'
3
+ VERSION = '0.3.2'
4
4
 
5
5
  end
@@ -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
- # spec.add_dependency "curses", "~> 1.0" # SEE: ext/mkrf_conf.rb
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.url.must_equal 'redis://da.example.com:237/42'
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.1
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-01-05 00:00:00.000000000 Z
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.0
164
+ rubygems_version: 2.2.2
167
165
  signing_key:
168
166
  specification_version: 4
169
167
  summary: Sidekiq monitoring in the console.
@@ -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