aws-dev-utils 1.4.7 → 1.4.8

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
  SHA256:
3
- metadata.gz: dc968e3d775fc320bc9b2704926f0fa84b3c7b8bdf28c5915275694af7bb3c1b
4
- data.tar.gz: 52c095a4e4e8a5df03f415887ee869d102eb7f7bc40905b82bca018c532e6640
3
+ metadata.gz: 133632b0672e9313460c49b69dab68ac465e4d7c47d91c8e5021b7f5b02c4353
4
+ data.tar.gz: '068989b426924ff1094320269d146e69e135b2bb28a23fa35d767b938aa6c880'
5
5
  SHA512:
6
- metadata.gz: 815ce68ebf0fe5e0615f7420eb43604c3e9c306c607864f01a89ec1838dcd841ab284ddc9b4266cf35370ff69efefbc4a2996b451c86949cffd332292c810a3f
7
- data.tar.gz: a1339281a567f083923a369c57ce978864a8b93d73169f2bfbe2ad06c5b81fe6e15a2cfcb6473629076384a4242f0e05c1606824f1ec60d58bda7d045d934c71
6
+ metadata.gz: e5fe09acdea5374f0e79251af18fc26888d5647e8ba13e316389d7aac833ad2c25649aca123f7416cfca2ed4fefd99d5a4c7bdc170aee7b6453c2b371cf3db2a
7
+ data.tar.gz: a8d471e5bc6acbf991bd1794ed286a08ccc401e35ab9eef57ba336669bf7e026b28529fc327a8058abe6528d77d72e30ad95328c77733c2e0288d055029b0df7
data/README.md CHANGED
@@ -62,62 +62,61 @@ AwsDevUtils::Cache.instance.backend = AwsDevUtils::Backend::Redis.new("redis-url
62
62
 
63
63
  _Note: Data will be restored from the cache only if it is the same request to AWS client, the same filters and the same expiration time ._
64
64
 
65
- - ```ruby
66
- # Memory Caching.
67
- require 'aws-dev-utils'
68
- using AwsDevUtils::Refinements
69
-
70
- ec2_client = Aws::EC2::Client.new
71
- ec2_client.
72
- with_cache.
73
- describe_instances(filters:[{ name: "vpc-id", values: ["vpc-foo"]}])
74
- ```
75
-
76
- - ```ruby
77
- # Redis based caching with default experiation time (60 seconds).
78
- require 'aws-dev-utils'
79
- using AwsDevUtils::Refinements
80
-
81
- AwsDevUtils::Cache.instance.backend = AwsDevUtils::Backend::Redis.new("redis-url")
82
- ec2_client.
83
- with_cache.
84
- describe_instances(filters:[{ name: "vpc-id", values: ["vpc-foo"]}])
85
- ```
86
-
87
- - ```ruby
88
- # Redis based caching with custom expiration time (10 minutes).
89
- require 'aws-dev-utils'
90
- using AwsDevUtils::Refinements
91
-
92
- AwsDevUtils::Cache.instance.backend = AwsDevUtils::Backend::Redis.new("redis-url")
93
- ec2_client.
94
- with_cache(600).
95
- describe_instances(filters:[{ name: "vpc-id", values: ["vpc-foo"]}])
96
- ```
97
-
98
- - ```ruby
99
- # Example of different cache keys from requests.
100
- require 'aws-dev-utils'
101
- using AwsDevUtils::Refinements
102
-
103
- AwsDevUtils::Cache.instance.backend = AwsDevUtils::Backend::Redis.new("redis-url")
104
-
105
- # No cache data so request goes to AWS servers.
106
- foo_1_instances = ec2_client.
107
- with_cache(600).
108
- describe_instances(filters:[{ name: "vpc-id", values: ["vpc-foo"]}])
109
-
110
- # Different filters than foo_1_instances so request goes to AWS servers.
111
- bar_1_instances = ec2_client.
112
- with_cache(600).
113
- describe_instances(filters:[{ name: "vpc-id", values: ["vpc-bar"]}])
114
-
115
- # Same filters as bar_1_instances, so result is fetched from cache.
116
- bar_2_instances = ec2_client.
117
- with_cache(600).
118
- describe_instances(filters:[{ name: "vpc-id", values: ["vpc-bar"]}])
119
-
120
- ```
65
+ ```ruby
66
+ # Memory Caching.
67
+ require 'aws-dev-utils'
68
+ using AwsDevUtils::Refinements
69
+
70
+ ec2_client = Aws::EC2::Client.new
71
+ ec2_client.
72
+ with_cache.
73
+ describe_instances(filters:[{ name: "vpc-id", values: ["vpc-foo"]}])
74
+ ```
75
+
76
+ ```ruby
77
+ # Redis based caching with default experiation time (60 seconds).
78
+ require 'aws-dev-utils'
79
+ using AwsDevUtils::Refinements
80
+
81
+ AwsDevUtils::Cache.instance.backend = AwsDevUtils::Backend::Redis.new("redis-url")
82
+ ec2_client.
83
+ with_cache.
84
+ describe_instances(filters:[{ name: "vpc-id", values: ["vpc-foo"]}])
85
+ ```
86
+
87
+ ```ruby
88
+ # Redis based caching with custom expiration time (10 minutes).
89
+ require 'aws-dev-utils'
90
+ using AwsDevUtils::Refinements
91
+
92
+ AwsDevUtils::Cache.instance.backend = AwsDevUtils::Backend::Redis.new("redis-url")
93
+ ec2_client.
94
+ with_cache(600).
95
+ describe_instances(filters:[{ name: "vpc-id", values: ["vpc-foo"]}])
96
+ ```
97
+
98
+ ```ruby
99
+ # Example of different cache keys from requests.
100
+ require 'aws-dev-utils'
101
+ using AwsDevUtils::Refinements
102
+
103
+ AwsDevUtils::Cache.instance.backend = AwsDevUtils::Backend::Redis.new("redis-url")
104
+
105
+ # No cache data so request goes to AWS servers.
106
+ foo_1_instances = ec2_client.
107
+ with_cache(600).
108
+ describe_instances(filters:[{ name: "vpc-id", values: ["vpc-foo"]}])
109
+
110
+ # Different filters than foo_1_instances so request goes to AWS servers.
111
+ bar_1_instances = ec2_client.
112
+ with_cache(600).
113
+ describe_instances(filters:[{ name: "vpc-id", values: ["vpc-bar"]}])
114
+
115
+ # Same filters as bar_1_instances, so result is fetched from cache.
116
+ bar_2_instances = ec2_client.
117
+ with_cache(600).
118
+ describe_instances(filters:[{ name: "vpc-id", values: ["vpc-bar"]}])
119
+ ```
121
120
 
122
121
  ### with_retry
123
122
  By using the `client.with_retry`, the client functions will be retried in case of an exception (until the max number of retries is reached - the default is 5).
@@ -1,3 +1,3 @@
1
1
  module AwsDevUtils
2
- VERSION = '1.4.7'
2
+ VERSION = '1.4.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-dev-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.7
4
+ version: 1.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Infastructure