Skip to content

Commit 56d48ad

Browse files
authored
Merge pull request #432 from splitio/ci-job-31
Working on add multiple ci jobs.
2 parents 155b6d8 + 2e756bf commit 56d48ad

34 files changed

Lines changed: 114 additions & 121 deletions

.github/workflows/ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,20 @@ jobs:
88
image: redis
99
ports:
1010
- 6379:6379
11+
strategy:
12+
matrix:
13+
ruby: [ '2.5.0', '3.1.1' ]
14+
1115
steps:
1216
- name: Checkout code
1317
uses: actions/checkout@v2
1418
with:
1519
fetch-depth: 0
1620

17-
- name: Set up Ruby
21+
- name: Set up Ruby ${{ matrix.ruby }}
1822
uses: ruby/setup-ruby@v1
1923
with:
20-
ruby-version: 2.5
24+
ruby-version: ${{ matrix.ruby }}
2125

2226
- name: Install dependencies
2327
run: bundle install

.rubocop.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,6 @@ Metrics/ParameterLists:
2727

2828
Metrics/LineLength:
2929
Max: 135
30-
Exclude:
31-
- spec/sse/**/*
32-
- spec/integrations/**/*
33-
- spec/engine/sync_manager_spec.rb
34-
- spec/engine/auth_api_client_spec.rb
35-
- spec/telemetry/synchronizer_spec.rb
36-
- spec/splitclient/split_config_spec.rb
37-
- spec/engine/push_manager_spec.rb
38-
- spec/cache/senders/impressions_sender_adapter_spec.rb
39-
40-
Style/BracesAroundHashParameters:
41-
Exclude:
42-
- spec/integrations/push_client_spec.rb
43-
- spec/engine/synchronizer_spec.rb
4430

4531
Metrics/BlockLength:
4632
Exclude:
@@ -51,6 +37,22 @@ Naming/FileName:
5137
Exclude:
5238
- splitclient-rb.gemspec
5339

40+
Style/OptionalBooleanParameter:
41+
Exclude:
42+
- lib/splitclient-rb/engine/matchers/between_matcher.rb
43+
- lib/splitclient-rb/engine/matchers/combining_matcher.rb
44+
- lib/splitclient-rb/engine/matchers/equal_to_matcher.rb
45+
- lib/splitclient-rb/engine/matchers/less_than_or_equal_to_matcher.rb
46+
- lib/splitclient-rb/engine/matchers/greater_than_or_equal_to_matcher.rb
47+
48+
Style/HashTransformKeys:
49+
Exclude:
50+
- lib/splitclient-rb/engine/matchers/combining_matcher.rb
51+
52+
Style/RedundantReturn:
53+
Exclude:
54+
- lib/splitclient-rb/engine/common/impressions_manager.rb
55+
5456
AllCops:
5557
TargetRubyVersion: 2.5
5658
Exclude:
@@ -70,3 +72,5 @@ AllCops:
7072
- lib/splitclient-rb/engine/synchronizer.rb
7173
- tmp/**/*
7274
- lib/splitclient-rb/sse/event_source/client.rb
75+
- spec/**/*
76+
- .simplecov

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This SDK is designed to work with Split, the platform for controlled rollouts, w
77
[![Twitter Follow](https://img.shields.io/twitter/follow/splitsoftware.svg?style=social&label=Follow&maxAge=1529000)](https://twitter.com/intent/follow?screen_name=splitsoftware)
88

99
## Compatibility
10-
The Ruby SDK support Ruby version 2.3.0 or later and JRuby or 9.1.17 o later.
10+
The Ruby SDK support Ruby version 2.5.0 or later and JRuby or 9.1.17 o later.
1111

1212
Also the Ruby SDK has been tested as a standalone app as well as using the following web servers:
1313
- Puma

lib/splitclient-rb/cache/fetchers/segment_fetcher.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ def fetch_segments_if_not_exists(names, cache_control_headers = false)
3030
fetch_segment(name, fetch_options) if change_number == -1
3131
end
3232
end
33-
rescue StandardError => error
34-
@config.log_found_exception(__method__.to_s, error)
33+
rescue StandardError => e
34+
@config.log_found_exception(__method__.to_s, e)
3535
end
3636

3737
def fetch_segment(name, fetch_options = { cache_control_headers: false, till: nil })
3838
@semaphore.synchronize do
3939
segments_api.fetch_segments_by_names([name], fetch_options)
4040
end
41-
rescue StandardError => error
42-
@config.log_found_exception(__method__.to_s, error)
41+
rescue StandardError => e
42+
@config.log_found_exception(__method__.to_s, e)
4343
end
4444

4545
def fetch_segments
@@ -48,8 +48,8 @@ def fetch_segments
4848

4949
true
5050
end
51-
rescue StandardError => error
52-
@config.log_found_exception(__method__.to_s, error)
51+
rescue StandardError => e
52+
@config.log_found_exception(__method__.to_s, e)
5353
false
5454
end
5555

lib/splitclient-rb/cache/fetchers/split_fetcher.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ def fetch_splits(fetch_options = { cache_control_headers: false, till: nil })
3636

3737
{ segment_names: data[:segment_names], success: true }
3838
end
39-
rescue StandardError => error
40-
@config.log_found_exception(__method__.to_s, error)
39+
rescue StandardError => e
40+
@config.log_found_exception(__method__.to_s, e)
4141
{ segment_names: [], success: false }
4242
end
4343

lib/splitclient-rb/cache/repositories/events/memory_repository.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ def add(key, traffic_type, event_type, time, value, properties, event_size)
1919
post_events if @size >= EVENTS_MAX_SIZE_BYTES || @adapter.length == @config.events_queue_size
2020

2121
@telemetry_runtime_producer.record_events_stats(Telemetry::Domain::Constants::EVENTS_QUEUED, 1)
22-
rescue StandardError => error
23-
@config.log_found_exception(__method__.to_s, error)
22+
rescue StandardError => e
23+
@config.log_found_exception(__method__.to_s, e)
2424
@telemetry_runtime_producer.record_events_stats(Telemetry::Domain::Constants::EVENTS_DROPPED, 1)
2525
end
2626

lib/splitclient-rb/cache/repositories/events_repository.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def initialize(config, api_key, telemetry_runtime_producer)
2121

2222
def post_events
2323
events_api.post(self.clear)
24-
rescue StandardError => error
25-
@config.log_found_exception(__method__.to_s, error)
24+
rescue StandardError => e
25+
@config.log_found_exception(__method__.to_s, e)
2626
end
2727

2828
protected

lib/splitclient-rb/cache/repositories/segments_repository.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ def segment_keys_count
7878
end
7979

8080
keys
81-
rescue StandardError => error
82-
@config.log_found_exception(__method__.to_s, error)
81+
rescue StandardError => e
82+
@config.log_found_exception(__method__.to_s, e)
8383
0
8484
end
8585

lib/splitclient-rb/cache/routers/impression_router.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ def enqueue(impression)
4141
attributes: impression[:attributes]
4242
}
4343
@queue.push(imp) if @listener
44-
rescue StandardError => error
45-
@config.log_found_exception(__method__.to_s, error)
44+
rescue StandardError => e
45+
@config.log_found_exception(__method__.to_s, e)
4646
end
4747

4848
def router_thread
4949
@config.threads[:impression_router] = Thread.new do
5050
loop do
5151
begin
5252
@listener.log(@queue.pop)
53-
rescue StandardError => error
54-
@config.log_found_exception(__method__.to_s, error)
53+
rescue StandardError => e
54+
@config.log_found_exception(__method__.to_s, e)
5555
end
5656
end
5757
end

lib/splitclient-rb/cache/senders/impressions_adapter/memory_sender.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ def uniques_formatter(uniques)
4040
end
4141

4242
to_return
43-
rescue StandardError => error
44-
@config.log_found_exception(__method__.to_s, error)
43+
rescue StandardError => e
44+
@config.log_found_exception(__method__.to_s, e)
4545
nil
4646
end
4747

@@ -61,8 +61,8 @@ def impressions_count_formatter(counts)
6161
end
6262

6363
formated_counts
64-
rescue StandardError => error
65-
@config.log_found_exception(__method__.to_s, error)
64+
rescue StandardError => e
65+
@config.log_found_exception(__method__.to_s, e)
6666
nil
6767
end
6868
end

0 commit comments

Comments
 (0)