phraseapp-in-context-editor-ruby 3.0.1 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +12 -4
- data/CHANGELOG.md +14 -0
- data/Gemfile.lock +1 -1
- data/lib/generators/phraseapp_in_context_editor/templates/phraseapp_in_context_editor.rb +4 -0
- data/lib/phraseapp-in-context-editor-ruby/backend_service.rb +8 -3
- data/lib/phraseapp-in-context-editor-ruby/config.rb +2 -1
- data/lib/phraseapp-in-context-editor-ruby/version.rb +1 -1
- data/lib/phraseapp-in-context-editor-ruby.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d26e42fffd5138a7fecf9273413a584f2e0bac55f0c9ec280f2ff3f2c48701b
|
4
|
+
data.tar.gz: 675aa580225c7edf371c0b031a9b4dba485e36c72a71ebdbc991738548eb9ae3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45d475e3a53d156711097c0926df63c9bc89a0ad78ffb56b908e48d11b5db0cc70267ac629edd0d24c7a0835572411fce36ff08b9de021e2787a1c389a11ae7d
|
7
|
+
data.tar.gz: 546bd0fa0eca47a62078b7f20b0e2ed1215fad2c73dcb0367f01c25fe235e64a16c4301d0a48ff665f67ed93a293b5556e5aadeadbe1fc2911f2b419e0ee074a
|
@@ -3,9 +3,20 @@ on:
|
|
3
3
|
push:
|
4
4
|
branches:
|
5
5
|
- master
|
6
|
+
|
7
|
+
permissions:
|
8
|
+
contents: read
|
9
|
+
|
6
10
|
jobs:
|
7
11
|
release:
|
8
12
|
runs-on: ubuntu-latest
|
13
|
+
|
14
|
+
permissions:
|
15
|
+
contents: write
|
16
|
+
id-token: write
|
17
|
+
issues: write
|
18
|
+
pull-requests: write
|
19
|
+
|
9
20
|
steps:
|
10
21
|
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
|
11
22
|
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
|
@@ -13,14 +24,11 @@ jobs:
|
|
13
24
|
node-version: 20
|
14
25
|
- uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939
|
15
26
|
with:
|
16
|
-
ruby-version:
|
27
|
+
ruby-version: "3.2" # Not needed with a .ruby-version file
|
17
28
|
|
18
29
|
- name: Install dependencies
|
19
30
|
run: npm install && bundle install
|
20
31
|
|
21
|
-
- name: Build and validate gem
|
22
|
-
run: gem build
|
23
|
-
|
24
32
|
- name: Semantic Release
|
25
33
|
uses: cycjimmy/semantic-release-action@61680d0e9b02ff86f5648ade99e01be17f0260a4
|
26
34
|
env:
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
## [3.1.1](https://github.com/phrase/phraseapp-in-context-editor-ruby/compare/v3.1.0...v3.1.1) (2024-06-14)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* Adjust workflow permissions so it can bump version ([#85](https://github.com/phrase/phraseapp-in-context-editor-ruby/issues/85)) ([42e00ed](https://github.com/phrase/phraseapp-in-context-editor-ruby/commit/42e00ed821fb594415a1b12d3c3e3ac2c24f951f))
|
7
|
+
|
8
|
+
# [3.1.0](https://github.com/phrase/phraseapp-in-context-editor-ruby/compare/v3.0.1...v3.1.0) (2024-06-14)
|
9
|
+
|
10
|
+
|
11
|
+
### Features
|
12
|
+
|
13
|
+
* Add config option to ignore keys ([#82](https://github.com/phrase/phraseapp-in-context-editor-ruby/issues/82)) ([657b9f3](https://github.com/phrase/phraseapp-in-context-editor-ruby/commit/657b9f3ebce1ca2a364af1b9b84b0b28ee733983))
|
14
|
+
|
1
15
|
## [3.0.1](https://github.com/phrase/phraseapp-in-context-editor-ruby/compare/v3.0.0...v3.0.1) (2024-06-14)
|
2
16
|
|
3
17
|
|
data/Gemfile.lock
CHANGED
@@ -9,6 +9,10 @@ PhraseApp::InContextEditor.configure do |config|
|
|
9
9
|
config.account_id = "<%= options[:account_id] %>"
|
10
10
|
config.datacenter = "eu"
|
11
11
|
|
12
|
+
# Configure an array of key names that should not be handled
|
13
|
+
# by the In-Context-Editor.
|
14
|
+
# config.ignored_keys = ["number.*", "foo.bar"]
|
15
|
+
|
12
16
|
# Phrase uses decorators to generate a unique identification key
|
13
17
|
# in context of your document. However, this might result in conflicts
|
14
18
|
# with other libraries (e.g. client-side template engines) that use a similar syntax.
|
@@ -3,8 +3,6 @@ require_relative "delegate/i18n_delegate"
|
|
3
3
|
module PhraseApp
|
4
4
|
module InContextEditor
|
5
5
|
class BackendService
|
6
|
-
attr_accessor :blacklisted_keys
|
7
|
-
|
8
6
|
def initialize(args = {})
|
9
7
|
self
|
10
8
|
end
|
@@ -20,7 +18,14 @@ module PhraseApp
|
|
20
18
|
protected
|
21
19
|
|
22
20
|
def to_be_translated_without_phraseapp?(...)
|
23
|
-
PhraseApp::InContextEditor.disabled? || has_been_forced_to_resolve_with_phraseapp?(...)
|
21
|
+
PhraseApp::InContextEditor.disabled? || ignored_key?(...) || has_been_forced_to_resolve_with_phraseapp?(...)
|
22
|
+
end
|
23
|
+
|
24
|
+
def ignored_key?(*args)
|
25
|
+
key = given_key_from_args(args)
|
26
|
+
PhraseApp::InContextEditor.ignored_keys.any? do |ignored_key|
|
27
|
+
key.to_s[/\A#{ignored_key.gsub("*", ".*")}\Z/]
|
28
|
+
end
|
24
29
|
end
|
25
30
|
|
26
31
|
def has_been_forced_to_resolve_with_phraseapp?(*args)
|
@@ -9,7 +9,8 @@ module PhraseApp
|
|
9
9
|
backend: PhraseApp::InContextEditor::BackendService.new,
|
10
10
|
prefix: "{{__",
|
11
11
|
suffix: "__}}",
|
12
|
-
origin: "in-context-editor-ruby"
|
12
|
+
origin: "in-context-editor-ruby",
|
13
|
+
ignored_keys: []
|
13
14
|
}.freeze
|
14
15
|
|
15
16
|
CONFIG_OPTIONS.each do |option, default_value|
|