webdrone 1.0.8 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 179f4cb1903c007a0a97dd9d4d257f262f0db41c
4
- data.tar.gz: 5ba334f9f7998ba63aafe7aa45c65129d86fbe75
3
+ metadata.gz: dcdaff4c64e8f4242539295a1715211c73f2c4ff
4
+ data.tar.gz: 95b5d9aaea3da68226170a57bab3a4b574b41db7
5
5
  SHA512:
6
- metadata.gz: 66e6468b14d89751c3c0643fd31e28d9092692bc273af26bafc2f38ce2c5bc94a3e48702f402830fe80409e6a989a36f1f03b72aec50a127aca82ffae063fbbd
7
- data.tar.gz: 963bdc3e4a9c5f2a7b5c1c17315db126b17bccba0498cc40c0d45d6d89a9740f6f173539df23a13874cad8234fd61ed70d4f7ac12248cd69c012945d5112a975
6
+ metadata.gz: a0bd12808f97c913034dfede59285122c6a73f98d34b194df194ee4b538f8bc7f33c38ade4167556d9c17e71be0694f4380b0681eade9e002a7f44ae0390f338
7
+ data.tar.gz: 2a0f2cb78ed3880c20770feb0c18ec15d4cb322f8f2b9d07e98d0068406f452b032f74932cb829d1ec16f18ffbf581a6a2d1caf1aeb8bdeac7a722d050497cae
@@ -42,11 +42,23 @@ module Webdrone
42
42
  end
43
43
 
44
44
  def self.irb_console(binding = nil)
45
- puts "Warning: Webdrone.irb_console is deprecated, please use a0.console instead"
45
+ puts "Webdrone: Webdrone.irb_console IS DEPRECATED, please use a0.console instead."
46
46
  return if IRB.CurrentContext and not binding
47
47
  binding = Kernel.binding.of_caller(1) if binding == nil
48
48
  IRB.start_session(binding)
49
49
  end
50
+
51
+ @@running_pry = false
52
+ def self.pry_console(binding = nil)
53
+ if @@running_pry
54
+ puts "Webdrone: pry console already running."
55
+ else
56
+ @@running_pry = true
57
+ binding = Kernel.binding.of_caller(1) unless binding
58
+ binding.pry
59
+ @@running_pry = false
60
+ end
61
+ end
50
62
  end
51
63
 
52
64
  module IRB
@@ -26,15 +26,26 @@ module Webdrone
26
26
  end
27
27
 
28
28
  def env_update(binding)
29
+ bool_vars = [:create_outdir, :developer, :quit_at_exit, :maximize]
29
30
  ENV.keys.select { |env| env.start_with? 'WEBDRONE_' }.each do |env|
30
31
  v = env[9..-1].downcase.to_sym
31
32
  if binding.local_variable_defined? v
32
33
  o = binding.local_variable_get(v)
33
34
  n = ENV[env]
35
+ if bool_vars.include? v
36
+ if n == "true"
37
+ n = true
38
+ elsif n == "false"
39
+ n = false
40
+ else
41
+ puts "Webdrone: ignoring value '#{n}' for boolean parameter #{v}."
42
+ next
43
+ end
44
+ end
34
45
  binding.local_variable_set(v, n)
35
- puts "Webdrone info: overriding #{v} from '#{o}' to '#{n}'."
46
+ puts "Webdrone: overriding #{v} from '#{o}' to '#{n}'."
36
47
  else
37
- puts "Webdrone warn: unknown environment #{env}."
48
+ puts "Webdrone: ignoring unknown parameter #{env}."
38
49
  end
39
50
  end
40
51
  end
@@ -106,8 +117,15 @@ module Webdrone
106
117
 
107
118
  def console(binding = nil)
108
119
  binding = Kernel.binding.of_caller(1) unless binding
109
- @ctxt.with_conf developer: false do
110
- binding.pry
120
+ old_error = self.conf.error
121
+ old_developer = self.conf.developer
122
+ begin
123
+ self.conf.error = :raise
124
+ self.conf.developer = false
125
+ Webdrone.pry_console binding
126
+ ensure
127
+ self.conf.error = old_error
128
+ self.conf.developer = old_developer
111
129
  end
112
130
  end
113
131
  end
@@ -134,7 +134,9 @@ module Webdrone
134
134
  if exception.class != WebdroneError
135
135
  exception = WebdroneError.new(exception.message, exception, a0, Kernel.caller_locations)
136
136
  if a0.conf.developer and not exception.caller_location_index.nil?
137
- Kernel.binding.of_caller(exception.caller_location_index + 1).pry
137
+ exception.write_title "STARTING DEVELOPER CONSOLE ON ERROR"
138
+ exception.dump_error_report
139
+ a0.console Kernel.binding.of_caller(exception.caller_location_index + 1)
138
140
  end
139
141
  end
140
142
 
@@ -1,3 +1,3 @@
1
1
  module Webdrone
2
- VERSION = "1.0.8"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -15,13 +15,15 @@ module Webdrone
15
15
  def vrfy(text, n: 1, all: false, visible: true, attr: nil, eq: nil, contains: nil)
16
16
  item = @a0.find.send __callee__, text, n: n, all: all, visible: visible
17
17
  if item.is_a? Array
18
- item.each { |x| vrfy_item x, attr: attr, eq: eq, contains: contains }
18
+ item.each { |x| vrfy_item x, text: text, callee: __callee__, attr: attr, eq: eq, contains: contains }
19
19
  else
20
- vrfy_item item, attr: attr, eq: eq, contains: contains
20
+ vrfy_item item, text: text, callee: __callee__, attr: attr, eq: eq, contains: contains
21
21
  end
22
+ rescue => exception
23
+ Webdrone.report_error(@a0, exception)
22
24
  end
23
25
 
24
- def vrfy_item(item, attr: nil, eq: nil, contains: nil)
26
+ def vrfy_item(item, text: nil, callee: nil, attr: nil, eq: nil, contains: nil)
25
27
  if attr != nil
26
28
  r = item.attribute(attr) == eq if eq != nil
27
29
  r = item.attribute(attr).include? contains if contains != nil
@@ -34,9 +36,9 @@ module Webdrone
34
36
  targ = "eq: [#{eq}]" if eq
35
37
  targ = "contains: [#{contains}]" if contains
36
38
  if attr != nil
37
- raise Exception.new "ERROR: Attribute [#{attr}] value [#{item.attribute(attr)}] does not comply #{targ}"
39
+ raise "VRFY: #{callee} [#{text}] attr [#{attr}] value [#{item.attribute(attr)}] does not comply #{targ}"
38
40
  else
39
- raise Exception.new "ERROR: Value [#{item.text}] does not comply #{targ}"
41
+ raise "VRFY: #{callee} [#{text}] text value [#{item.text}] does not comply #{targ}"
40
42
  end
41
43
  end
42
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webdrone
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aldrin Martoq
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-06 00:00:00.000000000 Z
11
+ date: 2016-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler