phraseapp-in-context-editor-ruby 1.3.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +12 -0
  3. data/.gitignore +0 -1
  4. data/.package-licenses.yml +4 -0
  5. data/.tool-versions +1 -0
  6. data/CHANGELOG.md +52 -6
  7. data/CODEOWNERS +1 -0
  8. data/Gemfile +1 -1
  9. data/Gemfile.lock +241 -0
  10. data/Guardfile +13 -13
  11. data/README.md +81 -51
  12. data/RELEASING.md +10 -0
  13. data/config/license-decisions.yml +34 -0
  14. data/config/license_finder.yml +2 -0
  15. data/lib/generators/phraseapp_in_context_editor/install_generator.rb +3 -9
  16. data/lib/generators/phraseapp_in_context_editor/templates/phraseapp_in_context_editor.rb +9 -17
  17. data/lib/phraseapp-in-context-editor-ruby/adapters/fast_gettext.rb +20 -20
  18. data/lib/phraseapp-in-context-editor-ruby/adapters/i18n.rb +10 -10
  19. data/lib/phraseapp-in-context-editor-ruby/backend_service.rb +33 -100
  20. data/lib/phraseapp-in-context-editor-ruby/config.rb +13 -50
  21. data/lib/phraseapp-in-context-editor-ruby/delegate/fast_gettext.rb +13 -15
  22. data/lib/phraseapp-in-context-editor-ruby/delegate/i18n_delegate.rb +4 -50
  23. data/lib/phraseapp-in-context-editor-ruby/delegate.rb +13 -14
  24. data/lib/phraseapp-in-context-editor-ruby/engine.rb +5 -6
  25. data/lib/phraseapp-in-context-editor-ruby/view_helpers.rb +25 -19
  26. data/lib/phraseapp-in-context-editor-ruby.rb +15 -54
  27. data/phraseapp-in-context-editor-ruby.gemspec +18 -33
  28. metadata +32 -103
  29. data/.travis.yml +0 -8
  30. data/lib/generators/phraseapp_in_context_editor/templates/README +0 -10
  31. data/lib/phraseapp-in-context-editor-ruby/api_collection.rb +0 -41
  32. data/lib/phraseapp-in-context-editor-ruby/api_wrapper.rb +0 -59
  33. data/lib/phraseapp-in-context-editor-ruby/cache.rb +0 -37
  34. data/lib/phraseapp-in-context-editor-ruby/displayable_key_identifier.rb +0 -46
  35. data/lib/phraseapp-in-context-editor-ruby/fallback_keys_fetcher.rb +0 -44
  36. data/lib/phraseapp-in-context-editor-ruby/hash_flattener.rb +0 -53
  37. data/lib/phraseapp-in-context-editor-ruby/key_names_cache.rb +0 -53
  38. data/lib/phraseapp-in-context-editor-ruby/version.rb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 012cba38045e006a436af7029d5585c799c41405330c8d14fee655e50d542103
4
- data.tar.gz: 9dac63947d0e267041872fc9a6015d5bb1ee2f1d4e2ad54a8877249674eb9980
3
+ metadata.gz: 32b7a566334e03f1cbe18e29077141679ee3d3df137e5560ca0139fd45478671
4
+ data.tar.gz: 46c88c54d886a7f43a46bc818665aa20468c85f64ddd3f1798ecf8f4f2dbeb5a
5
5
  SHA512:
6
- metadata.gz: a1b68a1871469dc892fc98f82ab26d3ae71bcdb30158a22fd2a5aacd9a508072d51280c74977e731970a3c4a14eb55102b29a4c41a9ad3a3e63c8f64fdae1a0e
7
- data.tar.gz: 70d7cf9add109b87315f937d94628fad6e74fac4bb8892847bd3bbb0939b7bb87dfa02580d91073308eb20a25f257c494a3e82d2a81ed1fb010da5b60e066e5c
6
+ metadata.gz: 22afc92bedfa12c38fa5dbdaf1f7772ff1931d9492eaecd8683dca3b09cb9a0f983bdc118c57576d2e8ae3fb3542b278cbfe5eccfbad16c073df2f131e1bfbb2
7
+ data.tar.gz: '017598d5cc05bd514b6e052a1856ce928705c65f77b48c31c4fe5cc6ab9954c1b0d7edb4c69d2534be1736aad5816b6db82299b3a1728bdf4480d21bb38b663d'
@@ -0,0 +1,12 @@
1
+ name: Test
2
+ on: [ push ]
3
+ jobs:
4
+ test:
5
+ runs-on: ubuntu-latest
6
+ steps:
7
+ - uses: actions/checkout@v2
8
+ - uses: ruby/setup-ruby@319066216501fbd5e2d568f14b7d68c19fb67a5d
9
+ with:
10
+ ruby-version: '3.2'
11
+ - run: bundle install
12
+ - run: bundle exec rspec spec
data/.gitignore CHANGED
@@ -3,7 +3,6 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
- Gemfile.lock
7
6
  InstalledFiles
8
7
  _yardoc
9
8
  coverage
@@ -0,0 +1,4 @@
1
+ # Hardcoded list of gems / packages where auto detection of license fails
2
+ # possible root keys: ruby, elm, node, go, vendor
3
+ ruby:
4
+ "diff-lcs-1.3": ["MIT"] # Apache-2.0 OR GPL-2.0+ OR MIT => MIT
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 3.2.1
data/CHANGELOG.md CHANGED
@@ -1,14 +1,50 @@
1
- # Change Log
1
+ # Changelog
2
+
3
+ ## [v1.4.0](https://github.com/phrase/phraseapp-in-context-editor-ruby/tree/v1.4.0) (2021-02-16)
4
+
5
+ [Full Changelog](https://github.com/phrase/phraseapp-in-context-editor-ruby/compare/v1.3.1...v1.4.0)
6
+
7
+ **Closed issues:**
8
+
9
+ - phraseapp-ruby locked to ~\> 1.2.7, current is 1.3.3 [\#19](https://github.com/phrase/phraseapp-in-context-editor-ruby/issues/19)
10
+
11
+ **Merged pull requests:**
12
+
13
+ - Ruby 3.0 support [\#49](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/49) ([sbruhns](https://github.com/sbruhns))
14
+ - remove all dynport.de references [\#47](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/47) ([tobstarr](https://github.com/tobstarr))
15
+ - Update license decisions [\#46](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/46) ([forelabs](https://github.com/forelabs))
16
+ - Tests: Upgrade to modern RSpec syntax [\#45](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/45) ([docstun](https://github.com/docstun))
17
+ - GitHub actions [\#44](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/44) ([docstun](https://github.com/docstun))
18
+ - Licenses: fix project name [\#43](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/43) ([forelabs](https://github.com/forelabs))
19
+ - Licenses: Ignore dev&test dependencies [\#42](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/42) ([forelabs](https://github.com/forelabs))
20
+ - Introduce LicenseFinder config [\#41](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/41) ([forelabs](https://github.com/forelabs))
21
+ - fix pa licenses [\#40](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/40) ([forelabs](https://github.com/forelabs))
22
+ - Add pa licenses yml [\#39](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/39) ([forelabs](https://github.com/forelabs))
2
23
 
3
24
  ## [v1.3.1](https://github.com/phrase/phraseapp-in-context-editor-ruby/tree/v1.3.1) (2019-08-29)
25
+
4
26
  [Full Changelog](https://github.com/phrase/phraseapp-in-context-editor-ruby/compare/v1.3.0...v1.3.1)
5
- - Change api host to api.phrase.com
6
27
 
7
- ## [v1.3.0](https://github.com/phrase/phraseapp-in-context-editor-ruby/tree/v1.3.0) (2018-04-18)
28
+ **Merged pull requests:**
29
+
30
+ - Update docs [\#38](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/38) ([timleers](https://github.com/timleers))
31
+ - Update documentation URLs [\#37](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/37) ([docstun](https://github.com/docstun))
32
+
33
+ ## [v1.3.0](https://github.com/phrase/phraseapp-in-context-editor-ruby/tree/v1.3.0) (2018-04-19)
34
+
8
35
  [Full Changelog](https://github.com/phrase/phraseapp-in-context-editor-ruby/compare/v1.2.1...v1.3.0)
9
- - Remove support for Ruby < 2.1
36
+
37
+ **Closed issues:**
38
+
39
+ - Using translation in data-x attributes replaces entire string. [\#33](https://github.com/phrase/phraseapp-in-context-editor-ruby/issues/33)
40
+
41
+ **Merged pull requests:**
42
+
43
+ - Set ruby 2.1 as minimum version [\#36](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/36) ([theSoenke](https://github.com/theSoenke))
44
+ - use RequestStore instead of Thread\[:current\] [\#32](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/32) ([zuchmanski](https://github.com/zuchmanski))
10
45
 
11
46
  ## [v1.2.1](https://github.com/phrase/phraseapp-in-context-editor-ruby/tree/v1.2.1) (2017-03-13)
47
+
12
48
  [Full Changelog](https://github.com/phrase/phraseapp-in-context-editor-ruby/compare/v1.2.0...v1.2.1)
13
49
 
14
50
  **Closed issues:**
@@ -21,6 +57,7 @@
21
57
  - Version update, Ruby 2.4.0 support because of json-dependency change [\#20](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/20) ([fredv](https://github.com/fredv))
22
58
 
23
59
  ## [v1.2.0](https://github.com/phrase/phraseapp-in-context-editor-ruby/tree/v1.2.0) (2017-02-24)
60
+
24
61
  [Full Changelog](https://github.com/phrase/phraseapp-in-context-editor-ruby/compare/v1.1.0...v1.2.0)
25
62
 
26
63
  **Merged pull requests:**
@@ -28,6 +65,7 @@
28
65
  - Changes json dependency to json \>= 1.8 [\#18](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/18) ([fredv](https://github.com/fredv))
29
66
 
30
67
  ## [v1.1.0](https://github.com/phrase/phraseapp-in-context-editor-ruby/tree/v1.1.0) (2016-10-04)
68
+
31
69
  [Full Changelog](https://github.com/phrase/phraseapp-in-context-editor-ruby/compare/v1.0.2...v1.1.0)
32
70
 
33
71
  **Closed issues:**
@@ -45,16 +83,21 @@
45
83
  - disable dependency loading on before as fix for rails5 [\#13](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/13) ([koljaa](https://github.com/koljaa))
46
84
  - Update LICENSE [\#11](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/11) ([sbruhns](https://github.com/sbruhns))
47
85
  - i18n set to \>= 0.6 [\#10](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/10) ([jethroo](https://github.com/jethroo))
48
- - 18n delegate refactoring [\#6](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/6) ([koljaa](https://github.com/koljaa))
49
86
 
50
87
  ## [v1.0.2](https://github.com/phrase/phraseapp-in-context-editor-ruby/tree/v1.0.2) (2015-10-12)
88
+
51
89
  [Full Changelog](https://github.com/phrase/phraseapp-in-context-editor-ruby/compare/v1.0.1...v1.0.2)
52
90
 
53
91
  **Closed issues:**
54
92
 
55
93
  - Method missing error [\#5](https://github.com/phrase/phraseapp-in-context-editor-ruby/issues/5)
56
94
 
95
+ **Merged pull requests:**
96
+
97
+ - 18n delegate refactoring [\#6](https://github.com/phrase/phraseapp-in-context-editor-ruby/pull/6) ([koljaa](https://github.com/koljaa))
98
+
57
99
  ## [v1.0.1](https://github.com/phrase/phraseapp-in-context-editor-ruby/tree/v1.0.1) (2015-10-07)
100
+
58
101
  [Full Changelog](https://github.com/phrase/phraseapp-in-context-editor-ruby/compare/v1.0.0...v1.0.1)
59
102
 
60
103
  **Closed issues:**
@@ -66,5 +109,8 @@
66
109
 
67
110
  ## [v1.0.0](https://github.com/phrase/phraseapp-in-context-editor-ruby/tree/v1.0.0) (2015-08-21)
68
111
 
112
+ [Full Changelog](https://github.com/phrase/phraseapp-in-context-editor-ruby/compare/4a0e284a7acad8529eef882863b226858384b757...v1.0.0)
113
+
114
+
69
115
 
70
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
116
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/CODEOWNERS ADDED
@@ -0,0 +1 @@
1
+ * @Varpusparvi @francawinter @itsahsiao @lookasc @flowreaction @valeraine
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,241 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ phraseapp-in-context-editor-ruby (2.0.0)
5
+ i18n (~> 1.0)
6
+ json (~> 2.0)
7
+ request_store (~> 1.2)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actioncable (7.0.7.2)
13
+ actionpack (= 7.0.7.2)
14
+ activesupport (= 7.0.7.2)
15
+ nio4r (~> 2.0)
16
+ websocket-driver (>= 0.6.1)
17
+ actionmailbox (7.0.7.2)
18
+ actionpack (= 7.0.7.2)
19
+ activejob (= 7.0.7.2)
20
+ activerecord (= 7.0.7.2)
21
+ activestorage (= 7.0.7.2)
22
+ activesupport (= 7.0.7.2)
23
+ mail (>= 2.7.1)
24
+ net-imap
25
+ net-pop
26
+ net-smtp
27
+ actionmailer (7.0.7.2)
28
+ actionpack (= 7.0.7.2)
29
+ actionview (= 7.0.7.2)
30
+ activejob (= 7.0.7.2)
31
+ activesupport (= 7.0.7.2)
32
+ mail (~> 2.5, >= 2.5.4)
33
+ net-imap
34
+ net-pop
35
+ net-smtp
36
+ rails-dom-testing (~> 2.0)
37
+ actionpack (7.0.7.2)
38
+ actionview (= 7.0.7.2)
39
+ activesupport (= 7.0.7.2)
40
+ rack (~> 2.0, >= 2.2.4)
41
+ rack-test (>= 0.6.3)
42
+ rails-dom-testing (~> 2.0)
43
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
44
+ actiontext (7.0.7.2)
45
+ actionpack (= 7.0.7.2)
46
+ activerecord (= 7.0.7.2)
47
+ activestorage (= 7.0.7.2)
48
+ activesupport (= 7.0.7.2)
49
+ globalid (>= 0.6.0)
50
+ nokogiri (>= 1.8.5)
51
+ actionview (7.0.7.2)
52
+ activesupport (= 7.0.7.2)
53
+ builder (~> 3.1)
54
+ erubi (~> 1.4)
55
+ rails-dom-testing (~> 2.0)
56
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
57
+ activejob (7.0.7.2)
58
+ activesupport (= 7.0.7.2)
59
+ globalid (>= 0.3.6)
60
+ activemodel (7.0.7.2)
61
+ activesupport (= 7.0.7.2)
62
+ activerecord (7.0.7.2)
63
+ activemodel (= 7.0.7.2)
64
+ activesupport (= 7.0.7.2)
65
+ activestorage (7.0.7.2)
66
+ actionpack (= 7.0.7.2)
67
+ activejob (= 7.0.7.2)
68
+ activerecord (= 7.0.7.2)
69
+ activesupport (= 7.0.7.2)
70
+ marcel (~> 1.0)
71
+ mini_mime (>= 1.1.0)
72
+ activesupport (7.0.7.2)
73
+ concurrent-ruby (~> 1.0, >= 1.0.2)
74
+ i18n (>= 1.6, < 2)
75
+ minitest (>= 5.1)
76
+ tzinfo (~> 2.0)
77
+ addressable (2.8.5)
78
+ public_suffix (>= 2.0.2, < 6.0)
79
+ async (2.6.4)
80
+ console (~> 1.10)
81
+ fiber-annotation
82
+ io-event (~> 1.1)
83
+ timers (~> 4.1)
84
+ async-http (0.60.2)
85
+ async (>= 1.25)
86
+ async-io (>= 1.28)
87
+ async-pool (>= 0.2)
88
+ protocol-http (~> 0.24.0)
89
+ protocol-http1 (~> 0.15.0)
90
+ protocol-http2 (~> 0.15.0)
91
+ traces (>= 0.10.0)
92
+ async-http-faraday (0.12.0)
93
+ async-http (~> 0.42)
94
+ faraday
95
+ async-io (1.35.0)
96
+ async
97
+ async-pool (0.4.0)
98
+ async (>= 1.25)
99
+ builder (3.2.4)
100
+ concurrent-ruby (1.2.2)
101
+ console (1.23.2)
102
+ fiber-annotation
103
+ fiber-local
104
+ crass (1.0.6)
105
+ date (3.3.3)
106
+ diff-lcs (1.5.0)
107
+ erubi (1.12.0)
108
+ faraday (2.7.10)
109
+ faraday-net_http (>= 2.0, < 3.1)
110
+ ruby2_keywords (>= 0.0.4)
111
+ faraday-http-cache (2.5.0)
112
+ faraday (>= 0.8)
113
+ faraday-net_http (3.0.2)
114
+ fiber-annotation (0.2.0)
115
+ fiber-local (1.0.0)
116
+ github_changelog_generator (1.16.4)
117
+ activesupport
118
+ async (>= 1.25.0)
119
+ async-http-faraday
120
+ faraday-http-cache
121
+ multi_json
122
+ octokit (~> 4.6)
123
+ rainbow (>= 2.2.1)
124
+ rake (>= 10.0)
125
+ globalid (1.2.0)
126
+ activesupport (>= 6.1)
127
+ i18n (1.14.1)
128
+ concurrent-ruby (~> 1.0)
129
+ io-event (1.3.2)
130
+ json (2.6.3)
131
+ loofah (2.21.3)
132
+ crass (~> 1.0.2)
133
+ nokogiri (>= 1.12.0)
134
+ mail (2.8.1)
135
+ mini_mime (>= 0.1.1)
136
+ net-imap
137
+ net-pop
138
+ net-smtp
139
+ marcel (1.0.2)
140
+ method_source (1.0.0)
141
+ mini_mime (1.1.5)
142
+ minitest (5.19.0)
143
+ multi_json (1.15.0)
144
+ net-imap (0.3.7)
145
+ date
146
+ net-protocol
147
+ net-pop (0.1.2)
148
+ net-protocol
149
+ net-protocol (0.2.1)
150
+ timeout
151
+ net-smtp (0.3.3)
152
+ net-protocol
153
+ nio4r (2.5.9)
154
+ nokogiri (1.15.4-arm64-darwin)
155
+ racc (~> 1.4)
156
+ octokit (4.25.1)
157
+ faraday (>= 1, < 3)
158
+ sawyer (~> 0.9)
159
+ protocol-hpack (1.4.2)
160
+ protocol-http (0.24.7)
161
+ protocol-http1 (0.15.1)
162
+ protocol-http (~> 0.22)
163
+ protocol-http2 (0.15.1)
164
+ protocol-hpack (~> 1.4)
165
+ protocol-http (~> 0.18)
166
+ public_suffix (5.0.3)
167
+ racc (1.7.1)
168
+ rack (2.2.8)
169
+ rack-test (2.1.0)
170
+ rack (>= 1.3)
171
+ rails (7.0.7.2)
172
+ actioncable (= 7.0.7.2)
173
+ actionmailbox (= 7.0.7.2)
174
+ actionmailer (= 7.0.7.2)
175
+ actionpack (= 7.0.7.2)
176
+ actiontext (= 7.0.7.2)
177
+ actionview (= 7.0.7.2)
178
+ activejob (= 7.0.7.2)
179
+ activemodel (= 7.0.7.2)
180
+ activerecord (= 7.0.7.2)
181
+ activestorage (= 7.0.7.2)
182
+ activesupport (= 7.0.7.2)
183
+ bundler (>= 1.15.0)
184
+ railties (= 7.0.7.2)
185
+ rails-dom-testing (2.2.0)
186
+ activesupport (>= 5.0.0)
187
+ minitest
188
+ nokogiri (>= 1.6)
189
+ rails-html-sanitizer (1.6.0)
190
+ loofah (~> 2.21)
191
+ nokogiri (~> 1.14)
192
+ railties (7.0.7.2)
193
+ actionpack (= 7.0.7.2)
194
+ activesupport (= 7.0.7.2)
195
+ method_source
196
+ rake (>= 12.2)
197
+ thor (~> 1.0)
198
+ zeitwerk (~> 2.5)
199
+ rainbow (3.1.1)
200
+ rake (13.0.6)
201
+ request_store (1.5.1)
202
+ rack (>= 1.4)
203
+ rspec (3.12.0)
204
+ rspec-core (~> 3.12.0)
205
+ rspec-expectations (~> 3.12.0)
206
+ rspec-mocks (~> 3.12.0)
207
+ rspec-core (3.12.2)
208
+ rspec-support (~> 3.12.0)
209
+ rspec-expectations (3.12.3)
210
+ diff-lcs (>= 1.2.0, < 2.0)
211
+ rspec-support (~> 3.12.0)
212
+ rspec-mocks (3.12.6)
213
+ diff-lcs (>= 1.2.0, < 2.0)
214
+ rspec-support (~> 3.12.0)
215
+ rspec-support (3.12.1)
216
+ ruby2_keywords (0.0.5)
217
+ sawyer (0.9.2)
218
+ addressable (>= 2.3.5)
219
+ faraday (>= 0.17.3, < 3)
220
+ thor (1.2.2)
221
+ timeout (0.4.0)
222
+ timers (4.3.5)
223
+ traces (0.11.1)
224
+ tzinfo (2.0.6)
225
+ concurrent-ruby (~> 1.0)
226
+ websocket-driver (0.7.6)
227
+ websocket-extensions (>= 0.1.0)
228
+ websocket-extensions (0.1.5)
229
+ zeitwerk (2.6.11)
230
+
231
+ PLATFORMS
232
+ arm64-darwin-22
233
+
234
+ DEPENDENCIES
235
+ github_changelog_generator (~> 1.16)
236
+ phraseapp-in-context-editor-ruby!
237
+ rails (~> 7.0)
238
+ rspec (~> 3.0)
239
+
240
+ BUNDLED WITH
241
+ 2.4.19
data/Guardfile CHANGED
@@ -1,29 +1,29 @@
1
1
  # A sample Guardfile
2
2
  # More info at https://github.com/guard/guard#readme
3
3
 
4
- guard 'bundler' do
5
- watch('Gemfile')
4
+ guard "bundler" do
5
+ watch("Gemfile")
6
6
  # Uncomment next line if Gemfile contain `gemspec' command
7
7
  # watch(/^.+\.gemspec/)
8
8
  end
9
9
 
10
- guard 'rspec' do
10
+ guard "rspec" do
11
11
  watch(%r{^spec/.+_spec\.rb$})
12
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
13
- watch('spec/spec_helper.rb') { "spec" }
12
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
13
+ watch("spec/spec_helper.rb") { "spec" }
14
14
 
15
15
  # Rails example
16
- watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
17
- watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
18
- watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
19
- watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
20
- watch('config/routes.rb') { "spec/routing" }
21
- watch('app/controllers/application_controller.rb') { "spec/controllers" }
16
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
17
+ watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
18
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
19
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
20
+ watch("config/routes.rb") { "spec/routing" }
21
+ watch("app/controllers/application_controller.rb") { "spec/controllers" }
22
22
 
23
23
  # Capybara features specs
24
- watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
24
+ watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
25
25
 
26
26
  # Turnip features and steps
27
27
  watch(%r{^spec/acceptance/(.+)\.feature$})
28
- watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
28
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance" }
29
29
  end
data/README.md CHANGED
@@ -1,92 +1,122 @@
1
- # PhraseApp In-Context-Editor for Ruby #
1
+ # phraseapp-in-context-editor-ruby
2
2
 
3
- *This Ruby gem is for use with Ruby (Rails, Sinatra) applications only. Check out the [documentation](https://help.phraseapp.com/translate-website-and-app-content/use-in-context-editor-to-translate/translate-directly-on-your-website) to learn how to set up the In-Context-Editor with other technologies.*
3
+ ![Build status](https://github.com/phrase/phraseapp-in-context-editor-ruby/workflows/Test/badge.svg)
4
4
 
5
- [![Build Status](https://travis-ci.org/phrase/phraseapp-in-context-editor-ruby.svg)](https://travis-ci.org/phrase/phraseapp-in-context-editor-ruby)
5
+ **phraseapp-in-context-editor-ruby** is the official library for integrating [Phrase Strings In-Context Editor](https://support.phrase.com/hc/en-us/articles/5784095916188-In-Context-Editor-Strings) with [i18n](https://github.com/ruby-i18n/i18n) in your Ruby application.
6
6
 
7
- PhraseApp is the translation management solution for web and mobile applications. Collaborate with your team, find professional translators and stay on top of the process.
7
+ ## :scroll: Documentation
8
8
 
9
- [Try out Phraseapp for free](https://phraseapp.com/signup) and start translating your app!
9
+ ### Prerequisites
10
10
 
11
- *Note: This gem [documentation](https://help.phraseapp.com/translate-website-and-app-content/use-in-context-editor-to-translate/translate-directly-on-your-website) to learn how to install the In-Context-Editor with other technologies.*
11
+ To use phraseapp-in-context-editor-ruby with your application you have to:
12
12
 
13
- ## In-Context-Editor ###
13
+ * Sign up for a Phrase account: [https://app.phrase.com/signup](https://app.phrase.com/signup)
14
+ * Use the excellent [i18n](https://github.com/ruby-i18n/i18n) gem also used by [Rails](https://guides.rubyonrails.org/i18n.html)
14
15
 
15
- How awesome would it be if translators could simply browse your website and edit text along the way? Our In-Context Editor offers just that. It provides translators with useful contextual information which improves overall translation quality. See our documentation on how to set it up: [In-Context Editor Setup](https://help.phraseapp.com/translate-website-and-app-content/use-in-context-editor-to-translate/translate-directly-on-your-website).
16
+ ### Demo
16
17
 
17
- ## Installation
18
+ You can find a demo project in the `examples/demo` folder, just run `bundle && rails s` and head to `http://127.0.0.1:3000`
19
+ Login via the demo credentials `demo@phrase.com` / `phrase`
18
20
 
19
- ### Install the gem
21
+ ### Installation
20
22
 
21
- Install the gem via `gem install`:
23
+ #### NOTE: You can not use the old version of the ICE with integration versions of >2.0.0, you have to instead use 1.x.x versions as before
24
+ #### via Gem
22
25
 
23
- gem install phraseapp-in-context-editor-ruby
26
+ ```bash
27
+ gem install phraseapp-in-context-editor-ruby
28
+ ```
29
+ #### via Bundler
24
30
 
25
- or add it to your `Gemfile` when using bundler:
31
+ Add it to your `Gemfile`
26
32
 
27
- gem 'phraseapp-in-context-editor-ruby'
33
+ ```
34
+ gem 'phraseapp-in-context-editor-ruby
35
+ ```
28
36
 
29
- and install it:
37
+ #### Build from source
30
38
 
31
- $ bundle install
39
+ You can also build it directly from source to get the latest and greatest:
32
40
 
33
- Next, create the initializer file by executing the Rails generator:
41
+ ```bash
42
+ bundle && gem build
43
+ ```
34
44
 
35
- $ bundle exec rails generate phraseapp_in_context_editor:install --access-token=<YOUR_TOKEN> --project-id=<YOUR_PROJECT_ID>
45
+ #### Initialized config file
36
46
 
37
- ##### --access-token
47
+ Create the initializer file by executing the Rails generator:
38
48
 
39
- You can create and manage access tokens in your [profile settings](https://phraseapp.com/settings/oauth_access_tokens) or via the [Authorizations API](https://developers.phraseapp.com/api/#authorizations).
49
+ ```bash
50
+ rails generate phraseapp_in_context_editor:install --account_id=<YOUR_ACCOUNT_ID> --project-id=<YOUR_PROJECT_ID>
51
+ ```
40
52
 
41
- ##### --project-id
53
+ ### Development
42
54
 
43
- You can find the ID of your project in your project settings in Translation Center.
55
+ ```bash
56
+ # install deps
57
+ bundle
58
+ ```
44
59
 
45
- ### Add the JavaScript helper
60
+ #### Configure
46
61
 
47
- Next, add the Javascript helper to your Rails application layout file:
62
+ Add the following Ruby snippet to your rails `app/views//layouts/application.html.erb`
48
63
 
49
- <%= phraseapp_in_context_editor_js %>
64
+ ```
65
+ <%= load_in_context_editor %>
66
+ ```
50
67
 
51
- If you don't want to use the helper but add the plain Javascript yourself, head over to our [documentation](https://help.phraseapp.com/translate-website-and-app-content/use-in-context-editor-to-translate/translate-directly-on-your-website) to learn more.
68
+ And the following config to your `/config/initializers/phraseapp_in_context_editor.rb`
52
69
 
53
- ### Done!
70
+ ```ruby
71
+ config.enabled = true
72
+ config.project_id = "YOUR_PROJECT_ID"
73
+ config.account_id = "YOUR_ACCOUNT_ID"
74
+ config.datacenter = "eu"
75
+ ```
54
76
 
55
- Restart your application to see the In-Context-Editor in action!
77
+ You can find the Project-ID in the Project overview in the PhraseApp Translation Center.
78
+ You can find the Account-ID in the Organization page in the PhraseApp Translation Center.
56
79
 
57
- ### OpenSSL issues
80
+ If this does not work for you, you can also integrate the [JavaScript snippet manually](https://help.phrase.com/help/integrate-in-context-editor-into-any-web-framework).
58
81
 
59
- Please note that outdated certificates or old versions of OpenSSL may cause connection issues, especially on Mac OSX. We recommend using Ruby 2.2.2 with OpenSSL 1.0.2d or later. If you experience OpenSSL-related errors, try the following.
82
+ Old version of the ICE is not available since version 2.0.0. If you still would rather use the old version, please go back to 1.x.x versions.
60
83
 
61
- Upgrade OpenSSL using Homebrew:
84
+ #### Using the US Datacenter with ICE
62
85
 
63
- ```shell
64
- $ brew upgrade openssl
65
- $ brew install openssl
86
+ In addition to the settings in your `config/initializers/phraseapp_in_context_editor.rb`, set the US datacenter to enable the ICE to work with the US endpoints.
87
+ ```ruby
88
+ config.enabled = true
89
+ config.project_id = "YOUR_PROJECT_ID"
90
+ config.account_id = "YOUR_ACCOUNT_ID"
91
+ config.datacenter = "us"
66
92
  ```
67
93
 
68
- If you are using RVM, also run:
94
+ ### Browser support
69
95
 
70
- ```shell
71
- $ rvm osx-ssl-certs status all
72
- $ rvm osx-ssl-certs update all
73
- ````
96
+ This library might not work out of the box for some older browser or IE11. We recommend to add [Babel](https://github.com/babel/babel) to the build pipeline if those browser need to be supported.
74
97
 
75
- As a workaround, you can disable SSL certificate verification in your `config/initializers/phraseapp_in_context_editor.rb` by adding the following line:
98
+ ### How does it work
76
99
 
77
- ```ruby
78
- config.skip_ssl_verification = true
100
+ The library adds custom functionality to the `i18n` package. When `config.enabled = true` this gem modifies the outcoming values from translation functions to present a format which the ICE can read.
101
+
102
+ ### Test
103
+
104
+ Run unit tests using jest:
105
+
106
+ ```bash
107
+ rspec
79
108
  ```
80
109
 
81
- This is **not recommended** and should only be used as a temporary workaround.
110
+ ## :white_check_mark: Commits & Pull Requests
111
+
112
+ We welcome anyone who wants to contribute to our codebase, so if you notice something, feel free to open a Pull Request! However, we ask that you please use the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification for your commit messages and titles when opening a Pull Request.
113
+
114
+ Example: `chore: Update README`
115
+
116
+ ## :question: Issues, Questions, Support
82
117
 
118
+ Please use [GitHub issues](https://github.com/phrase/phraseapp-in-context-editor-ruby/issues) to share your problem, and we will do our best to answer any questions or to support you in finding a solution.
83
119
 
84
- ## Further Information
85
- * [PhraseApp Help Center](https://help.phraseapp.com/)
86
- * [Software Translation Management with PhraseApp](https://phraseapp.com/features)
87
- * [Contact us](https://phraseapp.com/contact)
120
+ ## :memo: Changelog
88
121
 
89
- ## References
90
- * [PhraseApp API Documentation](https://developers.phraseapp.com/api/)
91
- * [In-Context-Editor Demo](https://demo.phraseapp.com)
92
- * [Localization Guides and Software Translation Best Practices](https://phraseapp.com/blog/)
122
+ Detailed changes for each release are documented in the [changelog](https://github.com/phrase/phraseapp-in-context-editor-ruby/releases).
data/RELEASING.md ADDED
@@ -0,0 +1,10 @@
1
+ # Release
2
+
3
+ 1. Bump the version to the desired number in lib/phraseapp-in-context-editor-ruby/version.rb. Make sure you're following semantic versioning.
4
+ 2. Run `bundle` and commit Gemfile.lock including the new version of the gem
5
+ 3. Make sure the tests pass
6
+ 4. Tag the new version on GitHub
7
+ 5. Update the CHANGELOG by running `$ github_changelog_generator` and commit the new `CHANGELOG`
8
+ 6. Build the gem by running `gem build phraseapp-in-context-editor-ruby.gemspec`
9
+ 7. Push the gem to Rubygems by running `gem push phraseapp-in-context-editor-ruby-<VERSION>.gem`
10
+ 8. Done!
@@ -0,0 +1,34 @@
1
+ ---
2
+ - - :name_project
3
+ - ice-ruby
4
+ - :who: Sven Dunemann
5
+ :why: short name of project
6
+ :versions: []
7
+ :when: 2020-05-07 07:33:57.612101331 Z
8
+ - - :ignore_group
9
+ - development
10
+ - :who:
11
+ :why:
12
+ :versions: []
13
+ :when: 2020-05-28 06:07:17.509402355 Z
14
+ - - :ignore_group
15
+ - test
16
+ - :who:
17
+ :why:
18
+ :versions: []
19
+ :when: 2020-05-28 06:07:22.250180736 Z
20
+ - - :ignore
21
+ - phraseapp-in-context-editor-ruby
22
+ - :who: Sven Dunemann
23
+ :why: Internal phrase library
24
+ :versions: []
25
+ :when: 2020-05-28 06:45:09.434963794 Z
26
+ - - :ignore
27
+ - phraseapp-ruby
28
+ - :who: Sven Dunemann
29
+ :why: Internal phrase library
30
+ :versions: []
31
+ :when: 2020-05-28 06:46:05.492507471 Z
32
+ - - :inherit_from
33
+ - url: https://raw.githubusercontent.com/phrase/lawa/master/config/license-decisions.yml
34
+ authorization: token $GITHUB_TOKEN