Skip to content

Commit 8996fdb

Browse files
authored
Move to actions (#127)
1 parent 651b502 commit 8996fdb

File tree

5 files changed

+34
-19
lines changed

5 files changed

+34
-19
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: build
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
ruby: ['2.5', '2.6', '2.7']
11+
name: Ruby ${{ matrix.ruby }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-ruby@v1
15+
with:
16+
ruby-version: ${{ matrix.ruby }}
17+
18+
- env:
19+
STREAM_API_KEY: ${{ secrets.STREAM_API_KEY }}
20+
STREAM_API_SECRET: ${{ secrets.STREAM_API_SECRET }}
21+
run: |
22+
gem install bundler
23+
bundle install --jobs 4 --retry 3
24+
bundle exec rake rubocop
25+
bundle exec rake test

.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

lib/stream/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def get_http_client
141141
end
142142

143143
def make_query_params(params)
144-
Hash[get_default_params.merge(params).sort_by { |k, _v| k.to_s }]
144+
get_default_params.merge(params).sort_by { |k, _v| k.to_s }.to_h
145145
end
146146

147147
def make_request(method, relative_url, signature, params = {}, data = {}, headers = {})

lib/stream/feed.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ def update_activities(activities)
9393
def update_activity_to_targets(foreign_id, time, new_targets: nil, added_targets: nil, removed_targets: nil)
9494
uri = "/feed_targets/#{@feed_url}/activity_to_targets/"
9595
data = {
96-
'foreign_id': foreign_id,
97-
'time': time
96+
foreign_id: foreign_id,
97+
time: time
9898
}
9999

100100
data['new_targets'] = new_targets unless new_targets.nil?

spec/integration_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,8 @@
651651
set: {
652652
"product.name": 'boots',
653653
"product.price": 7.99,
654-
"popularity": 1000,
655-
"foo": { "bar": { "baz": 'qux' } }
654+
popularity: 1000,
655+
foo: { bar: { baz: 'qux' } }
656656
},
657657
unset: [
658658
'product.color'
@@ -678,7 +678,7 @@
678678
time: activity_a['time'],
679679
set: {
680680
"foo.bar.baz": 42,
681-
"popularity": 9000
681+
popularity: 9000
682682
},
683683
unset: [
684684
'product.price'
@@ -703,15 +703,15 @@
703703
set: {
704704
"product.name": 'boots',
705705
"product.price": 13.99,
706-
"extra": 'left'
706+
extra: 'left'
707707
},
708708
unset: ['foo']
709709
},
710710
{
711711
id: activity_b['id'],
712712
set: {
713713
"product.price": 23.99,
714-
"extra": 'right'
714+
extra: 'right'
715715
},
716716
unset: ['popularity']
717717
}
@@ -912,7 +912,7 @@
912912
response['results'][0]['object'].should eq bear
913913
end
914914
example 'user enrichment' do
915-
user = @client.users.add(SecureRandom.uuid, data: { "name": 'john' })
915+
user = @client.users.add(SecureRandom.uuid, data: { name: 'john' })
916916
user.delete('duration')
917917

918918
@feed42.add_activity({ actor: @client.users.create_reference(user['id']), verb: 'chase', object: 'car:43' })

0 commit comments

Comments
 (0)