llt 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/llt/cli.rb +10 -0
- data/lib/llt/version.rb +1 -1
- data/spec/lib/llt/api_spec.rb +30 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62710f0c89880ccd7ea5906dc3c553dd85ff2dfb
|
4
|
+
data.tar.gz: 65320e4fe2d42a0c6391f5f7566807c70d143029
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dec6e021f7f3369ac6b2cfc17401516c5616aff0b69fab2f1a6dc6370505a047bed998bf9d987fb190987419538d6cb574efb4650cd62d393e1486fb2e6531ff
|
7
|
+
data.tar.gz: 62b2d5ef2a0f21e553427618c19c48af2b0c4b6b2c80d918117e987444d8e8206db188b034c3d868137d8aec0088af446d8e248fc13e88291322702a7bceb9d7
|
data/lib/llt/cli.rb
CHANGED
@@ -12,11 +12,14 @@ module LLT
|
|
12
12
|
desc: 'path to Tomcat directory to copy the war file to'
|
13
13
|
method_option :restart_server, type: :boolean, aliases: '-r',
|
14
14
|
desc: 'Works only when -t is given'
|
15
|
+
method_option :seed, aliases: '-s',
|
16
|
+
desc: 'Reseeds the prometheus stem database'
|
15
17
|
def deploy
|
16
18
|
inside BASE_DIR do
|
17
19
|
update_gems(llt_gems)
|
18
20
|
run_warbler
|
19
21
|
deploy_to_tomcat(options)
|
22
|
+
reseed_prometheus_stems(options)
|
20
23
|
end
|
21
24
|
end
|
22
25
|
|
@@ -55,6 +58,13 @@ module LLT
|
|
55
58
|
system("#{bin_dir}/shutdown.sh")
|
56
59
|
system("#{bin_dir}/startup.sh")
|
57
60
|
end
|
61
|
+
|
62
|
+
def reseed_prometheus_stems(options)
|
63
|
+
if options[:seed]
|
64
|
+
say_status(:seeding, 'Prometheus stem database')
|
65
|
+
system('rake db:prometheus:seed')
|
66
|
+
end
|
67
|
+
end
|
58
68
|
end
|
59
69
|
end
|
60
70
|
end
|
data/lib/llt/version.rb
CHANGED
data/spec/lib/llt/api_spec.rb
CHANGED
@@ -60,6 +60,36 @@ describe "main api" do
|
|
60
60
|
body.should =~ /<w s_n="2" n="2">est<\/w>/
|
61
61
|
body.should =~ /<pc s_n="2" n="3">\.<\/pc>/
|
62
62
|
end
|
63
|
+
|
64
|
+
it "doesn't break with complex embedded xml elements" do
|
65
|
+
txt = { text: 'Arma <l no="1.1"> virumque cano. Troiae </l> qui primus.' }
|
66
|
+
params = {
|
67
|
+
indexing: true,
|
68
|
+
recursive: true,
|
69
|
+
inline: true,
|
70
|
+
xml: true,
|
71
|
+
}.merge(txt)
|
72
|
+
|
73
|
+
get '/segtok', params,
|
74
|
+
{"HTTP_ACCEPT" => "application/xml"}
|
75
|
+
last_response.should be_ok
|
76
|
+
body = last_response.body
|
77
|
+
elements = [
|
78
|
+
'<w s_n="1" n="1">Arma</w>',
|
79
|
+
'<l no="1.1">',
|
80
|
+
'<w s_n="1" n="2">-que</w>',
|
81
|
+
'<w s_n="1" n="3">virum</w>',
|
82
|
+
'<w s_n="1" n="4">cano</w>',
|
83
|
+
'<pc s_n="1" n="5">.</pc>',
|
84
|
+
'<w s_n="2" n="1">Troiae</w>',
|
85
|
+
'</l>',
|
86
|
+
'<w s_n="2" n="2">qui</w>',
|
87
|
+
'<w s_n="2" n="3">primus</w>',
|
88
|
+
'<pc s_n="2" n="4">.</pc>'
|
89
|
+
]
|
90
|
+
|
91
|
+
body.should =~ /#{elements.join}/
|
92
|
+
end
|
63
93
|
end
|
64
94
|
end
|
65
95
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: llt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LFDM, christof, lichtr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|