wovnrb 0.2.11 → 0.2.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -12
- data/lib/wovnrb/store.rb +0 -5
- data/lib/wovnrb/version.rb +1 -1
- data/test/lib/store_test.rb +2 -2
- data/test/test_helper.rb +0 -1
- data/wovnrb.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fc52fb60a465751418467b657248cce6527730a
|
4
|
+
data.tar.gz: de3eccb1b4e2c8382652cf7675cf50971ea7196f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 876f71f5dc7db5453ef567389f94bd8ad3d9aa90f918b406dac1f87cb220b48b5782c1a5d2b19a4f5ebc3e3097b11158c5c0f9e1e1b852dc1a512b4618016a42
|
7
|
+
data.tar.gz: 1ee33b277b6517dfdd6bbb0bcdc00996905a46af903402f5eceff30cf690d28c7ec55bbe45a0b2739e3c4b3767739deef4956ae750eb9a1ed049ecd1174b5686
|
data/README.md
CHANGED
@@ -38,8 +38,7 @@ Insert the following into either config/application.rb or config/environments/.
|
|
38
38
|
...
|
39
39
|
|
40
40
|
config.wovnrb = {
|
41
|
-
:user_token => '2Wle3'
|
42
|
-
:secret_key => 'secret',
|
41
|
+
:user_token => '2Wle3'
|
43
42
|
}
|
44
43
|
|
45
44
|
...
|
@@ -55,8 +54,7 @@ Insert the following into either the Application File or config.ru.
|
|
55
54
|
require 'wovnrb'
|
56
55
|
|
57
56
|
use Wovnrb::Interceptor, {
|
58
|
-
:user_token => '2Wle3'
|
59
|
-
:secret_key => 'secret',
|
57
|
+
:user_token => '2Wle3'
|
60
58
|
}
|
61
59
|
|
62
60
|
...
|
@@ -71,7 +69,6 @@ WOVN.io Ruby Library's valid parameters are as follows.
|
|
71
69
|
Parameter Name | Required | Default Setting
|
72
70
|
-------------- | -------- | ----------------
|
73
71
|
user_token | yes | ''
|
74
|
-
secret_key | yes | ''
|
75
72
|
url_pattern | yes | 'path'
|
76
73
|
query | | []
|
77
74
|
default_lang | yes | 'en'
|
@@ -80,11 +77,7 @@ default_lang | yes | 'en'
|
|
80
77
|
|
81
78
|
Set your WOVN.io Account's user token. This parameter is required.
|
82
79
|
|
83
|
-
### 2.2.
|
84
|
-
|
85
|
-
This parameter is in development; it is not currently used. However, it is a required parameter, so ensure to set a value for it.
|
86
|
-
|
87
|
-
### 2.3. url_pattern
|
80
|
+
### 2.2. url_pattern
|
88
81
|
|
89
82
|
The Library works in the Ruby Application by adding new URL's to be translated. You can set the type of url with the url_pattern parameter. There are 3 types that can be set.
|
90
83
|
|
@@ -98,7 +91,7 @@ parameters | Translated page's URL | Notes
|
|
98
91
|
|
99
92
|
https://wovn.io/contact
|
100
93
|
|
101
|
-
### 2.
|
94
|
+
### 2.3. query
|
102
95
|
|
103
96
|
WOVN.io ignores query parameters when searching translated page. If you want to add query parameter to translated page's URL, you should configure "query" parameter. (You need to configure WOVN.io too)
|
104
97
|
|
@@ -112,7 +105,7 @@ If the default_lang is 'en', and the query is set to 'os', the above URL will be
|
|
112
105
|
|
113
106
|
https://wovn.io/contact?os=mac
|
114
107
|
|
115
|
-
### 2.
|
108
|
+
### 2.4. default_lang
|
116
109
|
|
117
110
|
This sets the Ruby application's default language. The default value is English ('en').
|
118
111
|
|
data/lib/wovnrb/store.rb
CHANGED
@@ -22,7 +22,6 @@ module Wovnrb
|
|
22
22
|
@settings =
|
23
23
|
{
|
24
24
|
'user_token' => '',
|
25
|
-
'secret_key' => '',
|
26
25
|
'log_path' => 'log/wovn_error.log',
|
27
26
|
'ignore_paths' => [],
|
28
27
|
'ignore_globs' => [],
|
@@ -53,10 +52,6 @@ module Wovnrb
|
|
53
52
|
valid = false
|
54
53
|
errors.push("User token #{settings['user_token']} is not valid.")
|
55
54
|
end
|
56
|
-
if !settings.has_key?('secret_key') || settings['secret_key'].length == 0 #|| settings['secret_key'].length < 5 || settings['secret_key'].length > 6
|
57
|
-
valid = false
|
58
|
-
errors.push("Secret key #{settings['secret_key']} is not valid.")
|
59
|
-
end
|
60
55
|
if settings.has_key?('ignore_paths') && !settings['ignore_paths'].kind_of?(Array)
|
61
56
|
valid = false
|
62
57
|
errors.push("Ignore Paths #{settings['ignore_paths']} should be Array.")
|
data/lib/wovnrb/version.rb
CHANGED
data/test/lib/store_test.rb
CHANGED
@@ -41,7 +41,7 @@ module Wovnrb
|
|
41
41
|
valid = store.valid_settings?
|
42
42
|
|
43
43
|
assert_equal(false, valid)
|
44
|
-
assert_equal(['User token is not valid.'
|
44
|
+
assert_equal(['User token is not valid.'], mock.errors)
|
45
45
|
end
|
46
46
|
|
47
47
|
def test_settings_ignore_paths
|
@@ -73,7 +73,7 @@ module Wovnrb
|
|
73
73
|
store.settings({'ignore_paths' => 'aaaa'})
|
74
74
|
|
75
75
|
assert_equal(false, store.valid_settings?)
|
76
|
-
assert_equal(['User token is not valid.', '
|
76
|
+
assert_equal(['User token is not valid.', 'Ignore Paths aaaa should be Array.'], mock.errors)
|
77
77
|
end
|
78
78
|
|
79
79
|
def test_settings_ignore_glob_injection
|
data/test/test_helper.rb
CHANGED
data/wovnrb.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
#spec.extensions = %w[ext/dom/extconf.rb]
|
26
26
|
#spec.extensions = spec.files.grep(%r{/extconf\.rb$})
|
27
27
|
|
28
|
-
spec.add_dependency "nokogumbo", "1.3.0"
|
28
|
+
spec.add_dependency "nokogumbo", ">= 1.3.0"
|
29
29
|
spec.add_dependency "nokogiri", "< 1.6.8.1"
|
30
30
|
spec.add_dependency "activesupport", "< 5"
|
31
31
|
spec.add_dependency "lz4-ruby"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wovnrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Sandford
|
@@ -9,20 +9,20 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-02-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogumbo
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: 1.3.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 1.3.0
|
28
28
|
- !ruby/object:Gem::Dependency
|