phraseapp_updater 2.1.0 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/gem-push.yml +31 -0
- data/.github/workflows/test.yml +41 -0
- data/bin/phraseapp_common.sh +9 -3
- data/bin/synchronize_phraseapp.sh +2 -2
- data/lib/phraseapp_updater/locale_file/json_file.rb +4 -1
- data/lib/phraseapp_updater/version.rb +1 -1
- data/phraseapp_updater.gemspec +1 -1
- metadata +7 -6
- data/.circleci/config.yml +0 -98
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cb9f8e20f3b078b508e5e427e98d9c62153e02e88542ecf43fc774bef05125f
|
4
|
+
data.tar.gz: e5110c0c2534f4e5819007aa0209ab2efec954a6ce461c404d01ff177b6cfd91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a650fd825eb3f37e55388509b23f57b0cfb2a8e5a7235d275ce4b8259f8fc82c955ac54ad701bbfa1fcd7f2689ae16c796133b35a95417536d0632c1cde22a2
|
7
|
+
data.tar.gz: 6108be4a1d29345d3063dd4cf94972aae52de8f67088cd70ff6fcccd4907128f587fbfe721d90f4856bf07707b7271be28ddb81c4b55162fcdc8d944580d6704
|
@@ -0,0 +1,31 @@
|
|
1
|
+
name: Publish Ruby Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ "master" ]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
build:
|
9
|
+
name: Build + Publish
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
permissions:
|
12
|
+
contents: read
|
13
|
+
packages: write
|
14
|
+
|
15
|
+
steps:
|
16
|
+
- uses: actions/checkout@v3
|
17
|
+
- name: Set up Ruby 2.7
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: 2.7
|
21
|
+
|
22
|
+
- name: Publish to RubyGems
|
23
|
+
run: |
|
24
|
+
mkdir -p $HOME/.gem
|
25
|
+
touch $HOME/.gem/credentials
|
26
|
+
chmod 0600 $HOME/.gem/credentials
|
27
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
28
|
+
gem build *.gemspec
|
29
|
+
gem push *.gem
|
30
|
+
env:
|
31
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
@@ -0,0 +1,41 @@
|
|
1
|
+
name: Run Tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
branches: "**"
|
6
|
+
|
7
|
+
permissions:
|
8
|
+
contents: read
|
9
|
+
checks: write
|
10
|
+
pull-requests: write
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
test:
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
|
16
|
+
strategy:
|
17
|
+
matrix:
|
18
|
+
ruby-version: ['2.7', '3.0', '3.1']
|
19
|
+
|
20
|
+
steps:
|
21
|
+
- uses: actions/checkout@v3
|
22
|
+
- name: Set up Ruby
|
23
|
+
uses: ruby/setup-ruby@v1
|
24
|
+
with:
|
25
|
+
ruby-version: ${{ matrix.ruby-version }}
|
26
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
27
|
+
- name: Run tests
|
28
|
+
run: bundle exec rspec --profile 10 --format RspecJunitFormatter --out test_results/rspec.xml --format progress
|
29
|
+
- name: Upload result
|
30
|
+
uses: actions/upload-artifact@v3
|
31
|
+
if: always()
|
32
|
+
with:
|
33
|
+
name: rspec.xml
|
34
|
+
path: test_results/rspec.xml
|
35
|
+
- name: Test Report
|
36
|
+
uses: dorny/test-reporter@v1
|
37
|
+
if: always()
|
38
|
+
with:
|
39
|
+
name: Rspec Tests - ${{ matrix.ruby-version }}
|
40
|
+
path: test_results/rspec.xml
|
41
|
+
reporter: java-junit
|
data/bin/phraseapp_common.sh
CHANGED
@@ -4,13 +4,19 @@
|
|
4
4
|
working_directory=$(mktemp -d -t phraseapp.XXXXXX)
|
5
5
|
|
6
6
|
function cleanup_working_directory(){
|
7
|
-
|
7
|
+
local now archive
|
8
|
+
now="$(date "+%Y%m%d%H%M%S")"
|
9
|
+
archive="/tmp/phraseapp-updater-$now.tar.gz"
|
10
|
+
tar czf "$archive" "${working_directory}"
|
11
|
+
rm -rf "${working_directory}"
|
12
|
+
echo "Working files saved to $archive"
|
8
13
|
}
|
9
14
|
|
10
15
|
trap "cleanup_working_directory" EXIT SIGINT
|
11
16
|
|
12
17
|
function make_temporary_directory() {
|
13
|
-
|
18
|
+
name="${1:-tmp}"
|
19
|
+
mktemp -d "${working_directory}/$name.XXXXXXXX"
|
14
20
|
}
|
15
21
|
|
16
22
|
function make_tree_from_directory() {
|
@@ -41,7 +47,7 @@ function extract_commit() {
|
|
41
47
|
|
42
48
|
function extract_files() {
|
43
49
|
local path
|
44
|
-
path=$(make_temporary_directory)
|
50
|
+
path=$(make_temporary_directory "git.${1%%:*}")
|
45
51
|
|
46
52
|
git archive --format=tar "$1" | tar -x -C "${path}"
|
47
53
|
|
@@ -34,7 +34,7 @@ if [ "$local_branch" ] && [ "$current_branch" != "$local_branch" ]; then
|
|
34
34
|
fi
|
35
35
|
|
36
36
|
# First, fetch the current contents of PhraseApp's staged ("verified") state.
|
37
|
-
current_phraseapp_path=$(make_temporary_directory)
|
37
|
+
current_phraseapp_path=$(make_temporary_directory phraseapp_download)
|
38
38
|
common_ancestor=$(phraseapp_updater download "${current_phraseapp_path}" \
|
39
39
|
--phraseapp_api_key="${PHRASEAPP_API_KEY}" \
|
40
40
|
--phraseapp_project_id="${PHRASEAPP_PROJECT_ID}" \
|
@@ -87,7 +87,7 @@ if [ "${phraseapp_changed}" = 't' ] && [ "${branch_changed}" = 't' ]; then
|
|
87
87
|
echo "$BRANCH branch and PhraseApp both changed: 3-way merging" >&2
|
88
88
|
|
89
89
|
# 3-way merge
|
90
|
-
merge_resolution_path=$(make_temporary_directory)
|
90
|
+
merge_resolution_path=$(make_temporary_directory merge_resolution)
|
91
91
|
phraseapp_updater merge "${common_ancestor_path}" "${current_branch_path}" "${current_phraseapp_path}" \
|
92
92
|
--to "${merge_resolution_path}" \
|
93
93
|
--verbose="${VERBOSE}" \
|
@@ -22,7 +22,10 @@ class PhraseAppUpdater
|
|
22
22
|
|
23
23
|
def dump(hash)
|
24
24
|
# Add indentation for better diffs
|
25
|
-
Oj.dump(hash, indent:
|
25
|
+
json = Oj.dump(hash, indent: ' ', space: ' ', object_nl: "\n", array_nl: "\n", mode: :strict)
|
26
|
+
# Oj omits end of file newline unless using the integer form of :indent
|
27
|
+
json << "\n"
|
28
|
+
json
|
26
29
|
end
|
27
30
|
|
28
31
|
def extension
|
data/phraseapp_updater.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_dependency "deep_merge", "~> 1.1"
|
28
28
|
spec.add_dependency "parallel", "~> 1.12"
|
29
29
|
|
30
|
-
spec.add_development_dependency "bundler", "~>
|
30
|
+
spec.add_development_dependency "bundler", "~> 2.2"
|
31
31
|
spec.add_development_dependency "rake", "~> 10.0"
|
32
32
|
spec.add_development_dependency "rspec", "~> 3.0"
|
33
33
|
spec.add_development_dependency "pry", "~> 0.10"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phraseapp_updater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Griffin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
117
|
+
version: '2.2'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
124
|
+
version: '2.2'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rake
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -173,8 +173,9 @@ executables:
|
|
173
173
|
extensions: []
|
174
174
|
extra_rdoc_files: []
|
175
175
|
files:
|
176
|
-
- ".circleci/config.yml"
|
177
176
|
- ".envrc"
|
177
|
+
- ".github/workflows/gem-push.yml"
|
178
|
+
- ".github/workflows/test.yml"
|
178
179
|
- ".gitignore"
|
179
180
|
- ".rspec"
|
180
181
|
- ".travis.yml"
|
@@ -222,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
223
|
- !ruby/object:Gem::Version
|
223
224
|
version: '0'
|
224
225
|
requirements: []
|
225
|
-
rubygems_version: 3.
|
226
|
+
rubygems_version: 3.1.6
|
226
227
|
signing_key:
|
227
228
|
specification_version: 4
|
228
229
|
summary: A three-way differ for PhraseApp projects.
|
data/.circleci/config.yml
DELETED
@@ -1,98 +0,0 @@
|
|
1
|
-
version: 2.1
|
2
|
-
|
3
|
-
executors:
|
4
|
-
ruby:
|
5
|
-
parameters:
|
6
|
-
ruby-version:
|
7
|
-
type: string
|
8
|
-
default: "2.6"
|
9
|
-
gemfile:
|
10
|
-
type: string
|
11
|
-
default: "Gemfile"
|
12
|
-
docker:
|
13
|
-
- image: circleci/ruby:<< parameters.ruby-version >>
|
14
|
-
environment:
|
15
|
-
BUNDLE_JOBS: 3
|
16
|
-
BUNDLE_RETRY: 3
|
17
|
-
BUNDLE_PATH: vendor/bundle
|
18
|
-
RAILS_ENV: test
|
19
|
-
BUNDLE_GEMFILE: << parameters.gemfile >>
|
20
|
-
|
21
|
-
jobs:
|
22
|
-
test:
|
23
|
-
parameters:
|
24
|
-
ruby-version:
|
25
|
-
type: string
|
26
|
-
executor:
|
27
|
-
name: ruby
|
28
|
-
ruby-version: << parameters.ruby-version >>
|
29
|
-
parallelism: 1
|
30
|
-
steps:
|
31
|
-
- checkout
|
32
|
-
|
33
|
-
- run:
|
34
|
-
# Remove the non-appraisal gemfile for safety: we never want to use it.
|
35
|
-
name: Prepare bundler
|
36
|
-
command: bundle -v
|
37
|
-
|
38
|
-
- run:
|
39
|
-
name: Compute a gemfile lock
|
40
|
-
command: bundle lock && cp "${BUNDLE_GEMFILE}.lock" /tmp/gem-lock
|
41
|
-
|
42
|
-
- restore_cache:
|
43
|
-
keys:
|
44
|
-
- phraseapp_updater-v2-<< parameters.ruby-version >>-{{ checksum "/tmp/gem-lock" }}
|
45
|
-
- phraseapp_updater-v2
|
46
|
-
|
47
|
-
- run:
|
48
|
-
name: Bundle Install
|
49
|
-
command: bundle check || bundle install
|
50
|
-
|
51
|
-
- save_cache:
|
52
|
-
key: phraseapp_updater-v2-<< parameters.ruby-version >>-{{ checksum "/tmp/gem-lock" }}
|
53
|
-
paths:
|
54
|
-
- vendor/bundle
|
55
|
-
|
56
|
-
- run:
|
57
|
-
name: Run rspec
|
58
|
-
command: bundle exec rspec --profile 10 --format RspecJunitFormatter --out test_results/rspec.xml --format progress
|
59
|
-
|
60
|
-
- store_test_results:
|
61
|
-
path: test_results
|
62
|
-
|
63
|
-
publish:
|
64
|
-
executor: ruby
|
65
|
-
steps:
|
66
|
-
- checkout
|
67
|
-
- run:
|
68
|
-
name: Setup Rubygems
|
69
|
-
command: |
|
70
|
-
mkdir ~/.gem &&
|
71
|
-
echo -e "---\r\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials &&
|
72
|
-
chmod 0600 ~/.gem/credentials
|
73
|
-
- run:
|
74
|
-
name: Publish to Rubygems
|
75
|
-
command: |
|
76
|
-
gem build phraseapp_updater.gemspec
|
77
|
-
gem push phraseapp_updater-*.gem
|
78
|
-
|
79
|
-
|
80
|
-
workflows:
|
81
|
-
version: 2.1
|
82
|
-
build:
|
83
|
-
jobs:
|
84
|
-
- test:
|
85
|
-
name: 'ruby 2.5'
|
86
|
-
ruby-version: "2.5"
|
87
|
-
- test:
|
88
|
-
name: 'ruby 2.6'
|
89
|
-
ruby-version: "2.6"
|
90
|
-
- publish:
|
91
|
-
requires:
|
92
|
-
- 'ruby 2.5'
|
93
|
-
- 'ruby 2.6'
|
94
|
-
filters:
|
95
|
-
branches:
|
96
|
-
only: master
|
97
|
-
tags:
|
98
|
-
ignore: /.*/
|