locatine 0.01135 → 0.01215

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f3cb2cbc141c7d5c0961539de0d404445f6b5f61
4
- data.tar.gz: 7597435001651d14154b8e0ccfc584491e26aafa
3
+ metadata.gz: 654fcf96ac8cb5d60890e8f763c11f48d7a8a44b
4
+ data.tar.gz: 4124878952ca9a27a869a347d2d56959e72e470b
5
5
  SHA512:
6
- metadata.gz: 58f225f496d12d9e9e7a517c96ea72365fe86cd699b969ad5a8d21c9d2578e9cfb11e992676b72f6309679c39dca22a76ced8a2f6b3b46881258419b4f593a17
7
- data.tar.gz: e0715af3063fd55346c94649feb8d3a02b26382c9c02b6797fe070ab91cb3b04afde97f23f81abadc60758e45fd481c38755e35b3c79afbf540f1743a4e3f909
6
+ metadata.gz: e009b71ac4bf3c74912a0c7f03b7faf5de050dbbc996fd1cf95a8435dea7bb6a6708949f39c9ca42fae5769ebc40af7e79513d64b6e5424e8e359eafce865f79
7
+ data.tar.gz: 6eb4a9ca18de051c96e915b0b6d7130d7ec0c2529577443b17b59bcf675dcbf4b082b7c38ea41426f600b78f092d85352e614c52d46aea34e64cdfd0bace1b1f
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "Locatine app",
3
- "version": "0.01135",
3
+ "version": "0.01215",
4
4
  "description": "Messaging from browser to main app",
5
5
  "devtools_page": "devtools.html",
6
6
  "permissions": ["activeTab", "storage", "contextMenus", "tabs"],
@@ -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 !all.empty?
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
@@ -30,11 +30,8 @@ module Locatine
30
30
  tolerance: 15)
31
31
  browser ||= right_browser
32
32
  @browser = browser
33
- @json = json
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
@@ -42,9 +42,9 @@ module Locatine
42
42
  :depth,
43
43
  :browser,
44
44
  :learn,
45
- :json,
46
45
  :stability_limit,
47
46
  :scope,
48
47
  :tolerance
48
+ attr_reader :json
49
49
  end
50
50
  end
@@ -1,6 +1,6 @@
1
1
  module Locatine
2
2
  # constants here...
3
- VERSION = '0.01135'.freeze
3
+ VERSION = '0.01215'.freeze
4
4
  NAME = 'locatine'.freeze
5
5
  HOME = if File.readable?("#{Dir.pwd}/lib/#{Locatine::NAME}")
6
6
  "#{Dir.pwd}/lib/#{Locatine::NAME}"
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.01135'
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-09 00:00:00.000000000 Z
11
+ date: 2019-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler