locatine 0.00552 → 0.00695
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/locatine/search.rb +10 -6
- 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: 243bb8f7b9d129d5e150c06fedde26e259b6ab3b
|
4
|
+
data.tar.gz: 12bbfbb7c9a0e02b17354b925a824f1a933434f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf8572d806425b259429a81b2e4461f295396e3af8bf69c1f2eda4d638f959f78b636a9a44001c812d1079ea86d51b32079b26c924f283ae78c700e2245f9ba9
|
7
|
+
data.tar.gz: 5d317c2c22853ed9a74ace1e01cdfd1dfc3c4665df1d98b5f946f74fe2e39116a81b0394ffa219ea52a7776ff377f134552e82f7d3684af855542ebc621b6396
|
data/lib/locatine/search.rb
CHANGED
@@ -289,12 +289,15 @@ module Locatine
|
|
289
289
|
end
|
290
290
|
end
|
291
291
|
|
292
|
+
def set_title(text)
|
293
|
+
puts text
|
294
|
+
send_to_app("locatinetitle", text)
|
295
|
+
end
|
296
|
+
|
292
297
|
##
|
293
298
|
# Sending request to locatine app
|
294
299
|
def start_listening(scope, name)
|
295
300
|
send_to_app("locatinestyle", "blocked", @browser) if @iframe
|
296
|
-
puts "You are defining #{name} in #{scope}" # TODO send to app
|
297
|
-
send_to_app("locatinetitle", "You are defining #{name} in #{scope}.")
|
298
301
|
send_to_app("locatinehint", "Toggle single//collection mode button if you need. If you want to do some actions on the page toggle Locatine waiting button. You also can select element on devtools -> Elements. Do not forget to confirm your selection.")
|
299
302
|
send_to_app("locatinestyle", "set_true")
|
300
303
|
sleep 0.5
|
@@ -315,12 +318,12 @@ module Locatine
|
|
315
318
|
guess_data = generate_data(guess, vars)
|
316
319
|
by_data = find_by_data(guess_data, vars)
|
317
320
|
if by_data.nil? || (engine.elements.length/find_by_data(guess_data, vars).length <=4)
|
318
|
-
|
321
|
+
set_title "Locatine has no good guess for #{name} in #{scope}. Try to change the name. Or just define it."
|
319
322
|
guess = nil
|
320
323
|
guess_data = {}
|
321
324
|
end
|
322
325
|
else
|
323
|
-
|
326
|
+
set_title "Locatine has no guess for #{name} in #{scope}. Try to change the name. Or just define it."
|
324
327
|
end
|
325
328
|
@cold_time = timeout
|
326
329
|
return guess, guess_data.to_h
|
@@ -334,6 +337,7 @@ module Locatine
|
|
334
337
|
if !element.nil?
|
335
338
|
attributes = generate_data(element, vars)
|
336
339
|
else
|
340
|
+
set_title("Locatine is trying to guess what is #{name} in #{scope}.")
|
337
341
|
element, attributes = find_by_guess(scope, name, vars) if name.length >= 5
|
338
342
|
end
|
339
343
|
while !finished do
|
@@ -355,9 +359,9 @@ module Locatine
|
|
355
359
|
mass_highlight_turn(old_element, false) if old_element
|
356
360
|
mass_highlight_turn(element) if element
|
357
361
|
if element.nil?
|
358
|
-
|
362
|
+
set_title "Nothing is selected as #{name} in #{scope}"
|
359
363
|
else
|
360
|
-
|
364
|
+
set_title "#{element.length} elements were selected as #{name} in #{scope}. If it is correct - confirm the selection."
|
361
365
|
end
|
362
366
|
end
|
363
367
|
old_element, old_tag, old_index = element, tag, index
|
data/lib/locatine/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Locatine
|
2
2
|
# constants here...
|
3
|
-
VERSION = "0.
|
3
|
+
VERSION = "0.00695"
|
4
4
|
NAME = "locatine"
|
5
5
|
HOME = File.readable?("#{Dir.pwd}/lib/#{Locatine::NAME}")? "#{Dir.pwd}/lib/#{Locatine::NAME}" : "#{Gem.dir}/gems/#{Locatine::NAME}-#{Locatine::VERSION}/lib/#{Locatine::NAME}"
|
6
6
|
end
|
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.00695'
|
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-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|