i18n-js 4.0.0.alpha1 → 4.0.0.alpha2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d07791eb7f9b879e4d5e6edd43d10564a5efad2f44e3ac0ddd2c892696dbd28b
4
- data.tar.gz: cab23b9274ee26513b48974dd307ad020a1ad3ba88bb36756397d6c47223ffb4
3
+ metadata.gz: 45e8592f190777f676916988517d474dffb4f18f09120df26733c947d63ca140
4
+ data.tar.gz: 04dfd46cfd05501a7cd1e97c5612a1ab5dbec52f98bad5f9119febcf28ce3ab8
5
5
  SHA512:
6
- metadata.gz: 0d0bb95c8e0f01bed11eced7859d6f40d032ca85a03f458d515a4cdcc444a194f315b22db39f0d6956c45951a1cf8e3e28ab06a11abb6165ca7dc5d6fa07baa1
7
- data.tar.gz: a7afe30f6f81a9b7536cb5be2a26112825bd5324443d9fe7edb43779c6084e2c4d4e439814f4458853a6ffaf540afdfc0640f8be2a7cb428b46c45c83313d0bb
6
+ metadata.gz: 96caedcf824fb434a3b77dba666dd23cff72fbfd9f3d3175c928d768920d402f2d9250bb9ff0810e836ff5fbd90d3825b19621a4fd7c27ef10a7a40586990326
7
+ data.tar.gz: bc68a8b9e54c991dc21e50ca52986b2f5c39418e6aed3b48664efbcb501e8f34d7a1333a608d6de4b6d5d8bcf7f2fc3c2de5584123b47cc6873e29047da2fdfb
@@ -3,17 +3,7 @@ name: ruby-tests
3
3
 
4
4
  on:
5
5
  pull_request:
6
- branches:
7
- - main
8
-
9
6
  push:
10
- branches:
11
- - main
12
- - v4
13
-
14
- schedule:
15
- - cron: "0 10 * * *"
16
-
17
7
  workflow_dispatch:
18
8
  inputs: {}
19
9
 
@@ -24,7 +14,7 @@ jobs:
24
14
  strategy:
25
15
  fail-fast: false
26
16
  matrix:
27
- ruby: [2.6.x, 2.7.x, 3.0.x]
17
+ ruby: ["2.7", "3.0"]
28
18
  gemfile:
29
19
  - Gemfile
30
20
 
@@ -32,17 +22,15 @@ jobs:
32
22
  - uses: actions/checkout@v1
33
23
 
34
24
  - uses: actions/cache@v2
25
+ id: bundler-cache
35
26
  with:
36
27
  path: vendor/bundle
37
28
  key: >
38
29
  ${{ runner.os }}-${{ matrix.ruby }}-gems-${{
39
30
  hashFiles(matrix.gemfile) }}
40
- restore-keys: >
41
- ${{ runner.os }}-${{ matrix.ruby }}-gems-${{
42
- hashFiles(matrix.gemfile) }}
43
31
 
44
32
  - name: Set up Ruby
45
- uses: actions/setup-ruby@v1
33
+ uses: ruby/setup-ruby@v1
46
34
  with:
47
35
  ruby-version: ${{ matrix.ruby }}
48
36
 
data/.rubocop.yml CHANGED
@@ -5,8 +5,13 @@ inherit_gem:
5
5
  AllCops:
6
6
  TargetRubyVersion: 2.6
7
7
  NewCops: enable
8
+ Exclude:
9
+ - tmp/**/*
8
10
 
9
11
  Naming/FileName:
10
12
  Exclude:
11
13
  - lib/i18n-js.rb
12
14
  - lib/guard/i18n-js.rb
15
+
16
+ Metrics:
17
+ Enabled: false
data/README.md CHANGED
@@ -99,11 +99,10 @@ Now you can run `guard start -i`.
99
99
  Create a file under `config/initializers/i18n.rb` with the following content:
100
100
 
101
101
  ```ruby
102
- # frozen_string_literal: true
103
-
104
- require "i18n-js/listen"
105
-
106
- I18nJS.listen
102
+ Rails.application.config.after_initialize do
103
+ require "i18n-js/listen"
104
+ I18nJS.listen
105
+ end
107
106
  ```
108
107
 
109
108
  The code above will watch for changes based on `config/i18n.yml` and
data/exe/i18n CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require_relative "../lib/i18n-js"
4
+ require_relative "../lib/i18n-js/cli"
5
5
  I18nJS::CLI.new(argv: ARGV, stdout: $stdout, stderr: $stderr).call
data/i18n-js.gemspec CHANGED
@@ -12,6 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = spec.summary
13
13
  spec.license = "MIT"
14
14
  spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
15
+ spec.metadata = {"rubygems_mfa_required" => "true"}
15
16
 
16
17
  github_url = "https://github.com/fnando/i18n-js"
17
18
  github_tree_url = "#{github_url}/tree/v#{spec.version}"
@@ -32,7 +32,7 @@ module I18nJS
32
32
  end
33
33
  end
34
34
 
35
- command do # rubocop:disable Metrics/BlockLength
35
+ command do
36
36
  set_defaults!
37
37
 
38
38
  ui.stdout_print("=> config file:", options[:config_file].inspect)
data/lib/i18n-js/cli.rb CHANGED
@@ -1,5 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "../i18n-js"
4
+ require_relative "cli/command"
5
+ require_relative "cli/ui"
6
+ require_relative "cli/init_command"
7
+ require_relative "cli/version_command"
8
+ require_relative "cli/export_command"
9
+
3
10
  module I18nJS
4
11
  class CLI
5
12
  attr_reader :ui
@@ -1,9 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- gem "listen"
4
- require "listen"
5
- require "i18n-js"
6
-
7
3
  module I18nJS
8
4
  class << self
9
5
  attr_accessor :started
@@ -16,6 +12,10 @@ module I18nJS
16
12
  return unless Rails.env.development?
17
13
  return if started
18
14
 
15
+ gem "listen"
16
+ require "listen"
17
+ require "i18n-js"
18
+
19
19
  self.started = true
20
20
 
21
21
  relative_paths =
@@ -43,7 +43,7 @@ module I18nJS
43
43
  @logger ||= ActiveSupport::TaggedLogging.new(Rails.logger)
44
44
  end
45
45
 
46
- def self.listener(config_file, locales_dir) # rubocop:disable Metrics/MethodLength
46
+ def self.listener(config_file, locales_dir)
47
47
  paths = [File.dirname(config_file), locales_dir]
48
48
 
49
49
  Listen.to(*paths) do |changed, added, removed|
@@ -58,6 +58,7 @@ module I18nJS
58
58
 
59
59
  debug(changes.map {|key, value| "#{key}=#{value.inspect}" }.join(", "))
60
60
 
61
+ ::I18n.backend.reload!
61
62
  I18nJS.call(config_file: config_file)
62
63
  end
63
64
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module I18nJS
4
- VERSION = "4.0.0.alpha1"
4
+ VERSION = "4.0.0.alpha2"
5
5
  end
data/lib/i18n-js.rb CHANGED
@@ -7,14 +7,8 @@ require "glob"
7
7
  require "fileutils"
8
8
  require "optparse"
9
9
 
10
- require_relative "./i18n-js/cli"
11
- require_relative "./i18n-js/cli/command"
12
- require_relative "./i18n-js/cli/ui"
13
- require_relative "./i18n-js/cli/init_command"
14
- require_relative "./i18n-js/cli/version_command"
15
- require_relative "./i18n-js/cli/export_command"
16
- require_relative "./i18n-js/schema"
17
- require_relative "./i18n-js/version"
10
+ require_relative "i18n-js/schema"
11
+ require_relative "i18n-js/version"
18
12
 
19
13
  module I18nJS
20
14
  MissingConfigError = Class.new(StandardError)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n-js
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.alpha1
4
+ version: 4.0.0.alpha2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-24 00:00:00.000000000 Z
11
+ date: 2021-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glob
@@ -193,12 +193,13 @@ homepage: https://github.com/fnando/i18n-js
193
193
  licenses:
194
194
  - MIT
195
195
  metadata:
196
+ rubygems_mfa_required: 'true'
196
197
  homepage_uri: https://github.com/fnando/i18n-js
197
198
  bug_tracker_uri: https://github.com/fnando/i18n-js/issues
198
- source_code_uri: https://github.com/fnando/i18n-js/tree/v4.0.0.alpha1
199
- changelog_uri: https://github.com/fnando/i18n-js/tree/v4.0.0.alpha1/CHANGELOG.md
200
- documentation_uri: https://github.com/fnando/i18n-js/tree/v4.0.0.alpha1/README.md
201
- license_uri: https://github.com/fnando/i18n-js/tree/v4.0.0.alpha1/LICENSE.md
199
+ source_code_uri: https://github.com/fnando/i18n-js/tree/v4.0.0.alpha2
200
+ changelog_uri: https://github.com/fnando/i18n-js/tree/v4.0.0.alpha2/CHANGELOG.md
201
+ documentation_uri: https://github.com/fnando/i18n-js/tree/v4.0.0.alpha2/README.md
202
+ license_uri: https://github.com/fnando/i18n-js/tree/v4.0.0.alpha2/LICENSE.md
202
203
  post_install_message:
203
204
  rdoc_options: []
204
205
  require_paths:
@@ -214,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
215
  - !ruby/object:Gem::Version
215
216
  version: 1.3.1
216
217
  requirements: []
217
- rubygems_version: 3.2.15
218
+ rubygems_version: 3.2.32
218
219
  signing_key:
219
220
  specification_version: 4
220
221
  summary: Export i18n translations and use them on JavaScript.