logaling-command 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +5 -3
- data/CHANGES +3 -0
- data/Gemfile +2 -1
- data/lib/logaling/command/application.rb +2 -1
- data/lib/logaling/command/version.rb +2 -1
- data/logaling-command.gemspec +2 -3
- data/spec/logaling/command_spec.rb +55 -55
- data/spec/logaling/glossary_db_spec.rb +1 -1
- data/spec/logaling/glossary_spec.rb +17 -17
- data/spec/logaling/project_spec.rb +3 -3
- data/spec/logaling/repository_spec.rb +15 -15
- metadata +33 -55
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c847b98f21e2cae19d43aa80ab8784e6d54b6a75
|
4
|
+
data.tar.gz: 47031fb36e0f527405af4580a4f3c21d364300c2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 94f5300625a54855af7f8c06a4393443b3dc6dc800cda2a93dd29085b1a3fad47b3c4a6fbb22fa09fd09d0f0ebdc165804e279c32e64edf18341e92c1f901fb8
|
7
|
+
data.tar.gz: b07f1cb7240975cab898091a7e216fd9dad1fd17610f8a27cb37d5ae09270a09e14380d99278e6624cc2248caaceebddae49ce806e26117188967d5db9e0097b
|
data/.travis.yml
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
notifications:
|
2
2
|
recipients:
|
3
|
-
-
|
4
|
-
- adzuki34@gmail.com
|
3
|
+
- groonga-commit@lists.sourceforge.jp
|
5
4
|
language: ruby
|
6
5
|
rvm:
|
7
6
|
- 1.9.3
|
7
|
+
- 2.0
|
8
|
+
- 2.1
|
9
|
+
- 2.2
|
8
10
|
before_install:
|
9
|
-
- curl https://
|
11
|
+
- curl --silent --location https://github.com/groonga/groonga/raw/master/data/travis/setup.sh | sh
|
data/CHANGES
CHANGED
data/Gemfile
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#
|
2
|
+
# Copyright (C) 2015 Kouhei Sutou <kou@clear-code.com>
|
2
3
|
# Copyright (C) 2011 Miho SUZUKI
|
3
4
|
#
|
4
5
|
# This program is free software: you can redistribute it and/or modify
|
@@ -14,7 +15,7 @@
|
|
14
15
|
# You should have received a copy of the GNU General Public License
|
15
16
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
17
|
|
17
|
-
source "
|
18
|
+
source "https://rubygems.org"
|
18
19
|
|
19
20
|
# Specify your gem's dependencies in logaling-command.gemspec
|
20
21
|
gemspec
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
|
+
# Copyright (C) 2015 Kouhei Sutou <kou@clear-code.com>
|
3
4
|
# Copyright (C) 2011 Miho SUZUKI
|
4
5
|
#
|
5
6
|
# This program is free software: you can redistribute it and/or modify
|
@@ -16,7 +17,7 @@
|
|
16
17
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17
18
|
|
18
19
|
require 'thor'
|
19
|
-
require 'rainbow'
|
20
|
+
require 'rainbow/ext/string'
|
20
21
|
require 'pathname'
|
21
22
|
require "logaling/repository"
|
22
23
|
require "logaling/project"
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
|
+
# Copyright (C) 2015 Kouhei Sutou <kou@clear-code.com>
|
3
4
|
# Copyright (C) 2011 Miho SUZUKI
|
4
5
|
#
|
5
6
|
# This program is free software: you can redistribute it and/or modify
|
@@ -17,6 +18,6 @@
|
|
17
18
|
|
18
19
|
module Logaling
|
19
20
|
module Command
|
20
|
-
VERSION = "0.2.
|
21
|
+
VERSION = "0.2.4"
|
21
22
|
end
|
22
23
|
end
|
data/logaling-command.gemspec
CHANGED
@@ -26,8 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
s.homepage = "http://logaling.github.com/"
|
27
27
|
s.summary = %q{A command line interface for logaling.}
|
28
28
|
s.description = %q{A command line interface for logaling.}
|
29
|
-
|
30
|
-
s.rubyforge_project = "logaling-command"
|
29
|
+
s.license = "GPLv3+"
|
31
30
|
|
32
31
|
s.files = `git ls-files`.split("\n")
|
33
32
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -39,7 +38,7 @@ Gem::Specification.new do |s|
|
|
39
38
|
s.add_runtime_dependency 'thor', ['>= 0.14.6']
|
40
39
|
s.add_runtime_dependency 'bundler', ['>= 1.0']
|
41
40
|
s.add_runtime_dependency 'rroonga', ['>= 2.1.0']
|
42
|
-
s.add_runtime_dependency 'rainbow'
|
41
|
+
s.add_runtime_dependency 'rainbow', ['>= 2.0.0']
|
43
42
|
s.add_runtime_dependency 'nokogiri'
|
44
43
|
s.add_runtime_dependency 'activesupport'
|
45
44
|
|
@@ -43,7 +43,7 @@ describe Logaling::Command::Application do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
it 'print message \"<.logaling path> already exists.\"' do
|
46
|
-
@stdout.
|
46
|
+
expect(@stdout).to include "#{logaling_config} already exists.\n"
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
@@ -54,12 +54,12 @@ describe Logaling::Command::Application do
|
|
54
54
|
end
|
55
55
|
|
56
56
|
it 'should create .logaling' do
|
57
|
-
File.
|
57
|
+
expect(File).to be_exist(logaling_config)
|
58
58
|
end
|
59
59
|
|
60
60
|
it 'should register .logaling as project' do
|
61
|
-
File.
|
62
|
-
Dir[File.join(logaling_home, "projects", "*")].size.
|
61
|
+
expect(File).to be_exist(target_project_path)
|
62
|
+
expect(Dir[File.join(logaling_home, "projects", "*")].size).to eq(@n_projects + 1)
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
@@ -70,12 +70,12 @@ describe Logaling::Command::Application do
|
|
70
70
|
end
|
71
71
|
|
72
72
|
it 'should create .logaling' do
|
73
|
-
File.
|
73
|
+
expect(File).to be_exist(logaling_config)
|
74
74
|
end
|
75
75
|
|
76
76
|
it 'should not register .logaling as project' do
|
77
|
-
File.
|
78
|
-
Dir[File.join(logaling_home, "projects", "*")].size.
|
77
|
+
expect(File).not_to be_exist(target_project_path)
|
78
|
+
expect(Dir[File.join(logaling_home, "projects", "*")].size).to eq(@n_projects)
|
79
79
|
end
|
80
80
|
end
|
81
81
|
end
|
@@ -87,18 +87,18 @@ describe Logaling::Command::Application do
|
|
87
87
|
end
|
88
88
|
|
89
89
|
context "when can not find .logaling" do
|
90
|
-
before
|
90
|
+
before do
|
91
91
|
FileUtils.rm_rf(logaling_config)
|
92
92
|
base_options["glossary"] = nil
|
93
93
|
@stdout = capture(:stdout) {command.register}
|
94
94
|
end
|
95
95
|
|
96
96
|
it 'register nothing' do
|
97
|
-
Dir[File.join(logaling_home, "projects", "*")].size.
|
97
|
+
expect(Dir[File.join(logaling_home, "projects", "*")].size).to eq(@n_projects)
|
98
98
|
end
|
99
99
|
|
100
100
|
it "print message \"Do 'loga register' at project directory.\"" do
|
101
|
-
@stdout.
|
101
|
+
expect(@stdout).to be_include "Do 'loga register' at project directory."
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
@@ -109,8 +109,8 @@ describe Logaling::Command::Application do
|
|
109
109
|
end
|
110
110
|
|
111
111
|
it 'register .logaling as project' do
|
112
|
-
File.
|
113
|
-
Dir[File.join(logaling_home, "projects", "*")].size.
|
112
|
+
expect(File).to be_exist(target_project_path)
|
113
|
+
expect(Dir[File.join(logaling_home, "projects", "*")].size).to eq(@n_projects + 1)
|
114
114
|
end
|
115
115
|
end
|
116
116
|
end
|
@@ -132,7 +132,7 @@ describe Logaling::Command::Application do
|
|
132
132
|
end
|
133
133
|
|
134
134
|
it "should print message 'Do \'loga unregister\' at ...'" do
|
135
|
-
@stdout.
|
135
|
+
expect(@stdout).to be_include "Do 'loga unregister' at project directory."
|
136
136
|
end
|
137
137
|
end
|
138
138
|
|
@@ -143,7 +143,7 @@ describe Logaling::Command::Application do
|
|
143
143
|
@stdout = capture(:stdout) {command.unregister}
|
144
144
|
end
|
145
145
|
it 'should unregister symlink' do
|
146
|
-
Dir[File.join(logaling_home, "projects", "*")].size.
|
146
|
+
expect(Dir[File.join(logaling_home, "projects", "*")].size).to eq(@n_projects)
|
147
147
|
end
|
148
148
|
end
|
149
149
|
end
|
@@ -158,8 +158,8 @@ describe Logaling::Command::Application do
|
|
158
158
|
end
|
159
159
|
|
160
160
|
it 'unregister .logaling' do
|
161
|
-
File.
|
162
|
-
Dir[File.join(logaling_home, "projects", "*")].size.
|
161
|
+
expect(File).not_to be_exist(target_project_path)
|
162
|
+
expect(Dir[File.join(logaling_home, "projects", "*")].size).to eq(@n_projects)
|
163
163
|
end
|
164
164
|
end
|
165
165
|
|
@@ -171,7 +171,7 @@ describe Logaling::Command::Application do
|
|
171
171
|
end
|
172
172
|
|
173
173
|
it "print message \"<glossary name> is not yet registered.\"" do
|
174
|
-
@stdout.
|
174
|
+
expect(@stdout).to eq("spec is not yet registered.\n")
|
175
175
|
end
|
176
176
|
end
|
177
177
|
end
|
@@ -191,10 +191,10 @@ describe Logaling::Command::Application do
|
|
191
191
|
end
|
192
192
|
|
193
193
|
it 'should be indexed' do
|
194
|
-
@stdout.
|
195
|
-
@stdout.
|
196
|
-
@stdout.
|
197
|
-
@stdout.
|
194
|
+
expect(@stdout).to include "spec"
|
195
|
+
expect(@stdout).to include "スペック"
|
196
|
+
expect(@stdout).to include "# 備考"
|
197
|
+
expect(@stdout).not_to include "now index spec..."
|
198
198
|
end
|
199
199
|
end
|
200
200
|
|
@@ -206,7 +206,7 @@ describe Logaling::Command::Application do
|
|
206
206
|
end
|
207
207
|
|
208
208
|
it 'should print message and failed index' do
|
209
|
-
@stdout.
|
209
|
+
expect(@stdout).to include "Input existing directory as logaling-home."
|
210
210
|
end
|
211
211
|
end
|
212
212
|
end
|
@@ -224,7 +224,7 @@ describe Logaling::Command::Application do
|
|
224
224
|
end
|
225
225
|
|
226
226
|
it 'should overwrite target-language' do
|
227
|
-
|
227
|
+
is_expected.to include "--target-language fr"
|
228
228
|
end
|
229
229
|
end
|
230
230
|
|
@@ -235,7 +235,7 @@ describe Logaling::Command::Application do
|
|
235
235
|
end
|
236
236
|
|
237
237
|
it 'should overwrite source-language' do
|
238
|
-
|
238
|
+
is_expected.to include "--source-language ja"
|
239
239
|
end
|
240
240
|
end
|
241
241
|
|
@@ -249,7 +249,7 @@ describe Logaling::Command::Application do
|
|
249
249
|
subject { File.read(global_config) }
|
250
250
|
|
251
251
|
it 'should create {logaling_home}/config and write target-language' do
|
252
|
-
|
252
|
+
is_expected.to include "--target-language ja"
|
253
253
|
end
|
254
254
|
|
255
255
|
after do
|
@@ -266,7 +266,7 @@ describe Logaling::Command::Application do
|
|
266
266
|
end
|
267
267
|
|
268
268
|
it 'should overwrite target-language' do
|
269
|
-
|
269
|
+
is_expected.to include "--target-language fr"
|
270
270
|
end
|
271
271
|
end
|
272
272
|
|
@@ -281,7 +281,7 @@ describe Logaling::Command::Application do
|
|
281
281
|
subject { File.read(global_config) }
|
282
282
|
|
283
283
|
it 'should create {logaling_home}/config and write target-language' do
|
284
|
-
|
284
|
+
is_expected.to include "--target-language ja"
|
285
285
|
end
|
286
286
|
|
287
287
|
after do
|
@@ -301,11 +301,11 @@ describe Logaling::Command::Application do
|
|
301
301
|
subject { YAML::load_file(glossary_source_path).find{|h| h["source_term"] == "spec" }}
|
302
302
|
|
303
303
|
it "glossary yaml should contain that term" do
|
304
|
-
subject["target_term"].
|
304
|
+
expect(subject["target_term"]).to eq("テスト")
|
305
305
|
end
|
306
306
|
|
307
307
|
it "term should note have note" do
|
308
|
-
subject["note"].
|
308
|
+
expect(subject["note"]).to eq("")
|
309
309
|
end
|
310
310
|
end
|
311
311
|
|
@@ -318,11 +318,11 @@ describe Logaling::Command::Application do
|
|
318
318
|
subject { YAML::load_file(glossary_source_path).find{|h| h["source_term"] == "spec" }}
|
319
319
|
|
320
320
|
it "glossary yaml should contain that term" do
|
321
|
-
subject["target_term"].
|
321
|
+
expect(subject["target_term"]).to eq("テスト")
|
322
322
|
end
|
323
323
|
|
324
324
|
it "term should have note" do
|
325
|
-
subject["note"].
|
325
|
+
expect(subject["note"]).to eq("備考")
|
326
326
|
end
|
327
327
|
end
|
328
328
|
|
@@ -344,8 +344,8 @@ describe Logaling::Command::Application do
|
|
344
344
|
end
|
345
345
|
|
346
346
|
it "should use global config's TARGET-LANGUAGE" do
|
347
|
-
@stdout.
|
348
|
-
@stdout.
|
347
|
+
expect(@stdout).to include "test-logaling"
|
348
|
+
expect(@stdout).to include "設定ファイルのテスト"
|
349
349
|
end
|
350
350
|
end
|
351
351
|
|
@@ -368,7 +368,7 @@ describe Logaling::Command::Application do
|
|
368
368
|
end
|
369
369
|
|
370
370
|
it "term's target_term should be updated" do
|
371
|
-
@yaml.
|
371
|
+
expect(@yaml).to eq({"source_term"=>"spec", "target_term"=>"スペック", "note"=>"備考"})
|
372
372
|
end
|
373
373
|
end
|
374
374
|
|
@@ -379,7 +379,7 @@ describe Logaling::Command::Application do
|
|
379
379
|
end
|
380
380
|
|
381
381
|
it "term's target_term should not be updated" do
|
382
|
-
@yaml.
|
382
|
+
expect(@yaml).to eq({"source_term"=>"spec", "target_term"=>"テスト", "note"=>"備考"})
|
383
383
|
end
|
384
384
|
end
|
385
385
|
|
@@ -390,7 +390,7 @@ describe Logaling::Command::Application do
|
|
390
390
|
end
|
391
391
|
|
392
392
|
it "should update note" do
|
393
|
-
@yaml.
|
393
|
+
expect(@yaml).to eq({"source_term"=>"spec", "target_term"=>"テスト", "note"=>"備考だけ書き換え"})
|
394
394
|
end
|
395
395
|
end
|
396
396
|
end
|
@@ -408,9 +408,9 @@ describe Logaling::Command::Application do
|
|
408
408
|
end
|
409
409
|
|
410
410
|
it 'succeed at find by term without command.index' do
|
411
|
-
@stdout.
|
412
|
-
@stdout.
|
413
|
-
@stdout.
|
411
|
+
expect(@stdout).to include "spec"
|
412
|
+
expect(@stdout).to include "スペック"
|
413
|
+
expect(@stdout).to include "# 備考"
|
414
414
|
end
|
415
415
|
end
|
416
416
|
end
|
@@ -431,7 +431,7 @@ describe Logaling::Command::Application do
|
|
431
431
|
end
|
432
432
|
|
433
433
|
it 'should delete the term' do
|
434
|
-
@stdout.
|
434
|
+
expect(@stdout).not_to include "スペックろがりん"
|
435
435
|
end
|
436
436
|
end
|
437
437
|
|
@@ -444,7 +444,7 @@ describe Logaling::Command::Application do
|
|
444
444
|
end
|
445
445
|
|
446
446
|
it 'should delete the term' do
|
447
|
-
@stdout.
|
447
|
+
expect(@stdout).not_to include "スペックろがりん"
|
448
448
|
end
|
449
449
|
end
|
450
450
|
|
@@ -455,9 +455,9 @@ describe Logaling::Command::Application do
|
|
455
455
|
end
|
456
456
|
|
457
457
|
it "should print usage" do
|
458
|
-
@stdout.
|
459
|
-
@stdout.
|
460
|
-
@stdout.
|
458
|
+
expect(@stdout).to include "There are duplicate terms in glossary."
|
459
|
+
expect(@stdout).to include "loga delete [SOURCE_TERM] --force"
|
460
|
+
expect(@stdout).to include "loga delete [SOURCE_TERM] [TARGET_TERM]"
|
461
461
|
end
|
462
462
|
end
|
463
463
|
|
@@ -475,8 +475,8 @@ describe Logaling::Command::Application do
|
|
475
475
|
end
|
476
476
|
|
477
477
|
it 'should delete bilingual pairs' do
|
478
|
-
@stdout.
|
479
|
-
@stdout.
|
478
|
+
expect(@stdout).not_to include "用語1"
|
479
|
+
expect(@stdout).not_to include "用語2"
|
480
480
|
end
|
481
481
|
end
|
482
482
|
end
|
@@ -501,8 +501,8 @@ describe Logaling::Command::Application do
|
|
501
501
|
end
|
502
502
|
|
503
503
|
it 'should show translation list' do
|
504
|
-
@stdout.
|
505
|
-
@stdout.
|
504
|
+
expect(@stdout).to include "スペックてすと"
|
505
|
+
expect(@stdout).not_to include "テストろがりん"
|
506
506
|
end
|
507
507
|
end
|
508
508
|
|
@@ -526,7 +526,7 @@ describe Logaling::Command::Application do
|
|
526
526
|
end
|
527
527
|
|
528
528
|
it 'should show annotated word' do
|
529
|
-
@stdout.
|
529
|
+
expect(@stdout).to include "スペックてすと2"
|
530
530
|
end
|
531
531
|
|
532
532
|
context 'after annotation removed' do
|
@@ -536,7 +536,7 @@ describe Logaling::Command::Application do
|
|
536
536
|
end
|
537
537
|
|
538
538
|
it 'should not show annotated word' do
|
539
|
-
@stdout.
|
539
|
+
expect(@stdout).not_to include "スペックてすと1"
|
540
540
|
end
|
541
541
|
end
|
542
542
|
end
|
@@ -549,7 +549,7 @@ describe Logaling::Command::Application do
|
|
549
549
|
end
|
550
550
|
|
551
551
|
it 'should not show un-annotated word' do
|
552
|
-
@stdout.
|
552
|
+
expect(@stdout).not_to include "スペックてすと1"
|
553
553
|
end
|
554
554
|
end
|
555
555
|
end
|
@@ -567,7 +567,7 @@ describe Logaling::Command::Application do
|
|
567
567
|
end
|
568
568
|
|
569
569
|
it 'should list glossaries' do
|
570
|
-
@stdout.
|
570
|
+
expect(@stdout).to include "spec"
|
571
571
|
end
|
572
572
|
end
|
573
573
|
|
@@ -580,7 +580,7 @@ describe Logaling::Command::Application do
|
|
580
580
|
end
|
581
581
|
|
582
582
|
it 'should not include unregistered glossary' do
|
583
|
-
@stdout.
|
583
|
+
expect(@stdout).not_to include "spec"
|
584
584
|
end
|
585
585
|
end
|
586
586
|
end
|
@@ -599,7 +599,7 @@ describe Logaling::Command::Application do
|
|
599
599
|
end
|
600
600
|
|
601
601
|
it 'should copy from original glossary' do
|
602
|
-
@yaml.
|
602
|
+
expect(@yaml).to eq({"source_term"=>"spec logaling", "target_term"=>"すぺっくろがりん", "note"=>""})
|
603
603
|
end
|
604
604
|
end
|
605
605
|
|
@@ -609,7 +609,7 @@ describe Logaling::Command::Application do
|
|
609
609
|
end
|
610
610
|
|
611
611
|
it 'should not copy glossary' do
|
612
|
-
@stdout.
|
612
|
+
expect(@stdout).to include "already exists"
|
613
613
|
end
|
614
614
|
end
|
615
615
|
end
|
@@ -46,7 +46,7 @@ module Logaling
|
|
46
46
|
it 'glossary yaml should have that bilingual pair' do
|
47
47
|
yaml = YAML::load_file(glossary_source_absolute_path)
|
48
48
|
term = yaml.index({"source_term"=>"spec", "target_term"=>"スペック", "note"=>"テストスペック"})
|
49
|
-
term.
|
49
|
+
expect(term).not_to be_nil
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
@@ -58,7 +58,7 @@ module Logaling
|
|
58
58
|
it "should create the glossary and add term" do
|
59
59
|
yaml = YAML::load_file(glossary_source_absolute_path)
|
60
60
|
term = yaml.index({"source_term"=>"test", "target_term"=>"テスト", "note"=>"テスト"})
|
61
|
-
term.
|
61
|
+
expect(term).not_to be_nil
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
@@ -70,19 +70,19 @@ module Logaling
|
|
70
70
|
|
71
71
|
context 'with new-terget-term show existing bilingual pair' do
|
72
72
|
it {
|
73
|
-
|
73
|
+
expect { glossary.update("user", "ユーザー", "ユーザ", "やっぱりユーザー") }.to raise_error(Logaling::TermError)
|
74
74
|
}
|
75
75
|
end
|
76
76
|
|
77
77
|
context 'with source-term show not existing bilingual pair' do
|
78
78
|
it {
|
79
|
-
|
79
|
+
expect { glossary.update("use", "ユーザ", "ユーザー", "やっぱりユーザー") }.to raise_error(Logaling::TermError)
|
80
80
|
}
|
81
81
|
end
|
82
82
|
|
83
83
|
context 'with target-term show not existing bilingual pair' do
|
84
84
|
it {
|
85
|
-
|
85
|
+
expect { glossary.update("user", "ユー", "ユーザー", "やっぱりユーザー") }.to raise_error(Logaling::TermError)
|
86
86
|
}
|
87
87
|
end
|
88
88
|
|
@@ -94,7 +94,7 @@ module Logaling
|
|
94
94
|
it 'should clear note' do
|
95
95
|
yaml = YAML::load_file(glossary_source_absolute_path)
|
96
96
|
term = yaml.index({"source_term"=>"user", "target_term"=>"ユーザ", "note"=>""})
|
97
|
-
term.
|
97
|
+
expect(term).not_to be_nil
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
@@ -104,7 +104,7 @@ module Logaling
|
|
104
104
|
end
|
105
105
|
|
106
106
|
it {
|
107
|
-
|
107
|
+
expect { glossary.update("user", "ゆーざ", "ユーザ", "") }.to raise_error(Logaling::TermError)
|
108
108
|
}
|
109
109
|
end
|
110
110
|
end
|
@@ -119,8 +119,8 @@ module Logaling
|
|
119
119
|
end
|
120
120
|
|
121
121
|
it 'should delete the bilingual pair' do
|
122
|
-
@result.any?{|term| term[:source_term] == "delete_logaling" && term[:target_term] == "てすと2"}.
|
123
|
-
@result.any?{|term| term[:source_term] == "delete_logaling" && term[:target_term] == "てすと1"}.
|
122
|
+
expect(@result.any?{|term| term[:source_term] == "delete_logaling" && term[:target_term] == "てすと2"}).to be_truthy
|
123
|
+
expect(@result.any?{|term| term[:source_term] == "delete_logaling" && term[:target_term] == "てすと1"}).to be_falsey
|
124
124
|
end
|
125
125
|
end
|
126
126
|
|
@@ -130,7 +130,7 @@ module Logaling
|
|
130
130
|
end
|
131
131
|
|
132
132
|
it {
|
133
|
-
|
133
|
+
expect { glossary.delete("user_logaling", "ユーザー") }.to raise_error(Logaling::TermError)
|
134
134
|
}
|
135
135
|
end
|
136
136
|
end
|
@@ -142,7 +142,7 @@ module Logaling
|
|
142
142
|
end
|
143
143
|
|
144
144
|
it {
|
145
|
-
|
145
|
+
expect { glossary.delete_all("usr_logaling") }.to raise_error(Logaling::TermError)
|
146
146
|
}
|
147
147
|
end
|
148
148
|
|
@@ -155,7 +155,7 @@ module Logaling
|
|
155
155
|
end
|
156
156
|
|
157
157
|
it 'should delete the term' do
|
158
|
-
@result.any?{|term| term[:source_term] == "user_logaling" && term[:target_term] == "ユーザ"}.
|
158
|
+
expect(@result.any?{|term| term[:source_term] == "user_logaling" && term[:target_term] == "ユーザ"}).to be_falsey
|
159
159
|
end
|
160
160
|
end
|
161
161
|
|
@@ -170,14 +170,14 @@ module Logaling
|
|
170
170
|
end
|
171
171
|
|
172
172
|
it {
|
173
|
-
|
173
|
+
expect { glossary.delete_all("user_logaling") }.to raise_error(Logaling::TermError)
|
174
174
|
}
|
175
175
|
|
176
176
|
it "should delete terms when force option is true" do
|
177
|
-
@result.any?{|term| term == {"source_term"=>"delete_logaling", "target_term"=>"てすと1", "note"=>"備考"}}.
|
178
|
-
@result.any?{|term| term == {"source_term"=>"delete_logaling", "target_term"=>"てすと2", "note"=>"備考"}}.
|
179
|
-
@result.any?{|term| term == {"source_term"=>"user_logaling", "target_term"=>"ユーザ1", "note"=>"備考"}}.
|
180
|
-
@result.any?{|term| term == {"source_term"=>"user_logaling", "target_term"=>"ユーザ2", "note"=>"備考"}}.
|
177
|
+
expect(@result.any?{|term| term == {"source_term"=>"delete_logaling", "target_term"=>"てすと1", "note"=>"備考"}}).to be_falsey
|
178
|
+
expect(@result.any?{|term| term == {"source_term"=>"delete_logaling", "target_term"=>"てすと2", "note"=>"備考"}}).to be_falsey
|
179
|
+
expect(@result.any?{|term| term == {"source_term"=>"user_logaling", "target_term"=>"ユーザ1", "note"=>"備考"}}).to be_truthy
|
180
|
+
expect(@result.any?{|term| term == {"source_term"=>"user_logaling", "target_term"=>"ユーザ2", "note"=>"備考"}}).to be_truthy
|
181
181
|
end
|
182
182
|
end
|
183
183
|
end
|
@@ -37,7 +37,7 @@ module Logaling
|
|
37
37
|
|
38
38
|
context "project has only 'en-ja' glossary" do
|
39
39
|
it "should be include 'en-ja' glossary" do
|
40
|
-
project.glossaries.map(&:to_s).
|
40
|
+
expect(project.glossaries.map(&:to_s)).to be_include "spec.en.ja"
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
@@ -48,7 +48,7 @@ module Logaling
|
|
48
48
|
|
49
49
|
it "should be include 'en-ja' 'fr-ja' glossaries" do
|
50
50
|
%w(spec.en.ja spec.fr.ja).each do |glossary_name|
|
51
|
-
project.glossaries.map(&:to_s).
|
51
|
+
expect(project.glossaries.map(&:to_s)).to be_include glossary_name
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
@@ -59,7 +59,7 @@ module Logaling
|
|
59
59
|
end
|
60
60
|
|
61
61
|
it "should count as one glossary" do
|
62
|
-
project.glossaries.size.
|
62
|
+
expect(project.glossaries.size).to eq(1)
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
@@ -38,13 +38,13 @@ module Logaling
|
|
38
38
|
before do
|
39
39
|
glossary.add("user-logaling", "ユーザ", "ユーザーではない")
|
40
40
|
glossary.add("user-logaling", "ユーザー", "")
|
41
|
-
File.
|
41
|
+
allow(File).to receive_message_chain(:mtime).and_return(Time.now - 1)
|
42
42
|
repository.index
|
43
43
|
@terms = repository.lookup("user-logaling", glossary)
|
44
44
|
end
|
45
45
|
|
46
46
|
it 'succeed at find by term' do
|
47
|
-
@terms.size.
|
47
|
+
expect(@terms.size).to eq(2)
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
@@ -54,7 +54,7 @@ module Logaling
|
|
54
54
|
glossary.add("user-logaling", "ユーザ", "ユーザーではない")
|
55
55
|
glossary.add("user-logaling test", "ユーザーてすと", "")
|
56
56
|
glossary.add("ゆーざ", "test user-logaling test text", "")
|
57
|
-
File.
|
57
|
+
allow(File).to receive_message_chain(:mtime).and_return(Time.now - 1)
|
58
58
|
repository.index
|
59
59
|
options = {"dictionary"=>true}
|
60
60
|
@terms = repository.lookup("user-logaling", glossary, options)
|
@@ -88,7 +88,7 @@ module Logaling
|
|
88
88
|
end
|
89
89
|
|
90
90
|
it 'succeed at find by term' do
|
91
|
-
@terms.
|
91
|
+
expect(@terms).to eq(@result)
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
@@ -97,7 +97,7 @@ module Logaling
|
|
97
97
|
before do
|
98
98
|
glossary.add("user", "ユーザ", "ユーザーではない")
|
99
99
|
glossary.add("user-logaling", "ユーザ", "ユーザーと迷い中 #{annotation_word}")
|
100
|
-
File.
|
100
|
+
allow(File).to receive_message_chain(:mtime).and_return(Time.now - 1)
|
101
101
|
repository.index
|
102
102
|
options = {"fixed" => true}
|
103
103
|
@terms = repository.lookup("user", glossary, options)
|
@@ -113,7 +113,7 @@ module Logaling
|
|
113
113
|
end
|
114
114
|
|
115
115
|
it 'succeed at find by term without include annotation' do
|
116
|
-
@terms.
|
116
|
+
expect(@terms).to eq(@result)
|
117
117
|
end
|
118
118
|
|
119
119
|
end
|
@@ -129,7 +129,7 @@ module Logaling
|
|
129
129
|
end
|
130
130
|
|
131
131
|
it 'succeed at find by term' do
|
132
|
-
@terms.size.
|
132
|
+
expect(@terms.size).to eq(2)
|
133
133
|
end
|
134
134
|
|
135
135
|
after do
|
@@ -153,7 +153,7 @@ module Logaling
|
|
153
153
|
end
|
154
154
|
|
155
155
|
it 'glossaries should be indexed' do
|
156
|
-
@terms.size.
|
156
|
+
expect(@terms.size).to eq(1)
|
157
157
|
end
|
158
158
|
|
159
159
|
after do
|
@@ -170,7 +170,7 @@ module Logaling
|
|
170
170
|
end
|
171
171
|
|
172
172
|
it 'glossaries should be indexed' do
|
173
|
-
@terms.size.
|
173
|
+
expect(@terms.size).to eq(1)
|
174
174
|
end
|
175
175
|
|
176
176
|
after do
|
@@ -187,7 +187,7 @@ module Logaling
|
|
187
187
|
end
|
188
188
|
|
189
189
|
it 'glossaries should be indexed' do
|
190
|
-
@terms.size.
|
190
|
+
expect(@terms.size).to eq(1)
|
191
191
|
end
|
192
192
|
|
193
193
|
after do
|
@@ -214,7 +214,7 @@ module Logaling
|
|
214
214
|
end
|
215
215
|
|
216
216
|
it "should not be indexed on db" do
|
217
|
-
@ret.
|
217
|
+
expect(@ret).to be_falsey
|
218
218
|
end
|
219
219
|
end
|
220
220
|
|
@@ -228,7 +228,7 @@ module Logaling
|
|
228
228
|
end
|
229
229
|
|
230
230
|
it "should be indexed on db" do
|
231
|
-
@ret.
|
231
|
+
expect(@ret).to be_truthy
|
232
232
|
end
|
233
233
|
end
|
234
234
|
after do
|
@@ -253,16 +253,16 @@ module Logaling
|
|
253
253
|
end
|
254
254
|
|
255
255
|
it "should remove personal project" do
|
256
|
-
@projects.size.
|
256
|
+
expect(@projects.size).to eq(1)
|
257
257
|
end
|
258
258
|
end
|
259
259
|
|
260
260
|
context "when target personal project not exist" do
|
261
261
|
it "should raise Logaling::GlossaryNotFound" do
|
262
262
|
@name = rm_glossary_name + "foo"
|
263
|
-
|
263
|
+
expect{
|
264
264
|
repository.remove_personal_project(@name, rm_source_language, rm_target_language)
|
265
|
-
}.
|
265
|
+
}.to raise_error(Logaling::GlossaryNotFound)
|
266
266
|
end
|
267
267
|
end
|
268
268
|
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logaling-command
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- SHIMADA Koji
|
@@ -13,134 +12,118 @@ authors:
|
|
13
12
|
autorequire:
|
14
13
|
bindir: bin
|
15
14
|
cert_chain: []
|
16
|
-
date:
|
15
|
+
date: 2015-01-15 00:00:00.000000000 Z
|
17
16
|
dependencies:
|
18
17
|
- !ruby/object:Gem::Dependency
|
19
18
|
name: thor
|
20
19
|
requirement: !ruby/object:Gem::Requirement
|
21
|
-
none: false
|
22
20
|
requirements:
|
23
|
-
- -
|
21
|
+
- - ">="
|
24
22
|
- !ruby/object:Gem::Version
|
25
23
|
version: 0.14.6
|
26
24
|
type: :runtime
|
27
25
|
prerelease: false
|
28
26
|
version_requirements: !ruby/object:Gem::Requirement
|
29
|
-
none: false
|
30
27
|
requirements:
|
31
|
-
- -
|
28
|
+
- - ">="
|
32
29
|
- !ruby/object:Gem::Version
|
33
30
|
version: 0.14.6
|
34
31
|
- !ruby/object:Gem::Dependency
|
35
32
|
name: bundler
|
36
33
|
requirement: !ruby/object:Gem::Requirement
|
37
|
-
none: false
|
38
34
|
requirements:
|
39
|
-
- -
|
35
|
+
- - ">="
|
40
36
|
- !ruby/object:Gem::Version
|
41
37
|
version: '1.0'
|
42
38
|
type: :runtime
|
43
39
|
prerelease: false
|
44
40
|
version_requirements: !ruby/object:Gem::Requirement
|
45
|
-
none: false
|
46
41
|
requirements:
|
47
|
-
- -
|
42
|
+
- - ">="
|
48
43
|
- !ruby/object:Gem::Version
|
49
44
|
version: '1.0'
|
50
45
|
- !ruby/object:Gem::Dependency
|
51
46
|
name: rroonga
|
52
47
|
requirement: !ruby/object:Gem::Requirement
|
53
|
-
none: false
|
54
48
|
requirements:
|
55
|
-
- -
|
49
|
+
- - ">="
|
56
50
|
- !ruby/object:Gem::Version
|
57
51
|
version: 2.1.0
|
58
52
|
type: :runtime
|
59
53
|
prerelease: false
|
60
54
|
version_requirements: !ruby/object:Gem::Requirement
|
61
|
-
none: false
|
62
55
|
requirements:
|
63
|
-
- -
|
56
|
+
- - ">="
|
64
57
|
- !ruby/object:Gem::Version
|
65
58
|
version: 2.1.0
|
66
59
|
- !ruby/object:Gem::Dependency
|
67
60
|
name: rainbow
|
68
61
|
requirement: !ruby/object:Gem::Requirement
|
69
|
-
none: false
|
70
62
|
requirements:
|
71
|
-
- -
|
63
|
+
- - ">="
|
72
64
|
- !ruby/object:Gem::Version
|
73
|
-
version:
|
65
|
+
version: 2.0.0
|
74
66
|
type: :runtime
|
75
67
|
prerelease: false
|
76
68
|
version_requirements: !ruby/object:Gem::Requirement
|
77
|
-
none: false
|
78
69
|
requirements:
|
79
|
-
- -
|
70
|
+
- - ">="
|
80
71
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
72
|
+
version: 2.0.0
|
82
73
|
- !ruby/object:Gem::Dependency
|
83
74
|
name: nokogiri
|
84
75
|
requirement: !ruby/object:Gem::Requirement
|
85
|
-
none: false
|
86
76
|
requirements:
|
87
|
-
- -
|
77
|
+
- - ">="
|
88
78
|
- !ruby/object:Gem::Version
|
89
79
|
version: '0'
|
90
80
|
type: :runtime
|
91
81
|
prerelease: false
|
92
82
|
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
none: false
|
94
83
|
requirements:
|
95
|
-
- -
|
84
|
+
- - ">="
|
96
85
|
- !ruby/object:Gem::Version
|
97
86
|
version: '0'
|
98
87
|
- !ruby/object:Gem::Dependency
|
99
88
|
name: activesupport
|
100
89
|
requirement: !ruby/object:Gem::Requirement
|
101
|
-
none: false
|
102
90
|
requirements:
|
103
|
-
- -
|
91
|
+
- - ">="
|
104
92
|
- !ruby/object:Gem::Version
|
105
93
|
version: '0'
|
106
94
|
type: :runtime
|
107
95
|
prerelease: false
|
108
96
|
version_requirements: !ruby/object:Gem::Requirement
|
109
|
-
none: false
|
110
97
|
requirements:
|
111
|
-
- -
|
98
|
+
- - ">="
|
112
99
|
- !ruby/object:Gem::Version
|
113
100
|
version: '0'
|
114
101
|
- !ruby/object:Gem::Dependency
|
115
102
|
name: rake
|
116
103
|
requirement: !ruby/object:Gem::Requirement
|
117
|
-
none: false
|
118
104
|
requirements:
|
119
|
-
- -
|
105
|
+
- - ">="
|
120
106
|
- !ruby/object:Gem::Version
|
121
107
|
version: '0'
|
122
108
|
type: :development
|
123
109
|
prerelease: false
|
124
110
|
version_requirements: !ruby/object:Gem::Requirement
|
125
|
-
none: false
|
126
111
|
requirements:
|
127
|
-
- -
|
112
|
+
- - ">="
|
128
113
|
- !ruby/object:Gem::Version
|
129
114
|
version: '0'
|
130
115
|
- !ruby/object:Gem::Dependency
|
131
116
|
name: rspec
|
132
117
|
requirement: !ruby/object:Gem::Requirement
|
133
|
-
none: false
|
134
118
|
requirements:
|
135
|
-
- -
|
119
|
+
- - ">="
|
136
120
|
- !ruby/object:Gem::Version
|
137
121
|
version: '0'
|
138
122
|
type: :development
|
139
123
|
prerelease: false
|
140
124
|
version_requirements: !ruby/object:Gem::Requirement
|
141
|
-
none: false
|
142
125
|
requirements:
|
143
|
-
- -
|
126
|
+
- - ">="
|
144
127
|
- !ruby/object:Gem::Version
|
145
128
|
version: '0'
|
146
129
|
description: A command line interface for logaling.
|
@@ -155,9 +138,9 @@ executables:
|
|
155
138
|
extensions: []
|
156
139
|
extra_rdoc_files: []
|
157
140
|
files:
|
158
|
-
- .gitignore
|
159
|
-
- .rspec
|
160
|
-
- .travis.yml
|
141
|
+
- ".gitignore"
|
142
|
+
- ".rspec"
|
143
|
+
- ".travis.yml"
|
161
144
|
- CHANGES
|
162
145
|
- COPYING
|
163
146
|
- Gemfile
|
@@ -199,33 +182,28 @@ files:
|
|
199
182
|
- spec/logaling/repository_spec.rb
|
200
183
|
- spec/spec_helper.rb
|
201
184
|
homepage: http://logaling.github.com/
|
202
|
-
licenses:
|
185
|
+
licenses:
|
186
|
+
- GPLv3+
|
187
|
+
metadata: {}
|
203
188
|
post_install_message:
|
204
189
|
rdoc_options: []
|
205
190
|
require_paths:
|
206
191
|
- lib
|
207
192
|
required_ruby_version: !ruby/object:Gem::Requirement
|
208
|
-
none: false
|
209
193
|
requirements:
|
210
|
-
- -
|
194
|
+
- - ">="
|
211
195
|
- !ruby/object:Gem::Version
|
212
196
|
version: 1.9.2
|
213
197
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
214
|
-
none: false
|
215
198
|
requirements:
|
216
|
-
- -
|
199
|
+
- - ">="
|
217
200
|
- !ruby/object:Gem::Version
|
218
201
|
version: '0'
|
219
202
|
requirements: []
|
220
|
-
rubyforge_project:
|
221
|
-
rubygems_version:
|
203
|
+
rubyforge_project:
|
204
|
+
rubygems_version: 2.2.2
|
222
205
|
signing_key:
|
223
|
-
specification_version:
|
206
|
+
specification_version: 4
|
224
207
|
summary: A command line interface for logaling.
|
225
|
-
test_files:
|
226
|
-
|
227
|
-
- spec/logaling/glossary_db_spec.rb
|
228
|
-
- spec/logaling/glossary_spec.rb
|
229
|
-
- spec/logaling/project_spec.rb
|
230
|
-
- spec/logaling/repository_spec.rb
|
231
|
-
- spec/spec_helper.rb
|
208
|
+
test_files: []
|
209
|
+
has_rdoc:
|