redis-time-series 0.7.2 → 0.8.1

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
  SHA256:
3
- metadata.gz: a81f643a8aab78bd7e05a2a49fad6b6ed11ce2ff726407c160c9f4e0aa7ded86
4
- data.tar.gz: a95158195524300ab4891cfd9f5b5ecabb41c20b288f661b902a776c69e3deb4
3
+ metadata.gz: 7e5cca8991e5d6ae3ad22183b08949d3d2d537133d0ddea1c5a015731600544e
4
+ data.tar.gz: 5b8862380560758cb2955e06a947068c73478806f1dbe386c23714789594ded3
5
5
  SHA512:
6
- metadata.gz: ceac0848dae65288f972a6f93dc06f4837915e8b689b0e6d7b318ddcd9bde8ae9ecf58a3853fd9741f191414801b1b262ecfed01ed50bca7abcbfc8f76e279c4
7
- data.tar.gz: 3e89f3984f39344cb4b6d390f0883b3c70cf370bd8a9aa680679d4badab3212b1dac50cb893e4678f150395c25e5e66adc75cbf2d2095de0d6e67aab112c5840
6
+ metadata.gz: 4f02a7db5472550fc575b9d3dea62fce6d9718f76a95547f86e35d8986603cf99e83ec82c672333f862ad940bcc54d97e3e7eb8f5a108f75650b8d9731007b20
7
+ data.tar.gz: 3ebfbe989c54976ad6c715f958fa561ee04a56a549f980a6c29f13c4d849ec7bca1f7750c2f526b738ce20ee95a1e568a4ee35ad855237f0e2078eb209846bc4
@@ -15,7 +15,7 @@ jobs:
15
15
  fail-fast: false
16
16
  matrix:
17
17
  image_version: ['latest', 'edge']
18
- ruby_version: ['2.6', '2.7', '3.0', '3.1']
18
+ ruby_version: ['2.7', '3.0', '3.1', '3.2', '3.3']
19
19
  services:
20
20
  redis:
21
21
  image: redislabs/redistimeseries:${{ matrix.image_version }}
@@ -26,7 +26,7 @@ jobs:
26
26
  GIT_COMMIT_SHA: ${{ github.sha }}
27
27
  GIT_BRANCH: ${{ github.head_ref }}
28
28
  steps:
29
- - uses: actions/checkout@v2
29
+ - uses: actions/checkout@v4
30
30
  - name: Set up Ruby
31
31
  uses: ruby/setup-ruby@v1
32
32
  with:
@@ -44,7 +44,7 @@ jobs:
44
44
  run: bundle exec appraisal rake spec
45
45
  - name: Upload coverage report
46
46
  run: ./cc-test-reporter after-build -t simplecov coverage/.resultset.json
47
- - uses: actions/upload-artifact@v2
47
+ - uses: actions/upload-artifact@v4
48
48
  with:
49
- name: coverage
49
+ name: coverage-${{ matrix.ruby_version }}-${{ matrix.image_version }}
50
50
  path: coverage/
data/Appraisals CHANGED
@@ -5,3 +5,7 @@ end
5
5
  appraise 'redis 4' do
6
6
  gem 'redis', '~> 4.0'
7
7
  end
8
+
9
+ appraise 'redis 5' do
10
+ gem 'redis', '~> 5.0'
11
+ end
data/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.8.1
6
+ * Add Ruby 3.2 to build matrix (#82)
7
+ * Bump actions versions to v4 (#86)
8
+ * Add Ruby 3.3, drop Ruby 2.6 from build matrix (#87)
9
+ * Allow filters to use any filter type (#85) (@optijon)
10
+
11
+ ## 0.8.0
12
+ * Remove usage of `Redis.current` (#78)
13
+ * Fix flaky aggregation spec (#80)
14
+ * Compatibility updates and spec fixes (#81)
15
+ * Add redis-rb 5.x to appraisals (#83)
16
+
5
17
  ## 0.7.2
6
18
  * Fix sample building for TS.MADD with multiple series (#77)
7
19
 
data/README.md CHANGED
@@ -50,6 +50,12 @@ Or install it yourself as:
50
50
 
51
51
  Check out the Redis Time Series [command documentation](https://oss.redislabs.com/redistimeseries/master/commands/) first. Should be able to do most of that.
52
52
 
53
+ ### Configuring
54
+ You can set the default Redis client for class-level calls operating on multiple series, as well as series created without specifying a client.
55
+ ```ruby
56
+ Redis::TimeSeries.redis = Redis.new(url: ENV['REDIS_URL'], timeout: 1)
57
+ ```
58
+
53
59
  ### Creating a Series
54
60
  Create a series (issues `TS.CREATE` command) and return a Redis::TimeSeries object for further use. Key param is required, all other arguments are optional.
55
61
  ```ruby
@@ -58,7 +64,7 @@ ts = Redis::TimeSeries.create(
58
64
  labels: { foo: 'bar' },
59
65
  retention: 600,
60
66
  uncompressed: false,
61
- redis: Redis.new(url: ENV['REDIS_URL']) # defaults to Redis.current
67
+ redis: Redis.new(url: ENV['REDIS_URL']) # defaults to Redis::TimeSeries.redis
62
68
  )
63
69
  ```
64
70
  You can also call `.new` instead of `.create` to skip the `TS.CREATE` command.
data/bin/setup CHANGED
@@ -10,7 +10,7 @@ require 'active_support/core_ext/numeric/time'
10
10
  require 'redis'
11
11
  require 'redis-time-series'
12
12
 
13
- Redis.current.flushall
13
+ Redis.new.flushall
14
14
  ts1 = Redis::TimeSeries.create('ts1')
15
15
  ts2 = Redis::TimeSeries.create('ts2')
16
16
  ts3 = Redis::TimeSeries.create('ts3')
@@ -42,9 +42,9 @@ class Redis
42
42
  @debug = !!bool
43
43
  end
44
44
 
45
- # @return [Redis] the current Redis client. Defaults to +Redis.current+
45
+ # @return [Redis] the current Redis client. Defaults to +Redis.new+
46
46
  def redis
47
- @redis ||= Redis.current
47
+ @redis ||= Redis.new
48
48
  end
49
49
 
50
50
  # Set the default Redis client for time series objects.
@@ -68,7 +68,7 @@ class Redis
68
68
  end
69
69
 
70
70
  def cmd_with_redis(redis, name, *args)
71
- args = args.flatten.compact.map { |arg| arg.is_a?(Time) ? arg.ts_msec : arg }
71
+ args = args.flatten.compact.map { |arg| arg.is_a?(Time) ? arg.ts_msec : arg.to_s }
72
72
  puts "DEBUG: #{name} #{args.join(' ')}" if debug
73
73
  redis.call name, args
74
74
  end
@@ -124,7 +124,7 @@ class Redis
124
124
  end
125
125
 
126
126
  def valid?
127
- !!filters.find { |f| f.is_a? Equal }
127
+ !!filters.find { |f| f.is_a?(Equal) || f.is_a?(AnyValue)}
128
128
  end
129
129
 
130
130
  def to_a
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  class Redis
3
3
  class TimeSeries
4
- VERSION = '0.7.2'
4
+ VERSION = '0.8.1'
5
5
  end
6
6
  end
@@ -214,7 +214,7 @@ class Redis
214
214
  end
215
215
  else
216
216
  # single value, no timestamp
217
- [key, '*', raw]
217
+ [[key, '*', raw]]
218
218
  end
219
219
  end
220
220
  end
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
34
34
  spec.add_dependency 'redis', '>= 3.3'
35
35
 
36
36
  spec.add_development_dependency 'activesupport', '~> 6.0'
37
- spec.add_development_dependency 'appraisal', '>= 2.4.1'
37
+ spec.add_development_dependency 'appraisal', '>= 2.5.0'
38
38
  spec.add_development_dependency 'bundler', '~> 2.0'
39
39
  spec.add_development_dependency 'pry', '~> 0.13'
40
40
  spec.add_development_dependency 'rake', '~> 13.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-time-series
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Duszynski
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-26 00:00:00.000000000 Z
11
+ date: 2024-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 2.4.1
47
+ version: 2.5.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 2.4.1
54
+ version: 2.5.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
176
  - !ruby/object:Gem::Version
177
177
  version: '0'
178
178
  requirements: []
179
- rubygems_version: 3.2.22
179
+ rubygems_version: 3.5.3
180
180
  signing_key:
181
181
  specification_version: 4
182
182
  summary: A Ruby adapter for the RedisTimeSeries module.