i18n-tasks-angular 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ab373421982dd36f5b95e445628414863b050982
4
+ data.tar.gz: bade4d2ceee6feb313292022d53a5f4de2988ddc
5
+ SHA512:
6
+ metadata.gz: cb0633338b4394cf46be4cbc45852b182b64772dbb497a2a0877625b1f61e053e40b5984866156272eb81acc8174a4fca37251d385cddd3db847f4568b3e5666
7
+ data.tar.gz: e9c7cfa2dd75943baf6979a9da522e0bbb7965423b31380c30ac85ae7fde1887f114878343964066e441b3764909525e9bb242f8fda9302ad4ddc8a9c8676981
@@ -0,0 +1,23 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .idea
5
+ .config
6
+ .yardoc
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
23
+ .DS_Store
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --format progress
3
+ --require spec_helper
@@ -0,0 +1,17 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.3
3
+ Exclude:
4
+ - bin/**/*
5
+ - db/**/*
6
+ - .gemspec/**/*
7
+ - .bundle/**/*
8
+ - vendor/**/*
9
+ - script/**/*
10
+ AlignParameters:
11
+ Enabled: false
12
+ LineLength:
13
+ Enabled: false
14
+ Style/MultilineOperationIndentation:
15
+ EnforcedStyle: indented
16
+ Style/Documentation:
17
+ Enabled: false
@@ -0,0 +1 @@
1
+ i18n-tasks-angular
@@ -0,0 +1 @@
1
+ 2.3.1
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+ source 'https://rubygems.org'
3
+ gemspec
@@ -0,0 +1,91 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ i18n-tasks-angular (0.1.0)
5
+ i18n-tasks
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activesupport (5.0.0.1)
11
+ concurrent-ruby (~> 1.0, >= 1.0.2)
12
+ i18n (~> 0.7)
13
+ minitest (~> 5.1)
14
+ tzinfo (~> 1.1)
15
+ ast (2.3.0)
16
+ coderay (1.1.1)
17
+ concurrent-ruby (1.0.2)
18
+ diff-lcs (1.2.5)
19
+ easy_translate (0.5.0)
20
+ json
21
+ thread
22
+ thread_safe
23
+ erubis (2.7.0)
24
+ highline (1.7.8)
25
+ i18n (0.7.0)
26
+ i18n-tasks (0.9.5)
27
+ activesupport (>= 4.0.2)
28
+ ast (>= 2.1.0)
29
+ easy_translate (>= 0.5.0)
30
+ erubis
31
+ highline (>= 1.7.3)
32
+ i18n
33
+ parser (>= 2.2.3.0)
34
+ term-ansicolor (>= 1.3.2)
35
+ terminal-table (>= 1.5.1)
36
+ json (2.0.2)
37
+ method_source (0.8.2)
38
+ minitest (5.9.0)
39
+ parser (2.3.1.2)
40
+ ast (~> 2.2)
41
+ powerpack (0.1.1)
42
+ pry (0.10.4)
43
+ coderay (~> 1.1.0)
44
+ method_source (~> 0.8.1)
45
+ slop (~> 3.4)
46
+ rainbow (2.1.0)
47
+ rake (11.2.2)
48
+ rspec (3.5.0)
49
+ rspec-core (~> 3.5.0)
50
+ rspec-expectations (~> 3.5.0)
51
+ rspec-mocks (~> 3.5.0)
52
+ rspec-core (3.5.2)
53
+ rspec-support (~> 3.5.0)
54
+ rspec-expectations (3.5.0)
55
+ diff-lcs (>= 1.2.0, < 2.0)
56
+ rspec-support (~> 3.5.0)
57
+ rspec-mocks (3.5.0)
58
+ diff-lcs (>= 1.2.0, < 2.0)
59
+ rspec-support (~> 3.5.0)
60
+ rspec-support (3.5.0)
61
+ rubocop (0.42.0)
62
+ parser (>= 2.3.1.1, < 3.0)
63
+ powerpack (~> 0.1)
64
+ rainbow (>= 1.99.1, < 3.0)
65
+ ruby-progressbar (~> 1.7)
66
+ unicode-display_width (~> 1.0, >= 1.0.1)
67
+ ruby-progressbar (1.8.1)
68
+ slop (3.6.0)
69
+ term-ansicolor (1.3.2)
70
+ tins (~> 1.0)
71
+ terminal-table (1.6.0)
72
+ thread (0.2.2)
73
+ thread_safe (0.3.5)
74
+ tins (1.12.0)
75
+ tzinfo (1.2.2)
76
+ thread_safe (~> 0.1)
77
+ unicode-display_width (1.1.0)
78
+
79
+ PLATFORMS
80
+ ruby
81
+
82
+ DEPENDENCIES
83
+ bundler
84
+ i18n-tasks-angular!
85
+ pry
86
+ rake
87
+ rspec
88
+ rubocop
89
+
90
+ BUNDLED WITH
91
+ 1.12.1
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Hightower, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,24 @@
1
+ # i18n-tasks-angular
2
+ i18n-tasks-angular extends i18n-tasks with scanners for angular-translate and angular-translate-once
3
+
4
+ This gem provides scanners for key usages, such as:
5
+
6
+ - $translate.instant
7
+ - translate=, translate-attr-\*=
8
+ - translate-once=, translate-once-\*=
9
+ - | pluralize
10
+ - %translate-plural=
11
+
12
+ ## Installation
13
+
14
+ Add i18n-tasks-angular to the Gemfile:
15
+
16
+ ```ruby
17
+ gem 'i18n-tasks-angular'
18
+ ```
19
+
20
+ You need to add `<% require "i18n/tasks/angular" %>` at the top of your `i18n-tasks.yml.erb`.
21
+
22
+ ## Usage
23
+
24
+ Run `i18n-tasks` to get the list of all the tasks with short descriptions.
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
3
+ require 'i18n/tasks/angular/version'
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'i18n-tasks-angular'
7
+ s.version = I18n::Tasks::Angular::VERSION
8
+ s.authors = ['Tomasz Pajor']
9
+ s.email = ['tomek@polishgeeks.com']
10
+ s.license = 'MIT'
11
+ s.summary = <<-TEXT
12
+ Manage localization and translation with the awesome power of static analysis)
13
+ TEXT
14
+ s.description = <<-TEXT
15
+ i18n-tasks helps you find and manage missing and unused translations that are created with angular-translate and angular-translate-once.
16
+ TEXT
17
+ s.homepage = 'https://github.com/hightower/i18n-tasks-angular'
18
+
19
+ s.files = `git ls-files -z`.split("\x0")
20
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
21
+ s.require_paths = %w(lib)
22
+
23
+ s.add_dependency 'i18n-tasks'
24
+ s.add_development_dependency 'bundler'
25
+ s.add_development_dependency 'rake'
26
+ s.add_development_dependency 'rspec'
27
+ s.add_development_dependency 'rubocop'
28
+ s.add_development_dependency 'pry'
29
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+ require 'i18n/tasks'
3
+
4
+ require 'i18n/tasks/angular/version'
5
+ require 'i18n/tasks/angular/scanners/translate_abstract'
6
+
7
+ require 'i18n/tasks/angular/scanners/translate'
8
+ I18n::Tasks.add_scanner 'I18n::Tasks::Angular::Scanners::Translate', only: %w(*.haml *.coffee *.js)
9
+
10
+ require 'i18n/tasks/angular/scanners/translate_once'
11
+ I18n::Tasks.add_scanner 'I18n::Tasks::Angular::Scanners::TranslateOnce', only: %w(*.haml *.coffee *.js)
12
+
13
+ require 'i18n/tasks/angular/scanners/translate_instant'
14
+ I18n::Tasks.add_scanner 'I18n::Tasks::Angular::Scanners::TranslateInstant', only: %w(*.coffee *.js)
15
+
16
+ require 'i18n/tasks/angular/scanners/translate_plural'
17
+ I18n::Tasks.add_scanner 'I18n::Tasks::Angular::Scanners::TranslatePlural', only: %w(*.haml)
18
+
19
+ require 'i18n/tasks/angular/scanners/translate_pluralize'
20
+ I18n::Tasks.add_scanner 'I18n::Tasks::Angular::Scanners::TranslatePluralize', only: %w(*.haml)
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+ module I18n
3
+ module Tasks
4
+ module Angular
5
+ module Scanners
6
+ class Translate < TranslateAbstract
7
+ def pattern
8
+ /translate(?:-(?!once)[\-a-z]+)?=[\"\']([^\"\'\{\}]+)[\"\']/
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+ require 'i18n/tasks/scanners/file_scanner'
3
+
4
+ module I18n
5
+ module Tasks
6
+ module Angular
7
+ module Scanners
8
+ class TranslateAbstract < I18n::Tasks::Scanners::FileScanner
9
+ include I18n::Tasks::Scanners::RelativeKeys
10
+ include I18n::Tasks::Scanners::OccurrenceFromPosition
11
+ include I18n::Tasks::Scanners::RubyKeyLiterals
12
+
13
+ def scan_file(path)
14
+ keys = []
15
+ text = read_file(path)
16
+ text.scan(pattern) do |match|
17
+ src_pos = Regexp.last_match.offset(0).first
18
+ key = strip_literal(match[0])
19
+ location = occurrence_from_position(path, text, src_pos, raw_key: key)
20
+ next unless valid_key?(key)
21
+ keys << [key, location]
22
+ end
23
+ keys
24
+ end
25
+
26
+ def pattern
27
+ raise NotImplemented
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+ module I18n
3
+ module Tasks
4
+ module Angular
5
+ module Scanners
6
+ class TranslateInstant < TranslateAbstract
7
+ def pattern
8
+ /\$translate\.instant\s*\(?\s*[\"\']([^\"\'\{\}\#]+)[\"\']/
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+ module I18n
3
+ module Tasks
4
+ module Angular
5
+ module Scanners
6
+ class TranslateOnce < TranslateAbstract
7
+ def pattern
8
+ /translate-once(?:-[a-z]+)?=[\"\']([^\"\'\{\}]+)[\"\']/
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+ module I18n
3
+ module Tasks
4
+ module Angular
5
+ module Scanners
6
+ class TranslatePlural < TranslateAbstract
7
+ def pattern
8
+ /%translate-plural\s*\(.*prefix\s*=\s*[\'\"]([^\'\"]+)[\'\"]/
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+ module I18n
3
+ module Tasks
4
+ module Angular
5
+ module Scanners
6
+ class TranslatePluralize < TranslateAbstract
7
+ def pattern
8
+ /pluralize\s*:\s*[\'\"]([^\"\']+)[\"\']/
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+ module I18n
3
+ module Tasks
4
+ module Angular
5
+ VERSION = '0.1.0'
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+ require 'spec_helper'
3
+
4
+ RSpec.describe 'TranslateInstant' do
5
+ subject { I18n::Tasks::Angular::Scanners::TranslateInstant.new }
6
+
7
+ describe '#pattern' do
8
+ context 'with bracket' do
9
+ context 'double quotes' do
10
+ let(:text) { '$translate.instant("activity_items.approval.archived")' }
11
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(1) }
12
+ it { expect(text.scan(subject.pattern).flatten.first).to eq('activity_items.approval.archived') }
13
+ end
14
+
15
+ context 'single quotes' do
16
+ let(:text) { "$translate.instant('activity_items.approval.archived')" }
17
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(1) }
18
+ it { expect(text.scan(subject.pattern).flatten.first).to eq('activity_items.approval.archived') }
19
+ end
20
+
21
+ context 'javascript' do
22
+ let(:text) { '$translate.instant(element.getAttribute("step-title-translation-key"))' }
23
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(0) }
24
+ end
25
+ end
26
+
27
+ context 'without bracket' do
28
+ context 'double quotes' do
29
+ let(:text) { '$translate.instant "activity_items.approval.archived"' }
30
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(1) }
31
+ it { expect(text.scan(subject.pattern).flatten.first).to eq('activity_items.approval.archived') }
32
+ end
33
+
34
+ context 'single quotes' do
35
+ let(:text) { "$translate.instant 'activity_items.approval.archived'" }
36
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(1) }
37
+ it { expect(text.scan(subject.pattern).flatten.first).to eq('activity_items.approval.archived') }
38
+ end
39
+
40
+ context 'javascript' do
41
+ context 'double quotes' do
42
+ let(:text) { '$translate.instant element.getAttribute("step-title-translation-key")' }
43
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(0) }
44
+ end
45
+
46
+ context 'single quotes' do
47
+ let(:text) { "$translate.instant element.getAttribute('step-title-translation-key')" }
48
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(0) }
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+ require 'spec_helper'
3
+
4
+ RSpec.describe 'TranslateOnce' do
5
+ subject { I18n::Tasks::Angular::Scanners::TranslateOnce.new }
6
+
7
+ describe '#pattern' do
8
+ context 'double quotes' do
9
+ let(:text) { '.all-caps-label(translate-once="activerecord.attributes.proposal_term.deal_type")' }
10
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(1) }
11
+ it { expect(text.scan(subject.pattern).flatten.first).to eq('activerecord.attributes.proposal_term.deal_type') }
12
+ end
13
+
14
+ context 'single quotes' do
15
+ let(:text) { ".all-caps-label(translate-once='activerecord.attributes.proposal_term.deal_type')" }
16
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(1) }
17
+ it { expect(text.scan(subject.pattern).flatten.first).to eq('activerecord.attributes.proposal_term.deal_type') }
18
+ end
19
+
20
+ context 'translate-once-alt' do
21
+ let(:text) { ".all-caps-label(translate-once-alt='activerecord.attributes.proposal_term.deal_type')" }
22
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(1) }
23
+ it { expect(text.scan(subject.pattern).flatten.first).to eq('activerecord.attributes.proposal_term.deal_type') }
24
+ end
25
+
26
+ context 'translate-once-placeholder' do
27
+ let(:text) { ".all-caps-label(translate-once-placeholder='activerecord.attributes.proposal_term.deal_type')" }
28
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(1) }
29
+ it { expect(text.scan(subject.pattern).flatten.first).to eq('activerecord.attributes.proposal_term.deal_type') }
30
+ end
31
+
32
+ context 'translate-once-title' do
33
+ let(:text) { ".all-caps-label(translate-once-title='activerecord.attributes.proposal_term.deal_type')" }
34
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(1) }
35
+ it { expect(text.scan(subject.pattern).flatten.first).to eq('activerecord.attributes.proposal_term.deal_type') }
36
+ end
37
+
38
+ context 'translate-once-value' do
39
+ let(:text) { ".all-caps-label(translate-once-title='activerecord.attributes.proposal_term.deal_type')" }
40
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(1) }
41
+ it { expect(text.scan(subject.pattern).flatten.first).to eq('activerecord.attributes.proposal_term.deal_type') }
42
+ end
43
+
44
+ context 'javascript' do
45
+ context 'tenary operator' do
46
+ let(:text) do
47
+ <<-TEXT
48
+ %input.search(type="search"
49
+ ng-model="filter.keyword"
50
+ ng-model-options="{debounce: 100}"
51
+ translate-once-placeholder="{{ ctrl.displayTenantLensOptions() ? 'stacking_plan.filter.placeholder_tenants' : 'stacking_plan.filter.placeholder_no_tenants' }}"
52
+ ng-change="ctrl.keywordChanged()")
53
+ TEXT
54
+ end
55
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(0) }
56
+ end
57
+
58
+ context 'function' do
59
+ let(:text) { '%span(translate-once="{{ translateKey }}")' }
60
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(0) }
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+ require 'spec_helper'
3
+
4
+ RSpec.describe 'TranslatePlural' do
5
+ subject { I18n::Tasks::Angular::Scanners::TranslatePlural.new }
6
+
7
+ describe '#pattern' do
8
+ context 'double quotes' do
9
+ let(:text) { '%translate-plural(prefix="account_settings.web_session_count" count="editable.web_session_count")' }
10
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(1) }
11
+ it { expect(text.scan(subject.pattern).flatten.first).to eq('account_settings.web_session_count') }
12
+ end
13
+
14
+ context 'single quotes' do
15
+ let(:text) { "%translate-plural(prefix='account_settings.web_session_count' count='editable.web_session_count')" }
16
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(1) }
17
+ it { expect(text.scan(subject.pattern).flatten.first).to eq('account_settings.web_session_count') }
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+ require 'spec_helper'
3
+
4
+ RSpec.describe 'TranslatePluralize' do
5
+ subject { I18n::Tasks::Angular::Scanners::TranslatePluralize.new }
6
+
7
+ describe '#pattern' do
8
+ context 'double quotes' do
9
+ let(:text) { '%div {{ editable.web_session_count | pluralize: "account_settings.web_session" }}' }
10
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(1) }
11
+ it { expect(text.scan(subject.pattern).flatten.first).to eq('account_settings.web_session') }
12
+ end
13
+
14
+ context 'single quotes' do
15
+ let(:text) { "%div {{ editable.web_session_count | pluralize: 'account_settings.web_session' }}" }
16
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(1) }
17
+ it { expect(text.scan(subject.pattern).flatten.first).to eq('account_settings.web_session') }
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+ require 'spec_helper'
3
+
4
+ RSpec.describe 'Translate' do
5
+ subject { I18n::Tasks::Angular::Scanners::Translate.new }
6
+
7
+ describe '#pattern' do
8
+ context 'double quotes' do
9
+ let(:text) { '.all-caps-label(translate="activerecord.attributes.proposal_term.deal_type")' }
10
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(1) }
11
+ it { expect(text.scan(subject.pattern).flatten.first).to eq('activerecord.attributes.proposal_term.deal_type') }
12
+ end
13
+
14
+ context 'single quotes' do
15
+ let(:text) { ".all-caps-label(translate='activerecord.attributes.proposal_term.deal_type')" }
16
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(1) }
17
+ it { expect(text.scan(subject.pattern).flatten.first).to eq('activerecord.attributes.proposal_term.deal_type') }
18
+ end
19
+
20
+ context 'translate-attr-placeholder' do
21
+ let(:text) { '%input(type="text" name="end_date" required translate translate-attr-placeholder="date.formats.short.placeholder"' }
22
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(1) }
23
+ it { expect(text.scan(subject.pattern).flatten.first).to eq('date.formats.short.placeholder') }
24
+ end
25
+
26
+ context 'translate-key' do
27
+ let(:text) { '%ht-submit(translate-key="tenant_rep.deals.new.invite_action")' }
28
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(1) }
29
+ it { expect(text.scan(subject.pattern).flatten.first).to eq('tenant_rep.deals.new.invite_action') }
30
+ end
31
+
32
+ context 'javascript' do
33
+ context 'tenary operator' do
34
+ let(:text) { '%span(translate="{{ ctrl.displayTenantLensOptions() ? \'stacking_plan.filter.placeholder_tenants\' : \'stacking_plan.filter.placeholder_no_tenants\' }}")' }
35
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(0) }
36
+ end
37
+
38
+ context 'function' do
39
+ let(:text) { '%span(translate="{{ translateKey }}")' }
40
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(0) }
41
+ end
42
+ end
43
+
44
+ context 'translate-once-placeholder' do
45
+ let(:text) { '%input(type="text" name="end_date" required translate-once-placeholder="date.formats.short.placeholder"' }
46
+ it { expect(text.scan(subject.pattern).flatten.size).to eq(0) }
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
4
+
5
+ require 'i18n/tasks/angular'
6
+
7
+ RSpec.configure do |config|
8
+ config.expect_with :rspec do |expectations|
9
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
10
+ end
11
+
12
+ config.mock_with :rspec do |mocks|
13
+ mocks.verify_partial_doubles = true
14
+ end
15
+
16
+ config.default_formatter = 'doc' if config.files_to_run.one?
17
+
18
+ config.shared_context_metadata_behavior = :apply_to_host_groups
19
+ config.disable_monkey_patching!
20
+ config.warnings = true
21
+ config.profile_examples = 10
22
+ config.order = :random
23
+ Kernel.srand config.seed
24
+ end
metadata ADDED
@@ -0,0 +1,161 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: i18n-tasks-angular
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Tomasz Pajor
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-08-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: i18n-tasks
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: 'i18n-tasks helps you find and manage missing and unused translations
98
+ that are created with angular-translate and angular-translate-once.
99
+
100
+ '
101
+ email:
102
+ - tomek@polishgeeks.com
103
+ executables: []
104
+ extensions: []
105
+ extra_rdoc_files: []
106
+ files:
107
+ - ".gitignore"
108
+ - ".rspec"
109
+ - ".rubocop.yml"
110
+ - ".ruby-gemset"
111
+ - ".ruby-version"
112
+ - Gemfile
113
+ - Gemfile.lock
114
+ - LICENSE
115
+ - README.md
116
+ - i18n-tasks-angular.gemspec
117
+ - lib/i18n/tasks/angular.rb
118
+ - lib/i18n/tasks/angular/scanners/translate.rb
119
+ - lib/i18n/tasks/angular/scanners/translate_abstract.rb
120
+ - lib/i18n/tasks/angular/scanners/translate_instant.rb
121
+ - lib/i18n/tasks/angular/scanners/translate_once.rb
122
+ - lib/i18n/tasks/angular/scanners/translate_plural.rb
123
+ - lib/i18n/tasks/angular/scanners/translate_pluralize.rb
124
+ - lib/i18n/tasks/angular/version.rb
125
+ - spec/scanners/translate_instant_spec.rb
126
+ - spec/scanners/translate_once_spec.rb
127
+ - spec/scanners/translate_plural_spec.rb
128
+ - spec/scanners/translate_pluralize_spec.rb
129
+ - spec/scanners/translate_spec.rb
130
+ - spec/spec_helper.rb
131
+ homepage: https://github.com/hightower/i18n-tasks-angular
132
+ licenses:
133
+ - MIT
134
+ metadata: {}
135
+ post_install_message:
136
+ rdoc_options: []
137
+ require_paths:
138
+ - lib
139
+ required_ruby_version: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ version: '0'
144
+ required_rubygems_version: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ version: '0'
149
+ requirements: []
150
+ rubyforge_project:
151
+ rubygems_version: 2.5.1
152
+ signing_key:
153
+ specification_version: 4
154
+ summary: Manage localization and translation with the awesome power of static analysis)
155
+ test_files:
156
+ - spec/scanners/translate_instant_spec.rb
157
+ - spec/scanners/translate_once_spec.rb
158
+ - spec/scanners/translate_plural_spec.rb
159
+ - spec/scanners/translate_pluralize_spec.rb
160
+ - spec/scanners/translate_spec.rb
161
+ - spec/spec_helper.rb