i18n_screwdriver 9.3 → 9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/i18n_screwdriver.rb +14 -0
- data/lib/i18n_screwdriver/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c793ace9b49c488207c0562c26366522a3ac9a3
|
4
|
+
data.tar.gz: 6e7c68c20696295a4b9d6be4f5416d04203f9e7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 014a343a55a9bef2e69754fe267e8ce989af1cbde36c362cb945f3318f989040cacc55907fb08025d1b8409263ae8a880f3d05ed33d3d8666cdad09d59441dd9
|
7
|
+
data.tar.gz: 9f9515957528dcfa2d2884edc595eb0faa81a839eeba1493b0558bb6c12437b46aa8b1267d16863f3cb2f646a60aabea5f7ffca26323a97a00f5754878a191e1
|
data/lib/i18n_screwdriver.rb
CHANGED
@@ -6,6 +6,12 @@ require "i18n_screwdriver/rails"
|
|
6
6
|
module I18nScrewdriver
|
7
7
|
Error = Class.new(StandardError)
|
8
8
|
|
9
|
+
class << self
|
10
|
+
attr_accessor :excluded_paths
|
11
|
+
end
|
12
|
+
|
13
|
+
self.excluded_paths = [%r{^tmp/}, %r{^node_modules/}]
|
14
|
+
|
9
15
|
def self.filename_for_locale(locale)
|
10
16
|
File.join("config", "locales", "application.#{locale}.yml")
|
11
17
|
end
|
@@ -93,12 +99,18 @@ module I18nScrewdriver
|
|
93
99
|
end
|
94
100
|
end
|
95
101
|
|
102
|
+
def self.excluded_path?(path)
|
103
|
+
excluded_paths.detect{ |excluded_path| path =~ excluded_path }
|
104
|
+
end
|
105
|
+
|
96
106
|
def self.gather_translations
|
97
107
|
texts = []
|
98
108
|
symbols = []
|
99
109
|
|
100
110
|
Dir.glob("**/*.{haml,erb,slim,rb}").each do |file|
|
101
111
|
next unless File.file?(file)
|
112
|
+
next if excluded_path?(file)
|
113
|
+
puts "Scanning #{file}..."
|
102
114
|
input = File.read(file)
|
103
115
|
texts.concat(grab_texts_to_be_translated(input))
|
104
116
|
symbols.concat(grab_symbols_to_be_translated(input))
|
@@ -106,6 +118,8 @@ module I18nScrewdriver
|
|
106
118
|
|
107
119
|
Dir.glob("**/*.{js,coffee,hamlc,ejs,erb}").each do |file|
|
108
120
|
next unless File.file?(file)
|
121
|
+
next if excluded_path?(file)
|
122
|
+
puts "Scanning #{file}..."
|
109
123
|
input = File.read(file)
|
110
124
|
texts.concat(grab_js_texts_to_be_translated(input))
|
111
125
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n_screwdriver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '9.
|
4
|
+
version: '9.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Miesel
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-11-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
version: '0'
|
104
104
|
requirements: []
|
105
105
|
rubyforge_project: i18n_screwdriver
|
106
|
-
rubygems_version: 2.6.
|
106
|
+
rubygems_version: 2.6.14
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: make translating with rails i18n fun again
|