openstax_kitchen 6.1.0 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +1 -1
- data/docker/rubocop +6 -4
- data/lib/kitchen/directions/move_solutions_to_answer_key/strategies/default.rb +3 -3
- data/lib/kitchen/patches/array.rb +15 -0
- data/lib/kitchen/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43191e77a90ff1979ef567be7b5ab17d0eeac503ead1294d8d329e18d6740c75
|
4
|
+
data.tar.gz: ae55a2aa093d942166c41502c2019b327ccaf4eab1fd383773acd94827122524
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bcc9edf90d94f61582668e6bae0c39a42dd6d4535f944d7566eb4d17cd85ed1e5712b9e51b6ed5cf71d5928d90b211c26ac6134a356246a41ea379c4a3af73b
|
7
|
+
data.tar.gz: ea31d5248fec4947d06d53f2555c71ff36274c9a174976b6751dd9894a41eb949601e77c2116227374573cbdf823e9c7fc94142ce9d3341d9159d8d7d03074a2
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
|
10
|
+
## [7.0.0] - 2021-06-21
|
11
|
+
|
12
|
+
* Changed selector expected by `default strategy` in `move_solutions_to_answer_key` to optimize search (major)
|
13
|
+
* Fix Rubocop GitHub Action's regular expression used to select files to lint (patch)
|
14
|
+
* Added monkey patch for array to be able to add a prefix: `%w[multiple-choice true-false].prefix('section.')` (minor)
|
15
|
+
|
9
16
|
## [6.1.0] - 2021-06-21
|
10
17
|
|
11
18
|
* Create a `BakeReferences` V2 for unnumbered section references (minor)
|
data/Gemfile.lock
CHANGED
data/docker/rubocop
CHANGED
@@ -4,13 +4,15 @@
|
|
4
4
|
|
5
5
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
commit_range="${1:-main}"
|
8
|
+
if [ ! -z "$2" ]; then
|
9
|
+
commit_range="$commit_range..$2"
|
10
|
+
fi
|
9
11
|
|
10
|
-
echo "Checking
|
12
|
+
echo "Checking $commit_range"
|
11
13
|
|
12
14
|
# https://dev.to/scienta/get-changed-files-in-github-actions-1p36
|
13
|
-
changed_ruby_files=$(git diff --name-only --diff-filter=ACMRT $
|
15
|
+
changed_ruby_files=$(git diff --name-only --diff-filter=ACMRT $commit_range | grep -E "(lib\/|spec\/).*\.rb$" | xargs)
|
14
16
|
|
15
17
|
if [[ -z "${changed_ruby_files// }" ]]; then
|
16
18
|
echo "No files to lint with Rubocop"
|
@@ -10,8 +10,8 @@ module Kitchen::Directions::MoveSolutionsToAnswerKey
|
|
10
10
|
protected
|
11
11
|
|
12
12
|
def bake_section(chapter:, append_to:)
|
13
|
-
@
|
14
|
-
chapter.search("
|
13
|
+
@selectors.each do |selector|
|
14
|
+
chapter.search("#{selector} div[data-type='solution']").each do |solution|
|
15
15
|
append_to.add_child(solution.cut.to_s)
|
16
16
|
end
|
17
17
|
end
|
@@ -20,7 +20,7 @@ module Kitchen::Directions::MoveSolutionsToAnswerKey
|
|
20
20
|
# This method helps to obtain more strategy-specific params through
|
21
21
|
# "strategy_options: {blah1: 1, blah2: 2}"
|
22
22
|
def initialize(strategy_options)
|
23
|
-
@
|
23
|
+
@selectors = strategy_options[:selectors] || (raise 'missing selectors for strategy')
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Monkey patches for +Array+
|
4
|
+
#
|
5
|
+
class Array
|
6
|
+
|
7
|
+
# Receives a string to add as prefix in each item and returns
|
8
|
+
# a new array with the concatenaded strings
|
9
|
+
#
|
10
|
+
# @return [Array<String>]
|
11
|
+
#
|
12
|
+
def prefix(string)
|
13
|
+
map { |item| "#{string}#{item}" }
|
14
|
+
end
|
15
|
+
end
|
data/lib/kitchen/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openstax_kitchen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 7.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Slavinsky
|
@@ -349,6 +349,7 @@ files:
|
|
349
349
|
- lib/kitchen/page_element.rb
|
350
350
|
- lib/kitchen/page_element_enumerator.rb
|
351
351
|
- lib/kitchen/pantry.rb
|
352
|
+
- lib/kitchen/patches/array.rb
|
352
353
|
- lib/kitchen/patches/i18n.rb
|
353
354
|
- lib/kitchen/patches/integer.rb
|
354
355
|
- lib/kitchen/patches/nokogiri.rb
|