phraseapp_updater 2.0.6 → 2.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6e74f3bf7f3ffcb08b72dc6daf7aecb474ceeac2a97ee39050d3ec1319f1406
4
- data.tar.gz: c03e16ce0823c0f183a518813098b6287217923aae53276c7567d2627b84165b
3
+ metadata.gz: cd13cd155e4d1489c4eadba7a8fc5def83bfc86a28f43646a9ef1924706f85a5
4
+ data.tar.gz: 341169c0beb43396cbf1b404a888ebc8ecae66a5acb57c2eb164e89d6cef856d
5
5
  SHA512:
6
- metadata.gz: 0a4e72d05dd43ce5a7f52b190b38eb996bc01e23a75bd53113d2eead8fc6ebd8f6fc72633e966228a6545ac199f5150be6acfc7588870e179dfb633793728032
7
- data.tar.gz: c70d493a8ee12ca69a97e91e8ad54ed16754c2a696ca2e347e0886b66508b9e5c1acba9ffa0d58f0f60d41e63e287f6dbf420b3ae046575f99e6a1fde283e017
6
+ metadata.gz: 830206a333355912b6ade08d4c73e1526d22c65fbde8c6674429071e3a12e9db5f9706c8fb5d7ddf29437af78b965db268635e1efa2fc3f9546ea4ed90f72aa9
7
+ data.tar.gz: 8b80b6341dd8ae25edb861ddf67a8a86788179893204c46255c02686f7e0bc09428b3f9d5fe991892a05a4c9f97850b76d235b0a1e06d7d8555d65072972f668
@@ -0,0 +1,98 @@
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-<< parameters.ruby-version >>-{{ checksum "/tmp/gem-lock" }}
45
+ - phraseapp_updater-
46
+
47
+ - run:
48
+ name: Bundle Install
49
+ command: bundle check || bundle install
50
+
51
+ - save_cache:
52
+ key: phraseapp_updater-<< 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: /.*/
data/Gemfile CHANGED
@@ -3,4 +3,4 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in phraseapp_updater.gemspec
4
4
  gemspec
5
5
  gem 'byebug'
6
-
6
+ gem 'rspec_junit_formatter'
@@ -46,12 +46,19 @@ common_ancestor=$(phraseapp_updater download "${current_phraseapp_path}" \
46
46
  # afterwards. If it's not available, we lose: the best we can do is manually
47
47
  # perform a 2-way diff and force upload to phraseapp. If it's still available
48
48
  # but not reachable, we can still try and perform a 3 way merge, but the results
49
- # will not be as accurate: warn the user.
49
+ # will not be as accurate and we can't record it as a merge: warn the user.
50
50
  if ! git cat-file -e "${common_ancestor}^{commit}"; then
51
51
  echo "Common ancestor commit could not be found: was '${BRANCH}' rebased without updating PhraseApp?" >&2
52
52
  exit 1
53
53
  elif ! git merge-base --is-ancestor "${common_ancestor}" "${current_branch}"; then
54
- echo "Warning: ancestor commit was not reachable from '${BRANCH}': 3-way merge may be inaccurate" >&2
54
+ echo "Warning: ancestor commit was not reachable from '${BRANCH}': "\
55
+ "3-way merge may be inaccurate, and PhraseApp parent commit will not be recorded" >&2
56
+
57
+ # If the merge base isn't an ancestor, then creating a merge commit from it
58
+ # will create a really misleading git history, as it will appear to be
59
+ # merging extra commits but in fact not take any contents from them. Avoid
60
+ # doing this.
61
+ skip_ancestor_merge=t
55
62
  fi
56
63
 
57
64
  current_branch_path=$(extract_commit "${current_branch}")
@@ -87,20 +94,29 @@ if [ "${phraseapp_changed}" = 't' ] && [ "${branch_changed}" = 't' ]; then
87
94
  --file_format="${FILE_FORMAT}"
88
95
 
89
96
  if [ "$NO_COMMIT" != 't' ]; then
90
- # Create a commit to record the pre-merge state of PhraseApp
91
- phraseapp_commit_tree=$(replace_nested_tree "${common_ancestor}^{tree}" "${PREFIX}" "${current_phraseapp_tree}")
92
- phraseapp_commit=$(git commit-tree "${phraseapp_commit_tree}" \
93
- -p "${common_ancestor}" \
94
- -m "Remote locale changes made on PhraseApp" \
95
- -m "These changes may be safely flattened into their merge commit when rebasing.")
96
-
97
97
  # Commit merge result to PREFIX in BRANCH
98
98
  merge_resolution_tree=$(make_tree_from_directory "${merge_resolution_path}")
99
99
  merged_branch_tree=$(replace_nested_tree "${current_branch}^{tree}" "${PREFIX}" "${merge_resolution_tree}")
100
100
 
101
+
102
+ if [ "$skip_ancestor_merge" = 't' ]; then
103
+ merge_args=()
104
+ else
105
+ # Create a commit to record the pre-merge state of PhraseApp
106
+ phraseapp_commit_tree=$(replace_nested_tree "${common_ancestor}^{tree}" "${PREFIX}" "${current_phraseapp_tree}")
107
+ phraseapp_commit=$(git commit-tree "${phraseapp_commit_tree}" \
108
+ -p "${common_ancestor}" \
109
+ -m "Remote locale changes made on PhraseApp" \
110
+ -m "These changes may be safely flattened into their merge commit when rebasing.")
111
+
112
+ merge_args=("-p" "${phraseapp_commit}")
113
+ fi
114
+
115
+
116
+
101
117
  merge_commit=$(git commit-tree "${merged_branch_tree}" \
102
118
  -p "${current_branch}" \
103
- -p "${phraseapp_commit}" \
119
+ "${merge_args[@]}" \
104
120
  -m "Merged locale changes from PhraseApp" \
105
121
  -m "Since common ancestor ${common_ancestor}" \
106
122
  -m "X-PhraseApp-Merge: ${phraseapp_commit}")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class PhraseAppUpdater
4
- VERSION = '2.0.6'
4
+ VERSION = '2.0.7'
5
5
  end
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.0.6
4
+ version: 2.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Griffin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-26 00:00:00.000000000 Z
11
+ date: 2019-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -173,6 +173,7 @@ executables:
173
173
  extensions: []
174
174
  extra_rdoc_files: []
175
175
  files:
176
+ - ".circleci/config.yml"
176
177
  - ".gitignore"
177
178
  - ".rspec"
178
179
  - ".travis.yml"
@@ -215,8 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
215
216
  - !ruby/object:Gem::Version
216
217
  version: '0'
217
218
  requirements: []
218
- rubyforge_project:
219
- rubygems_version: 2.7.7
219
+ rubygems_version: 3.0.3
220
220
  signing_key:
221
221
  specification_version: 4
222
222
  summary: A three-way differ for PhraseApp projects.