dalli-elasticache 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,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YzQzNDVlOWIxZjJjMzhlMGE1ODU2OWI1NjA0OTc2YmQwYmM5MmJmMw==
5
- data.tar.gz: !binary |-
6
- NjY5MTAyMTY5NzVjMTQwMGVlMjE2ZWY3ODI2ODdmMDQ0ZWUyOGZkMQ==
2
+ SHA1:
3
+ metadata.gz: 3223c4e9eb1fd636a8841a415905203022f03276
4
+ data.tar.gz: b853a9d5674e3d4335cd8b6046f3dfa3eba5ef0f
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ODRmOGIwMjU0OGFkOGUzZjcyMjY2OWEyMDA1MTMyYTVjZGNhYzEwODE2M2Y5
10
- YmU1ZTIwOWU3YjkyNGY1YzViZTY5Mzc1Y2M3YWI2OTRlOGJjZmViOTdkMGY4
11
- NTczZTQ3MjA3YzRmZDA4NDFlYzliYTAzMjJjNGNhNDI2YjNkM2M=
12
- data.tar.gz: !binary |-
13
- NGI3NTU1MGE2NDAxM2RjYjQyNGViMjRhNGQzYTRkMDBjZDAxYjU4MDM3ODVl
14
- NTg0YTI0ZmJjNDIwYjIyN2M2ODZkMGJlYTk2YzNmM2RmYTE4NzdhNGMyMTI3
15
- YjEyY2U1YmQyNmYwMDhjYjhkYWFjYWQ5NWUxMjA3NDc4NDI2OGQ=
6
+ metadata.gz: aa250e3c5c9aa4e55434c7d05b76deaea939735414dafac2cd5b2a3dbf42b46042c7931420f872e837a79384394f15a1f1e48f32d9d44eca529f4896e6fc9063
7
+ data.tar.gz: 627f5c1718932bcbfd7cd661a8c03b55e1ccbb714478598ffffcb28e247f07b503a2e3208f3c90b3778a2a62bbf9496f5ae884f5e470a702f9cd6451d22ddefb
data/README.md CHANGED
@@ -51,11 +51,11 @@ Fetch information about the Memcached nodes:
51
51
  ```ruby
52
52
  # Dalli::Client with configuration from the AutoDiscovery endpoint
53
53
  elasticache.client
54
- # => #<Dalli::Client ... @servers=["10.84.227.155:11211", ...]>
54
+ # => #<Dalli::Client ... @servers=["aaron-scratch.vfdnac.0001.use1.cache.amazonaws.com:11211", ...]>
55
55
 
56
- # Node IP addresses and hostnames
56
+ # Node addresses
57
57
  elasticache.servers
58
- # => ["10.84.227.115:11211", "10.77.71.127:11211"]
58
+ # => ["aaron-scratch.vfdnac.0001.use1.cache.amazonaws.com:11211", "aaron-scratch.vfdnac.0002.use1.cache.amazonaws.com:11211"]
59
59
 
60
60
  # Number of times the cluster configuration has changed
61
61
  elasticache.version
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  require "rubygems"
2
2
  require "bundler/setup"
3
+ require "bundler/gem_tasks"
3
4
  require "rspec/core/rake_task"
4
5
 
5
6
  RSpec::Core::RakeTask.new(:test)
@@ -32,8 +32,9 @@ module Dalli
32
32
  end
33
33
 
34
34
  # List of cluster server nodes with ip addresses and ports
35
+ # Always use host name instead of private elasticache IPs as internal IPs can change after a node is rebooted
35
36
  def servers
36
- endpoint.config.nodes.map{ |h| "#{h[:ip]}:#{h[:port]}" }
37
+ endpoint.config.nodes.map{ |h| "#{h[:host]}:#{h[:port]}" }
37
38
  end
38
39
 
39
40
  # Clear all cached data from the cluster endpoint
@@ -1,5 +1,5 @@
1
1
  module Dalli
2
2
  class ElastiCache
3
- VERSION = "0.1.2"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -9,7 +9,10 @@ describe 'Dalli::ElastiCache::Endpoint' do
9
9
  }
10
10
  Dalli::ElastiCache.new("my-cluster.cfg.use1.cache.amazonaws.com:11211", options)
11
11
  end
12
-
12
+
13
+ let(:config_text) { "CONFIG cluster 0 141\r\n12\nmycluster.0001.cache.amazonaws.com|10.112.21.1|11211 mycluster.0002.cache.amazonaws.com|10.112.21.2|11211 mycluster.0003.cache.amazonaws.com|10.112.21.3|11211\n\r\n" }
14
+ let(:response) { Dalli::Elasticache::AutoDiscovery::ConfigResponse.new(config_text) }
15
+
13
16
  describe '.new' do
14
17
  it 'builds endpoint' do
15
18
  cache.endpoint.host.should == "my-cluster.cfg.use1.cache.amazonaws.com"
@@ -29,7 +32,11 @@ describe 'Dalli::ElastiCache::Endpoint' do
29
32
  end
30
33
 
31
34
  describe '#servers' do
32
- it 'lists addresses and ports'
35
+ before { Dalli::Elasticache::AutoDiscovery::Endpoint.any_instance.should_receive(:get_config_from_remote).and_return(response) }
36
+
37
+ it 'lists addresses and ports' do
38
+ cache.servers.should == ["mycluster.0001.cache.amazonaws.com:11211", "mycluster.0002.cache.amazonaws.com:11211", "mycluster.0003.cache.amazonaws.com:11211"]
39
+ end
33
40
  end
34
41
 
35
42
  describe '#version' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dalli-elasticache
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
7
  - Aaron Suggs
@@ -9,53 +9,54 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-08 00:00:00.000000000 Z
12
+ date: 2016-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ! '>='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ! '>='
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rspec
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ! '>='
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ! '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: dalli
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ! '>='
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: 1.0.0
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ! '>='
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: 1.0.0
56
- description: ! " This gem provides an interface for fetching cluster information
57
- from an AWS\n ElastiCache AutoDiscovery server and configuring a Dalli client
58
- to connect\n to all nodes in the cache cluster.\n"
56
+ description: |2
57
+ This gem provides an interface for fetching cluster information from an AWS
58
+ ElastiCache AutoDiscovery server and configuring a Dalli client to connect
59
+ to all nodes in the cache cluster.
59
60
  email:
60
61
  - aaron@ktheory.com
61
62
  - zach@magoosh.com
@@ -63,14 +64,14 @@ executables: []
63
64
  extensions: []
64
65
  extra_rdoc_files: []
65
66
  files:
67
+ - README.md
68
+ - Rakefile
69
+ - lib/dalli-elasticache.rb
70
+ - lib/dalli/elasticache.rb
66
71
  - lib/dalli/elasticache/auto_discovery/config_response.rb
67
72
  - lib/dalli/elasticache/auto_discovery/endpoint.rb
68
73
  - lib/dalli/elasticache/auto_discovery/stats_response.rb
69
74
  - lib/dalli/elasticache/version.rb
70
- - lib/dalli/elasticache.rb
71
- - lib/dalli-elasticache.rb
72
- - README.md
73
- - Rakefile
74
75
  - spec/config_response_spec.rb
75
76
  - spec/elasticache_spec.rb
76
77
  - spec/endpoint_spec.rb
@@ -82,22 +83,22 @@ licenses:
82
83
  metadata: {}
83
84
  post_install_message:
84
85
  rdoc_options:
85
- - --charset=UTF-8
86
+ - "--charset=UTF-8"
86
87
  require_paths:
87
88
  - lib
88
89
  required_ruby_version: !ruby/object:Gem::Requirement
89
90
  requirements:
90
- - - ! '>='
91
+ - - ">="
91
92
  - !ruby/object:Gem::Version
92
93
  version: 1.9.2
93
94
  required_rubygems_version: !ruby/object:Gem::Requirement
94
95
  requirements:
95
- - - ! '>='
96
+ - - ">="
96
97
  - !ruby/object:Gem::Version
97
98
  version: 1.3.5
98
99
  requirements: []
99
100
  rubyforge_project:
100
- rubygems_version: 2.1.11
101
+ rubygems_version: 2.5.2
101
102
  signing_key:
102
103
  specification_version: 4
103
104
  summary: Configure Dalli clients with ElastiCache's AutoDiscovery