locatine 0.01135 → 0.01215
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/locatine/app/manifest.json +1 -1
- data/lib/locatine/file_work.rb +7 -0
- data/lib/locatine/find_by_guess.rb +3 -3
- data/lib/locatine/public.rb +5 -4
- data/lib/locatine/search.rb +1 -1
- data/lib/locatine/version.rb +1 -1
- 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: 654fcf96ac8cb5d60890e8f763c11f48d7a8a44b
|
4
|
+
data.tar.gz: 4124878952ca9a27a869a347d2d56959e72e470b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e009b71ac4bf3c74912a0c7f03b7faf5de050dbbc996fd1cf95a8435dea7bb6a6708949f39c9ca42fae5769ebc40af7e79513d64b6e5424e8e359eafce865f79
|
7
|
+
data.tar.gz: 6eb4a9ca18de051c96e915b0b6d7130d7ec0c2529577443b17b59bcf675dcbf4b082b7c38ea41426f600b78f092d85352e614c52d46aea34e64cdfd0bace1b1f
|
data/lib/locatine/file_work.rb
CHANGED
@@ -15,6 +15,13 @@ module Locatine
|
|
15
15
|
hash.merge(JSON.parse(File.read(@json))['data'])
|
16
16
|
end
|
17
17
|
|
18
|
+
def set_file(json)
|
19
|
+
@json = json
|
20
|
+
@folder = File.dirname(@json)
|
21
|
+
@name = File.basename(@json)
|
22
|
+
@data = read_create
|
23
|
+
end
|
24
|
+
|
18
25
|
def create_json_file
|
19
26
|
f = File.new(@json, 'w')
|
20
27
|
f.puts '{"data" : {}}'
|
@@ -50,10 +50,10 @@ module Locatine
|
|
50
50
|
def find_by_guess(scope, name, vars)
|
51
51
|
@cold_time = 0
|
52
52
|
all = main_guess(name)
|
53
|
-
if
|
54
|
-
guess, guess_data = check_guess(all, vars, name, scope)
|
55
|
-
else
|
53
|
+
if all.empty?
|
56
54
|
push_title "Locatine has no guess for #{name} in #{scope}."
|
55
|
+
else
|
56
|
+
guess, guess_data = check_guess(all, vars, name, scope)
|
57
57
|
end
|
58
58
|
@cold_time = nil
|
59
59
|
return guess, guess_data.to_h
|
data/lib/locatine/public.rb
CHANGED
@@ -30,11 +30,8 @@ module Locatine
|
|
30
30
|
tolerance: 15)
|
31
31
|
browser ||= right_browser
|
32
32
|
@browser = browser
|
33
|
-
|
34
|
-
@folder = File.dirname(@json)
|
35
|
-
@name = File.basename(@json)
|
33
|
+
set_file(json)
|
36
34
|
@depth = depth
|
37
|
-
@data = read_create
|
38
35
|
@learn = learn
|
39
36
|
@stability_limit = stability_limit
|
40
37
|
@scope = scope
|
@@ -103,5 +100,9 @@ module Locatine
|
|
103
100
|
def collect(*args)
|
104
101
|
enforce(:collection, true, *args)
|
105
102
|
end
|
103
|
+
|
104
|
+
def json=(value)
|
105
|
+
set_file(value)
|
106
|
+
end
|
106
107
|
end
|
107
108
|
end
|
data/lib/locatine/search.rb
CHANGED
data/lib/locatine/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: locatine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.01215'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergei Seleznev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|