gio-redis 0.0.2 → 0.0.3

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: d75e20471a85809648d47357c950211657aec17a
4
- data.tar.gz: ee2f7eaed1760cdacca425ec109e29dde1baa3a5
3
+ metadata.gz: b083c99174accd832e228cae1e9d9e1694448ea0
4
+ data.tar.gz: eec2068206ceb5902e8446058a0c7126375aa8f9
5
5
  SHA512:
6
- metadata.gz: 8ceda2a4a3566d4a1e1e0bcc891ed1a8db2538108a9b83017df6e879437c7ac2eb3f187f6c05c774baa4207414eaee8a0b0c1545e7fc8dbaf8f51c4e822429ac
7
- data.tar.gz: 5197119e9a0d53e6307f6aee00e7dba23c5b1f86534f795608638f8fd14ae052e77a3ce946d5fae840230a2276be482bcd87e6c0393c486475356164e4ac97d7
6
+ metadata.gz: 7578da123252f59c2fce40cf0bdc5dbf3d02f82defa15b70d746da1c7416e2935858637360176bc4a5240e3baac4202636f402bbc347dd8bc8f2449cb18c8e79
7
+ data.tar.gz: 24cdba543697a2a83e7c0a2d30f0a4ea43d662655aad4c02d4d78a62abc400f4d0ff3c7f449516f7b8cc021ed8126692c21a1e74755d57750d12f8f4fe0155a1
data/Rakefile CHANGED
@@ -1 +1,7 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new do |t|
5
+ t.pattern = "test/test_*.rb"
6
+ end
7
+
data/lib/gio/redis.rb CHANGED
@@ -51,13 +51,18 @@ module Gio
51
51
 
52
52
  private
53
53
  def inet_address_from_string(host)
54
- if Gio::InetAddress.respond_to?(:new_from_string)
55
- Gio::InetAddress.new_from_string(host)
54
+ case host
55
+ when '^(\d+[.]){3}\d+$'
56
+ if Gio::InetAddress.respond_to?(:new_from_string)
57
+ Gio::InetAddress.new_from_string(host)
58
+ else
59
+ Gio::InetAddress.new(host)
60
+ end
56
61
  else
57
- Gio::InetAddress.new(host)
62
+ Gio::Resolver.default.lookup_by_name(host).first
58
63
  end
59
64
  end
60
-
65
+
61
66
  def call_command(*args)
62
67
  command = "*#{args.size}\r\n"
63
68
  args.each { |a|
@@ -1,5 +1,5 @@
1
1
  module Gio
2
2
  class Redis
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -22,5 +22,16 @@ class GioTest < Test::Unit::TestCase
22
22
  g.poll
23
23
  assert_equal "All clear", response, "Response received"
24
24
  end
25
+
26
+ def test_hostname
27
+ g = Gio::Redis.new('localhost')
28
+ r = ::Redis.new
29
+ response = nil
30
+ g.subscribe('gio-redis-test') { |_| response = _ }
31
+ r.publish('gio-redis-test', 'All clear')
32
+ sleep 0.2
33
+ g.poll
34
+ assert_equal "All clear", response, "Response received"
35
+ end
25
36
  end
26
37
 
metadata CHANGED
@@ -1,98 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gio-redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
- - |
8
- Geoff Youngs
7
+ - 'Geoff Youngs
8
+
9
+ '
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2014-04-09 00:00:00.000000000 Z
13
+ date: 2016-08-31 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: hiredis
16
17
  requirement: !ruby/object:Gem::Requirement
17
18
  requirements:
18
- - - '>='
19
+ - - ">="
19
20
  - !ruby/object:Gem::Version
20
21
  version: '0'
21
22
  type: :runtime
22
23
  prerelease: false
23
24
  version_requirements: !ruby/object:Gem::Requirement
24
25
  requirements:
25
- - - '>='
26
+ - - ">="
26
27
  - !ruby/object:Gem::Version
27
28
  version: '0'
28
29
  - !ruby/object:Gem::Dependency
29
30
  name: gio2
30
31
  requirement: !ruby/object:Gem::Requirement
31
32
  requirements:
32
- - - '>='
33
+ - - ">="
33
34
  - !ruby/object:Gem::Version
34
35
  version: '0'
35
36
  type: :runtime
36
37
  prerelease: false
37
38
  version_requirements: !ruby/object:Gem::Requirement
38
39
  requirements:
39
- - - '>='
40
+ - - ">="
40
41
  - !ruby/object:Gem::Version
41
42
  version: '0'
42
43
  - !ruby/object:Gem::Dependency
43
44
  name: bundler
44
45
  requirement: !ruby/object:Gem::Requirement
45
46
  requirements:
46
- - - ~>
47
+ - - "~>"
47
48
  - !ruby/object:Gem::Version
48
49
  version: '1.3'
49
50
  type: :development
50
51
  prerelease: false
51
52
  version_requirements: !ruby/object:Gem::Requirement
52
53
  requirements:
53
- - - ~>
54
+ - - "~>"
54
55
  - !ruby/object:Gem::Version
55
56
  version: '1.3'
56
57
  - !ruby/object:Gem::Dependency
57
58
  name: redis
58
59
  requirement: !ruby/object:Gem::Requirement
59
60
  requirements:
60
- - - '>='
61
+ - - ">="
61
62
  - !ruby/object:Gem::Version
62
63
  version: '0'
63
64
  type: :development
64
65
  prerelease: false
65
66
  version_requirements: !ruby/object:Gem::Requirement
66
67
  requirements:
67
- - - '>='
68
+ - - ">="
68
69
  - !ruby/object:Gem::Version
69
70
  version: '0'
70
71
  - !ruby/object:Gem::Dependency
71
72
  name: rake
72
73
  requirement: !ruby/object:Gem::Requirement
73
74
  requirements:
74
- - - '>='
75
+ - - ">="
75
76
  - !ruby/object:Gem::Version
76
77
  version: '0'
77
78
  type: :development
78
79
  prerelease: false
79
80
  version_requirements: !ruby/object:Gem::Requirement
80
81
  requirements:
81
- - - '>='
82
+ - - ">="
82
83
  - !ruby/object:Gem::Version
83
84
  version: '0'
84
85
  - !ruby/object:Gem::Dependency
85
86
  name: gtk2
86
87
  requirement: !ruby/object:Gem::Requirement
87
88
  requirements:
88
- - - '>='
89
+ - - ">="
89
90
  - !ruby/object:Gem::Version
90
91
  version: '0'
91
92
  type: :development
92
93
  prerelease: false
93
94
  version_requirements: !ruby/object:Gem::Requirement
94
95
  requirements:
95
- - - '>='
96
+ - - ">="
96
97
  - !ruby/object:Gem::Version
97
98
  version: '0'
98
99
  description: Minimal Redis message client for use with the Ruby-GNOME2 gio2 bindings.
@@ -102,7 +103,7 @@ executables: []
102
103
  extensions: []
103
104
  extra_rdoc_files: []
104
105
  files:
105
- - .gitignore
106
+ - ".gitignore"
106
107
  - Gemfile
107
108
  - LICENSE.txt
108
109
  - README.md
@@ -122,17 +123,17 @@ require_paths:
122
123
  - lib
123
124
  required_ruby_version: !ruby/object:Gem::Requirement
124
125
  requirements:
125
- - - '>='
126
+ - - ">="
126
127
  - !ruby/object:Gem::Version
127
128
  version: '0'
128
129
  required_rubygems_version: !ruby/object:Gem::Requirement
129
130
  requirements:
130
- - - '>='
131
+ - - ">="
131
132
  - !ruby/object:Gem::Version
132
133
  version: '0'
133
134
  requirements: []
134
135
  rubyforge_project:
135
- rubygems_version: 2.2.2
136
+ rubygems_version: 2.5.1
136
137
  signing_key:
137
138
  specification_version: 4
138
139
  summary: gio2 based redis pub/sub listener