ci-helper 0.2.6 → 0.3.0
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 +4 -4
- data/README.md +8 -1
- data/lib/ci_helper.rb +2 -0
- data/lib/ci_helper/commands.rb +1 -1
- data/lib/ci_helper/commands/check_coverage.rb +24 -0
- data/lib/ci_helper/tools/inflector.rb +2 -0
- data/lib/ci_helper/version.rb +1 -1
- data/lib/tasks/sequel_management.rake +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af54c4df4f96a962deb3ab2acbbbf2b189d1a14f945f1ad17501a196237babdc
|
4
|
+
data.tar.gz: 73211997e92fca4b8873e9e0e1c8dafc4f208cba7c41618500d136ec639c7e62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3efa5ce49a800e019fa1a5b86f3d6d46132b91fb5eeb343d52f72a2052b5beec94ce8001e3c54edf180a2c7a45588217a464085aa4b191064106204f29ccf317
|
7
|
+
data.tar.gz: 6a91623e8a061aab27caa74e6f74a7dbf24a095ff821b5984fbd62672976f69dbf8615cf7772334e212e6052ee699cb538198efac70b2f31a6f00984fb59d46f
|
data/README.md
CHANGED
@@ -47,7 +47,7 @@ List of available commands:
|
|
47
47
|
If you want to use `ActiveRecord::Migrator`, you'll have to write rake task by your own.
|
48
48
|
* **RubocopLint** — executes rubocop linter. Does not accept flags.
|
49
49
|
* **RunSpecs** — executes `rspec` in project root.
|
50
|
-
Accepted flags: `--node-index`, `node-total`, `with-database`, `split-resultset`.
|
50
|
+
Accepted flags: `--node-index`, `node-total`, `with-database`, `split-resultset`.
|
51
51
|
* `--node-index` — if you run specs in parallel in CI, then you might use this flag.
|
52
52
|
* `--node-total` — if you run specs in parallel in CI, then you might use this flag.
|
53
53
|
* `--with-database` — if you want to prepare database before executing specs,
|
@@ -62,6 +62,13 @@ Accepted flags: `--node-index`, `node-total`, `with-database`, `split-resultset`
|
|
62
62
|
delimited by coma.
|
63
63
|
* `--ignored-paths [values]` - accepts path patterns that should be ignored,
|
64
64
|
delimited by coma.
|
65
|
+
* **CheckCoverage** — checks coverage by executing `SimpleCov::collate`.
|
66
|
+
You should set `SimpleCov::minimum_coverage` in your `spec_helper.rb` file.
|
67
|
+
Accepted flags: `--split-resultset`.
|
68
|
+
* `--split-resultset` — if you execute command `RunSpecs` with `--split-resultset true`,
|
69
|
+
you also should set this flag to `true`. If this flag set to `true`, final coverage will be
|
70
|
+
calculated by merging results in all files, matching the mask `coverage/resultset.*.json`.
|
71
|
+
By default final coverage is calculated using result from `coverage/.resultset.json`.
|
65
72
|
|
66
73
|
### Rake Tasks
|
67
74
|
|
data/lib/ci_helper.rb
CHANGED
data/lib/ci_helper/commands.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CIHelper
|
4
|
+
module Commands
|
5
|
+
class CheckCoverage < BaseCommand
|
6
|
+
def call
|
7
|
+
SimpleCov.collate(files)
|
8
|
+
0
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def files
|
14
|
+
return path.glob("coverage/resultset.*.json") if split_resultset?
|
15
|
+
|
16
|
+
[path.join("coverage/.resultset.json")]
|
17
|
+
end
|
18
|
+
|
19
|
+
def split_resultset?
|
20
|
+
options[:split_resultset] == "true"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -5,9 +5,11 @@ module CIHelper
|
|
5
5
|
class Inflector < Delegator
|
6
6
|
include Singleton
|
7
7
|
|
8
|
+
# rubocop:disable Lint/MissingSuper
|
8
9
|
def initialize
|
9
10
|
@inflector = Dry::Inflector.new { |inflections| inflections.acronym "DB" }
|
10
11
|
end
|
12
|
+
# rubocop:enable Lint/MissingSuper
|
11
13
|
|
12
14
|
def __getobj__
|
13
15
|
@inflector
|
data/lib/ci_helper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ci-helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JustAnotherDude
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -190,6 +190,7 @@ files:
|
|
190
190
|
- lib/ci_helper/cli.rb
|
191
191
|
- lib/ci_helper/commands.rb
|
192
192
|
- lib/ci_helper/commands/bundler_audit.rb
|
193
|
+
- lib/ci_helper/commands/check_coverage.rb
|
193
194
|
- lib/ci_helper/commands/check_db_development.rb
|
194
195
|
- lib/ci_helper/commands/check_db_rollback.rb
|
195
196
|
- lib/ci_helper/commands/check_spec_suffixes.rb
|