This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .phrase.yml | |
phrase: | |
access_token: YOUR_ACCESS_TOKEN | |
project_id: YOUR_PROJECT_ID | |
push: | |
sources: | |
- file: ./config/locales/<locale_name>.yml | |
params: | |
file_format: yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .github/workflows/03-pull-phrase-to-github.yml | |
name: "Locales : Phrase pull on main branch" | |
on: | |
workflow_dispatch: # This will allow us to execute this github workflow manually whenever we want. | |
schedule: | |
- cron: '0 7 * * 1,2,3,4,5' | |
jobs: | |
build: | |
name: "Phrase : Sync Phrase with Github (main branch)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .github/workflows/02-merge-phrase-branch-in-to-phrase-main.yml | |
name: "Locales : Replicate git merge in phrase.com" | |
on: | |
pull_request: | |
branches: | |
- main | |
types: | |
- closed | |
paths: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .github/workflows/01-create-phrase-branch.yml | |
name: "Locales : Create or Update phrase.com (branch)" | |
on: | |
push: | |
branches-ignore: | |
- main | |
- staging | |
- 'auto-phrase-sync-*' | |
paths: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'yaml' | |
if Gem::Version.new(Psych::LIBYAML_VERSION) < Gem::Version.new('0.2.5') | |
warn "Your libyaml library is outdated: please upgrade to >= 0.2.5.\n" \ | |
"The generated YAML will include output trailing spaces for empty scalar nodes, whereas " \ | |
"Phrase doesn't include them." | |
end | |
# Method to "deep sort" keys in a Hash (i.e. recursively), the way that Phrase would do. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
# Activate the gem you are reporting the issue against. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
# Activate the gem you are reporting the issue against. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "benchmark" | |
include Benchmark | |
n = 100_000_000 | |
def while_loop(n = 100_000_000) | |
i = 0 | |
s = 0 | |
while i <= n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/inline' | |
gemfile(true) do | |
ruby '~> 2.5' | |
source 'https://rubygems.org' | |
gem 'benchmark-ips' | |
end | |
require 'benchmark/ips' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
# Please include only the minimum code necessary to reproduce your issue. | |
require "bundler/inline" | |
# STEP ONE: What versions are you using? | |
gemfile(true) do | |
ruby "2.5.1" | |
source "https://rubygems.org" | |
gem "activerecord", "4.2.11" |
NewerOlder