lhs 25.0.4 → 25.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rubocop.yml +27 -0
- data/.github/workflows/test-active-support-5.yml +27 -0
- data/.github/workflows/test.yml +27 -0
- data/.ruby-version +1 -1
- data/README.md +36 -0
- data/lib/lhs.rb +2 -0
- data/lib/lhs/concerns/record/pagination.rb +2 -0
- data/lib/lhs/pagination/total_pages.rb +9 -0
- data/lib/lhs/version.rb +1 -1
- data/spec/pagination/total_pages_spec.rb +52 -0
- metadata +12 -19
- data/Gemfile.activesupport4 +0 -5
- data/cider-ci.yml +0 -6
- data/cider-ci/bin/bundle +0 -51
- data/cider-ci/bin/ruby_install +0 -8
- data/cider-ci/bin/ruby_version +0 -25
- data/cider-ci/jobs/rspec-activesupport-4.yml +0 -27
- data/cider-ci/jobs/rspec-activesupport-5.yml +0 -26
- data/cider-ci/jobs/rspec-activesupport-latest.yml +0 -24
- data/cider-ci/jobs/rubocop.yml +0 -18
- data/cider-ci/task_components/bundle.yml +0 -22
- data/cider-ci/task_components/rspec.yml +0 -37
- data/cider-ci/task_components/rubocop.yml +0 -29
- data/cider-ci/task_components/ruby.yml +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92e9ccdfc62407ecb0d4ba6b6ce18b28628ecaad229586f589eb7167fe8ff0de
|
4
|
+
data.tar.gz: 26924759db03d133fbfc8dee9be190e8238fa0fc3036f7b79b13636e881f785e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4186ce186f51e95872532c943c93a402b1d23160d35b123f2fa4c01a1e589ffc863b5f6345c8071c606545539e91e789d75bed7efefcef0546677fe852a56d3d
|
7
|
+
data.tar.gz: b31b7ab8443d71a735397127f389d8dda1f9add35fa318e92ba0172f65172d21928181120a56c953227d0051778646745c8c510c04967e17ba0c24ddd60723ea
|
@@ -0,0 +1,27 @@
|
|
1
|
+
name: Rubocop
|
2
|
+
|
3
|
+
on: push
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
rubocop:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
|
9
|
+
steps:
|
10
|
+
- uses: actions/checkout@v2
|
11
|
+
- uses: actions/setup-ruby@v1
|
12
|
+
with:
|
13
|
+
ruby-version: 2.7.2
|
14
|
+
- name: Cache Ruby Gems
|
15
|
+
uses: actions/cache@v2
|
16
|
+
with:
|
17
|
+
path: /.tmp/vendor/bundle
|
18
|
+
key: ${{ runner.os }}-gems-latest-${{ hashFiles('**/Gemfile.lock') }}
|
19
|
+
restore-keys: |
|
20
|
+
${{ runner.os }}-gems-latest-
|
21
|
+
- name: Bundle Install
|
22
|
+
run: |
|
23
|
+
bundle config path /.tmp/vendor/bundle
|
24
|
+
bundle install --jobs 4 --retry 3
|
25
|
+
- name: Run Rubocop
|
26
|
+
run: |
|
27
|
+
bundle exec rubocop
|
@@ -0,0 +1,27 @@
|
|
1
|
+
name: Test ActiveSupport v5
|
2
|
+
|
3
|
+
on: push
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
rspec:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
|
9
|
+
steps:
|
10
|
+
- uses: actions/checkout@v2
|
11
|
+
- uses: actions/setup-ruby@v1
|
12
|
+
with:
|
13
|
+
ruby-version: 2.7.2
|
14
|
+
- name: Cache Ruby Gems
|
15
|
+
uses: actions/cache@v2
|
16
|
+
with:
|
17
|
+
path: /.tmp/vendor/bundle
|
18
|
+
key: ${{ runner.os }}-gems-v5-${{ hashFiles('**/Gemfile.lock') }}
|
19
|
+
restore-keys: |
|
20
|
+
${{ runner.os }}-gems-v5-
|
21
|
+
- name: Bundle Install ActiveSupport v5
|
22
|
+
run: |
|
23
|
+
bundle config path /.tmp/vendor/bundle
|
24
|
+
BUNDLE_GEMFILE=Gemfile.activesupport5 bundle install --jobs 4 --retry 3
|
25
|
+
- name: Run Tests
|
26
|
+
run: |
|
27
|
+
BUNDLE_GEMFILE=Gemfile.activesupport5 bundle exec rspec
|
@@ -0,0 +1,27 @@
|
|
1
|
+
name: Test
|
2
|
+
|
3
|
+
on: push
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
rspec:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
|
9
|
+
steps:
|
10
|
+
- uses: actions/checkout@v2
|
11
|
+
- uses: actions/setup-ruby@v1
|
12
|
+
with:
|
13
|
+
ruby-version: 2.7.2
|
14
|
+
- name: Cache Ruby Gems
|
15
|
+
uses: actions/cache@v2
|
16
|
+
with:
|
17
|
+
path: /.tmp/vendor/bundle
|
18
|
+
key: ${{ runner.os }}-gems-latest-${{ hashFiles('**/Gemfile.lock') }}
|
19
|
+
restore-keys: |
|
20
|
+
${{ runner.os }}-gems-latest-
|
21
|
+
- name: Bundle Install
|
22
|
+
run: |
|
23
|
+
bundle config path /.tmp/vendor/bundle
|
24
|
+
bundle install --jobs 4 --retry 3
|
25
|
+
- name: Run Tests
|
26
|
+
run: |
|
27
|
+
bundle exec rspec
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.7.2
|
data/README.md
CHANGED
@@ -80,6 +80,7 @@ record.review # "Lunch was great
|
|
80
80
|
* [Pagination strategy](#pagination-strategy)
|
81
81
|
* [Pagination strategy: offset (default)](#pagination-strategy-offset-default)
|
82
82
|
* [Pagination strategy: page](#pagination-strategy-page)
|
83
|
+
* [Pagination strategy: total_pages](#pagination-strategy-total-pages)
|
83
84
|
* [Pagination strategy: start](#pagination-strategy-start)
|
84
85
|
* [Pagination strategy: link](#pagination-strategy-link)
|
85
86
|
* [Pagination keys](#pagination-keys)
|
@@ -1253,6 +1254,41 @@ In parallel:
|
|
1253
1254
|
GET https://service.example.com/records?limit=100&page=3
|
1254
1255
|
```
|
1255
1256
|
|
1257
|
+
##### Pagination strategy: total_pages
|
1258
|
+
|
1259
|
+
The `total_pages` strategy is based on the `page` strategy with the only difference
|
1260
|
+
that the responding api provides `total_pages` over `total_items`.
|
1261
|
+
|
1262
|
+
```ruby
|
1263
|
+
# app/models/transaction.rb
|
1264
|
+
|
1265
|
+
class Transaction < LHS::Record
|
1266
|
+
configuration pagination_strategy: 'total_pages', pagination_key: 'page', total_key: 'total_pages'
|
1267
|
+
|
1268
|
+
endpoint '{+service}/transactions'
|
1269
|
+
end
|
1270
|
+
```
|
1271
|
+
|
1272
|
+
```ruby
|
1273
|
+
# app/controllers/some_controller.rb
|
1274
|
+
|
1275
|
+
Record.all
|
1276
|
+
|
1277
|
+
```
|
1278
|
+
```
|
1279
|
+
GET https://service.example.com/transactions?limit=100
|
1280
|
+
{
|
1281
|
+
items: [{...}, ...],
|
1282
|
+
total_pages: 3,
|
1283
|
+
limit: 100,
|
1284
|
+
page: 1
|
1285
|
+
}
|
1286
|
+
In parallel:
|
1287
|
+
GET https://service.example.com/records?limit=100&page=2
|
1288
|
+
GET https://service.example.com/records?limit=100&page=3
|
1289
|
+
```
|
1290
|
+
|
1291
|
+
|
1256
1292
|
##### Pagination strategy: start
|
1257
1293
|
|
1258
1294
|
In comparison to the `offset` strategy, the `start` strategy indicates with which item the current page starts.
|
data/lib/lhs.rb
CHANGED
data/lib/lhs/version.rb
CHANGED
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails_helper'
|
4
|
+
|
5
|
+
describe LHS::Record do
|
6
|
+
context 'pagination' do
|
7
|
+
|
8
|
+
let(:page_1_json) do
|
9
|
+
{
|
10
|
+
items: [1, 2],
|
11
|
+
total_pages: 3,
|
12
|
+
page: 1,
|
13
|
+
limit: 2
|
14
|
+
}.to_json
|
15
|
+
end
|
16
|
+
|
17
|
+
let(:page_2_json) do
|
18
|
+
{
|
19
|
+
items: [3, 4],
|
20
|
+
total_pages: 3,
|
21
|
+
page: 2,
|
22
|
+
limit: 2
|
23
|
+
}.to_json
|
24
|
+
end
|
25
|
+
|
26
|
+
let(:page_3_json) do
|
27
|
+
{
|
28
|
+
items: [5, 6],
|
29
|
+
total_pages: 3,
|
30
|
+
page: 3,
|
31
|
+
limit: 2
|
32
|
+
}.to_json
|
33
|
+
end
|
34
|
+
|
35
|
+
before do
|
36
|
+
class Feedback < LHS::Record
|
37
|
+
configuration pagination_strategy: :total_pages, total_key: :total_pages, pagination_key: :page
|
38
|
+
endpoint 'http://local.ch/v2/feedbacks'
|
39
|
+
end
|
40
|
+
stub_request(:get, 'http://local.ch/v2/feedbacks?limit=100').to_return(body: page_1_json)
|
41
|
+
stub_request(:get, 'http://local.ch/v2/feedbacks?limit=2&page=2').to_return(body: page_2_json)
|
42
|
+
stub_request(:get, 'http://local.ch/v2/feedbacks?limit=2&page=3').to_return(body: page_3_json)
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'responds to limit_value' do
|
46
|
+
feedbacks = Feedback.all.fetch
|
47
|
+
expect(feedbacks.length).to eq 6
|
48
|
+
expect(feedbacks.count).to eq 6
|
49
|
+
expect(feedbacks.items.as_json).to eq [1, 2, 3, 4, 5, 6]
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lhs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 25.0
|
4
|
+
version: 25.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- https://github.com/local-ch/lhs/graphs/contributors
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -241,28 +241,18 @@ extensions: []
|
|
241
241
|
extra_rdoc_files: []
|
242
242
|
files:
|
243
243
|
- ".bundler-version"
|
244
|
+
- ".github/workflows/rubocop.yml"
|
245
|
+
- ".github/workflows/test-active-support-5.yml"
|
246
|
+
- ".github/workflows/test.yml"
|
244
247
|
- ".gitignore"
|
245
248
|
- ".rubocop.localch.yml"
|
246
249
|
- ".rubocop.yml"
|
247
250
|
- ".ruby-version"
|
248
251
|
- Gemfile
|
249
|
-
- Gemfile.activesupport4
|
250
252
|
- Gemfile.activesupport5
|
251
253
|
- LICENSE
|
252
254
|
- README.md
|
253
255
|
- Rakefile
|
254
|
-
- cider-ci.yml
|
255
|
-
- cider-ci/bin/bundle
|
256
|
-
- cider-ci/bin/ruby_install
|
257
|
-
- cider-ci/bin/ruby_version
|
258
|
-
- cider-ci/jobs/rspec-activesupport-4.yml
|
259
|
-
- cider-ci/jobs/rspec-activesupport-5.yml
|
260
|
-
- cider-ci/jobs/rspec-activesupport-latest.yml
|
261
|
-
- cider-ci/jobs/rubocop.yml
|
262
|
-
- cider-ci/task_components/bundle.yml
|
263
|
-
- cider-ci/task_components/rspec.yml
|
264
|
-
- cider-ci/task_components/rubocop.yml
|
265
|
-
- cider-ci/task_components/ruby.yml
|
266
256
|
- docs/accessing-data-in-lhs.png
|
267
257
|
- friday.yml
|
268
258
|
- lhs.gemspec
|
@@ -331,6 +321,7 @@ files:
|
|
331
321
|
- lib/lhs/pagination/offset.rb
|
332
322
|
- lib/lhs/pagination/page.rb
|
333
323
|
- lib/lhs/pagination/start.rb
|
324
|
+
- lib/lhs/pagination/total_pages.rb
|
334
325
|
- lib/lhs/problems/base.rb
|
335
326
|
- lib/lhs/problems/errors.rb
|
336
327
|
- lib/lhs/problems/nested/base.rb
|
@@ -466,6 +457,7 @@ files:
|
|
466
457
|
- spec/pagination/link/total_spec.rb
|
467
458
|
- spec/pagination/offset/pages_left_spec.rb
|
468
459
|
- spec/pagination/parameters_spec.rb
|
460
|
+
- spec/pagination/total_pages_spec.rb
|
469
461
|
- spec/proxy/create_sub_resource_spec.rb
|
470
462
|
- spec/proxy/load_spec.rb
|
471
463
|
- spec/proxy/record_identification_spec.rb
|
@@ -557,7 +549,7 @@ homepage: https://github.com/local-ch/lhs
|
|
557
549
|
licenses:
|
558
550
|
- GPL-3.0
|
559
551
|
metadata: {}
|
560
|
-
post_install_message:
|
552
|
+
post_install_message:
|
561
553
|
rdoc_options: []
|
562
554
|
require_paths:
|
563
555
|
- lib
|
@@ -573,8 +565,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
573
565
|
version: '0'
|
574
566
|
requirements:
|
575
567
|
- Ruby >= 2.3.0
|
576
|
-
rubygems_version: 3.
|
577
|
-
signing_key:
|
568
|
+
rubygems_version: 3.1.4
|
569
|
+
signing_key:
|
578
570
|
specification_version: 4
|
579
571
|
summary: 'REST services accelerator: Rails gem providing an easy, active-record-like
|
580
572
|
interface for http (hypermedia) json services'
|
@@ -699,6 +691,7 @@ test_files:
|
|
699
691
|
- spec/pagination/link/total_spec.rb
|
700
692
|
- spec/pagination/offset/pages_left_spec.rb
|
701
693
|
- spec/pagination/parameters_spec.rb
|
694
|
+
- spec/pagination/total_pages_spec.rb
|
702
695
|
- spec/proxy/create_sub_resource_spec.rb
|
703
696
|
- spec/proxy/load_spec.rb
|
704
697
|
- spec/proxy/record_identification_spec.rb
|
data/Gemfile.activesupport4
DELETED
data/cider-ci.yml
DELETED
data/cider-ci/bin/bundle
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
set -eux
|
3
|
-
|
4
|
-
export PATH=~/.rubies/$RUBY/bin:$PATH
|
5
|
-
rm -f .bundle/config
|
6
|
-
|
7
|
-
if [ ! -f ~/.rubies/$RUBY/bin/bundle ]; then
|
8
|
-
gem install bundler
|
9
|
-
fi
|
10
|
-
|
11
|
-
# install bundler v. 1.17.3 in order to be able to run the tests with
|
12
|
-
# ACTIVESUPPORT=4 because rails (= 4.2.0) depends on bundler (< 2.0, >= 1.3.0)
|
13
|
-
gem install bundler:1.17.3
|
14
|
-
|
15
|
-
sed "s/^source 'https:\/\/rubygems\.intra\.local\.ch'*/source 'http\:\/\/52.29.7.59:9292'/g" Gemfile > Gemfile.tmp
|
16
|
-
mv Gemfile.tmp Gemfile
|
17
|
-
|
18
|
-
DIGEST=$(git ls-tree HEAD --\
|
19
|
-
cider-ci.yml cider-ci Gemfile.lock \
|
20
|
-
| openssl dgst -sha1 | cut -d ' ' -f 2)
|
21
|
-
|
22
|
-
if [ ! -z ${ACTIVESUPPORT:-} ]; then
|
23
|
-
DIGEST=$(echo "$DIGEST $ACTIVESUPPORT")
|
24
|
-
fi
|
25
|
-
|
26
|
-
DIGEST=$(echo "$DIGEST $PATH" \
|
27
|
-
| openssl dgst -sha1 | cut -d ' ' -f 2)
|
28
|
-
|
29
|
-
echo "DIGEST"
|
30
|
-
echo "${DIGEST}"
|
31
|
-
|
32
|
-
CACHE_SIGNATURE_FILE="/tmp/bundle_cache_signature_${DIGEST}"
|
33
|
-
|
34
|
-
if [ ! -f $CACHE_SIGNATURE_FILE ] ; then
|
35
|
-
if [ ! -z ${ACTIVESUPPORT:-} ]; then
|
36
|
-
if [ ! -z ${BUNDLER:-} ]; then
|
37
|
-
echo "BUNDLE_GEMFILE=Gemfile.activesupport$ACTIVESUPPORT bundle $BUNDLER install"
|
38
|
-
BUNDLE_GEMFILE=Gemfile.activesupport$ACTIVESUPPORT bundle $BUNDLER install
|
39
|
-
else
|
40
|
-
echo "BUNDLE_GEMFILE=Gemfile.activesupport$ACTIVESUPPORT bundle install"
|
41
|
-
BUNDLE_GEMFILE=Gemfile.activesupport$ACTIVESUPPORT bundle install
|
42
|
-
fi
|
43
|
-
else
|
44
|
-
echo "bundle install"
|
45
|
-
bundle $BUNDLER install
|
46
|
-
fi
|
47
|
-
touch $CACHE_SIGNATURE_FILE
|
48
|
-
fi
|
49
|
-
|
50
|
-
echo "bundle install"
|
51
|
-
bundle $BUNDLER install
|
data/cider-ci/bin/ruby_install
DELETED
data/cider-ci/bin/ruby_version
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
set -eux
|
3
|
-
|
4
|
-
if [ -f ./.ruby-version ]; then
|
5
|
-
echo ".ruby-version file found"
|
6
|
-
fi
|
7
|
-
|
8
|
-
if [ ! -f ./.ruby-version ]; then
|
9
|
-
echo ".ruby-version file not found"
|
10
|
-
exit 1
|
11
|
-
fi
|
12
|
-
|
13
|
-
IFS='-' read -ra EXPLODED_RUBY <<< "$RUBY"
|
14
|
-
|
15
|
-
if [ "${#EXPLODED_RUBY[@]}" == "1" ]; then
|
16
|
-
echo 'No engine/version separator "-" found in .ruby-version file.'
|
17
|
-
exit 1
|
18
|
-
fi
|
19
|
-
|
20
|
-
if [ "${#EXPLODED_RUBY[@]}" != "1" ] && [ "${#EXPLODED_RUBY[@]}" != "2" ]; then
|
21
|
-
echo "Unknown format of .ruby-version file"
|
22
|
-
exit 1
|
23
|
-
fi
|
24
|
-
|
25
|
-
echo $RUBY
|
@@ -1,27 +0,0 @@
|
|
1
|
-
rspec-active-support-v4:
|
2
|
-
name: 'rspec with ActiveSupport v4'
|
3
|
-
|
4
|
-
run_when:
|
5
|
-
'some HEAD has been updated':
|
6
|
-
type: branch
|
7
|
-
include_match: ^.*$
|
8
|
-
|
9
|
-
context:
|
10
|
-
|
11
|
-
script_defaults:
|
12
|
-
template_environment_variables: true
|
13
|
-
|
14
|
-
task_defaults:
|
15
|
-
environment_variables:
|
16
|
-
ACTIVESUPPORT: '4'
|
17
|
-
BUNDLER: '_1.17.3_'
|
18
|
-
max_trials: 2
|
19
|
-
dispatch_storm_delay_duration: 1 Seconds
|
20
|
-
include:
|
21
|
-
- cider-ci/task_components/ruby.yml
|
22
|
-
- cider-ci/task_components/bundle.yml
|
23
|
-
- cider-ci/task_components/rspec.yml
|
24
|
-
|
25
|
-
tasks:
|
26
|
-
all-rspec:
|
27
|
-
name: All rspec tests, using ActiveSupport v4
|
@@ -1,26 +0,0 @@
|
|
1
|
-
rspec-active-support-v5:
|
2
|
-
name: 'rspec with ActiveSupport v5'
|
3
|
-
|
4
|
-
run_when:
|
5
|
-
'some HEAD has been updated':
|
6
|
-
type: branch
|
7
|
-
include_match: ^.*$
|
8
|
-
|
9
|
-
context:
|
10
|
-
|
11
|
-
script_defaults:
|
12
|
-
template_environment_variables: true
|
13
|
-
|
14
|
-
task_defaults:
|
15
|
-
environment_variables:
|
16
|
-
ACTIVESUPPORT: '5'
|
17
|
-
max_trials: 2
|
18
|
-
dispatch_storm_delay_duration: 1 Seconds
|
19
|
-
include:
|
20
|
-
- cider-ci/task_components/ruby.yml
|
21
|
-
- cider-ci/task_components/bundle.yml
|
22
|
-
- cider-ci/task_components/rspec.yml
|
23
|
-
|
24
|
-
tasks:
|
25
|
-
all-rspec:
|
26
|
-
name: All rspec tests, using ActiveSupport v5
|
@@ -1,24 +0,0 @@
|
|
1
|
-
rspec-active-support-latest:
|
2
|
-
name: 'rspec with ActiveSupport latest'
|
3
|
-
|
4
|
-
run_when:
|
5
|
-
'some HEAD has been updated':
|
6
|
-
type: branch
|
7
|
-
include_match: ^.*$
|
8
|
-
|
9
|
-
context:
|
10
|
-
|
11
|
-
script_defaults:
|
12
|
-
template_environment_variables: true
|
13
|
-
|
14
|
-
task_defaults:
|
15
|
-
max_trials: 2
|
16
|
-
dispatch_storm_delay_duration: 1 Seconds
|
17
|
-
include:
|
18
|
-
- cider-ci/task_components/ruby.yml
|
19
|
-
- cider-ci/task_components/bundle.yml
|
20
|
-
- cider-ci/task_components/rspec.yml
|
21
|
-
|
22
|
-
tasks:
|
23
|
-
all-rspec:
|
24
|
-
name: All rspec tests, using ActiveSupport latest
|
data/cider-ci/jobs/rubocop.yml
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
rubocop:
|
2
|
-
name: 'Rubocop'
|
3
|
-
|
4
|
-
run_when:
|
5
|
-
'some HEAD has been updated':
|
6
|
-
type: branch
|
7
|
-
include_match: ^.*$
|
8
|
-
|
9
|
-
context:
|
10
|
-
|
11
|
-
tasks:
|
12
|
-
|
13
|
-
rubocop:
|
14
|
-
|
15
|
-
include:
|
16
|
-
- cider-ci/task_components/ruby.yml
|
17
|
-
- cider-ci/task_components/bundle.yml
|
18
|
-
- cider-ci/task_components/rubocop.yml
|
@@ -1,22 +0,0 @@
|
|
1
|
-
traits:
|
2
|
-
ruby-install: true
|
3
|
-
Bash: true
|
4
|
-
|
5
|
-
trial_attachments:
|
6
|
-
gemfile:
|
7
|
-
include_match: Gemfile
|
8
|
-
content_type: text/plain
|
9
|
-
|
10
|
-
environment_variables:
|
11
|
-
BUNDLER:
|
12
|
-
read_and_replace_with: .bundler-version
|
13
|
-
|
14
|
-
scripts:
|
15
|
-
|
16
|
-
bundle:
|
17
|
-
exclusive_executor_resource: ruby-install_{{$RUBY}}
|
18
|
-
timeout: 20 Minutes
|
19
|
-
body: cider-ci/bin/bundle
|
20
|
-
start_when:
|
21
|
-
'ruby installed':
|
22
|
-
script_key: ruby-install
|
@@ -1,37 +0,0 @@
|
|
1
|
-
ports:
|
2
|
-
CAPYBARA_PORT:
|
3
|
-
min: 8000
|
4
|
-
max: 8999
|
5
|
-
PHANTOMJS_PORT:
|
6
|
-
min: 44600
|
7
|
-
max: 44999
|
8
|
-
|
9
|
-
environment_variables:
|
10
|
-
RUBY:
|
11
|
-
read_and_replace_with: .ruby-version
|
12
|
-
BUNDLER:
|
13
|
-
read_and_replace_with: .bundler-version
|
14
|
-
|
15
|
-
scripts:
|
16
|
-
rspec:
|
17
|
-
body: |
|
18
|
-
#!/usr/bin/env bash
|
19
|
-
set -eux
|
20
|
-
mkdir -p tmp/cache
|
21
|
-
export PATH=~/.rubies/$RUBY/bin:$PATH
|
22
|
-
if [ ! -z ${ACTIVESUPPORT:-} ]; then BUNDLE_GEMFILE=Gemfile.activesupport$ACTIVESUPPORT bundle $BUNDLER exec rspec; else bundle exec rspec; fi
|
23
|
-
|
24
|
-
start_when:
|
25
|
-
'bundled':
|
26
|
-
script_key: bundle
|
27
|
-
|
28
|
-
trial_attachments:
|
29
|
-
logs:
|
30
|
-
include_match: log\/.*\.log$
|
31
|
-
content_type: text/plain
|
32
|
-
image-screenshots:
|
33
|
-
include_match: tmp\/capybara\/.*\.png$
|
34
|
-
content_type: image/png
|
35
|
-
html-screenshots:
|
36
|
-
include_match: tmp\/capybara\/.*\.html$
|
37
|
-
content_type: text/html
|
@@ -1,29 +0,0 @@
|
|
1
|
-
trial_attachments:
|
2
|
-
logs:
|
3
|
-
include_match: tmp\/checkstyle.json$
|
4
|
-
content_type: application/json
|
5
|
-
|
6
|
-
tree_attachments:
|
7
|
-
logs:
|
8
|
-
include_match: tmp\/checkstyle.json$
|
9
|
-
content_type: application/json
|
10
|
-
|
11
|
-
environment_variables:
|
12
|
-
RUBY:
|
13
|
-
read_and_replace_with: .ruby-version
|
14
|
-
RESULT_PATH: 'tmp/checkstyle.json'
|
15
|
-
|
16
|
-
max_trials: 1
|
17
|
-
|
18
|
-
scripts:
|
19
|
-
rubocop:
|
20
|
-
start_when:
|
21
|
-
'bundled':
|
22
|
-
script_key: bundle
|
23
|
-
body: |
|
24
|
-
#!/usr/bin/env bash
|
25
|
-
set -eux
|
26
|
-
mkdir -p tmp/cache
|
27
|
-
export PATH=~/.rubies/$RUBY/bin:$PATH
|
28
|
-
bundle exec rubocop --config .rubocop.yml \
|
29
|
-
--format json --out $RESULT_PATH --format progress
|
@@ -1,15 +0,0 @@
|
|
1
|
-
environment_variables:
|
2
|
-
RUBY:
|
3
|
-
read_and_replace_with: .ruby-version
|
4
|
-
|
5
|
-
scripts:
|
6
|
-
ruby-version:
|
7
|
-
body: cider-ci/bin/ruby_version
|
8
|
-
ruby-install:
|
9
|
-
exclusive_executor_resource: ruby-install_{{$RUBY}}
|
10
|
-
timeout: 20 Minutes
|
11
|
-
body: cider-ci/bin/ruby_install
|
12
|
-
start_when:
|
13
|
-
'ruby version checked':
|
14
|
-
script_key: ruby-version
|
15
|
-
|