superbara 0.9.0 → 0.9.1
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 +4 -4
- data/Gemfile.lock +2 -2
- data/bin/release +0 -2
- data/bin/tests +20 -0
- data/examples/tags/block.rb +3 -0
- data/examples/tags/main.rb +2 -0
- data/examples/tags/simple.rb +3 -0
- data/lib/superbara.rb +13 -0
- data/lib/superbara/cli.rb +19 -1
- data/lib/superbara/config.rb +15 -0
- data/lib/superbara/context.rb +5 -1
- data/lib/superbara/dsl.rb +42 -1
- data/lib/superbara/errors/not_desired_tag_error.rb +6 -0
- data/lib/superbara/version.rb +1 -1
- data/tests/envs/on_error/first_failing.rb +1 -0
- data/tests/envs/on_error/main.rb +3 -0
- data/tests/envs/on_error/second_ok.rb +0 -0
- data/tests/envs/on_error/third_failing.rb +1 -0
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9f3a8603cefb2c738a232b7b59fc8f12420bb4290cf7e1ae19833fd1b0b392c
|
4
|
+
data.tar.gz: c04c50f6b234649f9361bba1129fd8a0d2c42c355fb69b00da48c3a093de58cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8aaf995a69d5c8c26e0702f6763999d9d79bad6031b3f362b1223bf33b9aeac5deeedabc8f0c44f20582f87053b856b929c46d04558e2a10755da0fa96e147f6
|
7
|
+
data.tar.gz: 7c6934809be18de784b8f6fff38c50aa9d282229a7d979a574120dedbe991b619ff27a8f53050ccfc5b80b90e3e89e25bb878e45dcd15a780ec80f096972deb0
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
superbara (0.9.
|
4
|
+
superbara (0.9.1)
|
5
5
|
binding_of_caller (~> 0.8, >= 0.8.0)
|
6
6
|
capybara (~> 3.1, >= 3.1.0)
|
7
7
|
colorize (~> 0.8, >= 0.8.1)
|
@@ -18,7 +18,7 @@ GEM
|
|
18
18
|
binding_of_caller (0.8.0)
|
19
19
|
debug_inspector (>= 0.0.1)
|
20
20
|
byebug (10.0.2)
|
21
|
-
capybara (3.2.
|
21
|
+
capybara (3.2.1)
|
22
22
|
addressable
|
23
23
|
mini_mime (>= 0.1.3)
|
24
24
|
nokogiri (~> 1.8)
|
data/bin/release
CHANGED
data/bin/tests
CHANGED
@@ -24,4 +24,24 @@ if [ "$exit_status" != 1 ]; then
|
|
24
24
|
exit 1
|
25
25
|
fi
|
26
26
|
|
27
|
+
set +e
|
28
|
+
SUPERBARA_ON_ERROR=continue exe/superbara run tests/envs/on_error
|
29
|
+
exit_status=$?
|
30
|
+
set -e
|
31
|
+
|
32
|
+
if [ "$exit_status" != 1 ]; then
|
33
|
+
echo "err! SUPERBARA_ON_ERROR=continue"
|
34
|
+
exit 1
|
35
|
+
fi
|
36
|
+
|
37
|
+
set +e
|
38
|
+
exe/superbara run tests/envs/on_error
|
39
|
+
exit_status=$?
|
40
|
+
set -e
|
41
|
+
|
42
|
+
if [ "$exit_status" != 1 ]; then
|
43
|
+
echo "err! tests/envs/on_error"
|
44
|
+
exit 1
|
45
|
+
fi
|
46
|
+
|
27
47
|
echo "success!"
|
data/lib/superbara.rb
CHANGED
@@ -13,6 +13,8 @@ require_relative "pry_monkey"
|
|
13
13
|
|
14
14
|
::Kernel.send :undef_method, :p
|
15
15
|
|
16
|
+
require_relative "superbara/config"
|
17
|
+
|
16
18
|
module Superbara
|
17
19
|
@@project_name = nil
|
18
20
|
@@shell = false
|
@@ -20,6 +22,8 @@ module Superbara
|
|
20
22
|
@@visual = false
|
21
23
|
@@started_at = Time.now
|
22
24
|
@@project_path = Dir.pwd
|
25
|
+
@@config = Superbara::Config.new
|
26
|
+
@@errored_runs = []
|
23
27
|
|
24
28
|
def self.start!
|
25
29
|
@@started_at = Time.now
|
@@ -138,6 +142,14 @@ module Superbara
|
|
138
142
|
end
|
139
143
|
end
|
140
144
|
|
145
|
+
def self.errored_runs
|
146
|
+
@@errored_runs
|
147
|
+
end
|
148
|
+
|
149
|
+
def self.config
|
150
|
+
@@config
|
151
|
+
end
|
152
|
+
|
141
153
|
def self.toast(text, duration: 1, delay: nil)
|
142
154
|
return unless Superbara.visual?
|
143
155
|
|
@@ -206,6 +218,7 @@ require_relative "superbara/chrome"
|
|
206
218
|
require_relative "superbara/cli"
|
207
219
|
require_relative "superbara/context"
|
208
220
|
require_relative "superbara/web"
|
221
|
+
require_relative "superbara/errors/not_desired_tag_error"
|
209
222
|
|
210
223
|
trap "SIGINT" do
|
211
224
|
puts "
|
data/lib/superbara/cli.rb
CHANGED
@@ -159,7 +159,25 @@ scroll 50
|
|
159
159
|
|
160
160
|
case main_command
|
161
161
|
when "run"
|
162
|
-
|
162
|
+
if Superbara.errored_runs.any?
|
163
|
+
puts ""
|
164
|
+
error_or_errors = if Superbara.errored_runs.size > 1
|
165
|
+
"errors"
|
166
|
+
else
|
167
|
+
"error"
|
168
|
+
end
|
169
|
+
|
170
|
+
puts "Run had #{Superbara.errored_runs.size} #{error_or_errors}!".colorize(:red)
|
171
|
+
puts ""
|
172
|
+
puts "Following runs errored:"
|
173
|
+
for errored_run in Superbara.errored_runs
|
174
|
+
puts " #{errored_run}"
|
175
|
+
end
|
176
|
+
|
177
|
+
exit! 1 #TODO: at_exit handler instead?
|
178
|
+
else
|
179
|
+
exit 0
|
180
|
+
end
|
163
181
|
when "start"
|
164
182
|
Superbara.current_context.__superbara_eval """
|
165
183
|
debug disable_whereami: true, help: false;
|
data/lib/superbara/context.rb
CHANGED
data/lib/superbara/dsl.rb
CHANGED
@@ -117,7 +117,19 @@ return Array.from(
|
|
117
117
|
Superbara.project_path = File.dirname(better_what)
|
118
118
|
end
|
119
119
|
|
120
|
-
|
120
|
+
begin
|
121
|
+
Superbara.current_context.__superbara_load(better_what)
|
122
|
+
rescue Exception => ex
|
123
|
+
if ENV["SUPERBARA_ON_ERROR"] == "continue"
|
124
|
+
colored_output = " ERROR: ".colorize(:red)
|
125
|
+
colored_output << ex.message
|
126
|
+
#TODO: output to support "colored tags" and nesting
|
127
|
+
Superbara.output colored_output
|
128
|
+
Superbara.errored_runs << what
|
129
|
+
else
|
130
|
+
raise ex
|
131
|
+
end
|
132
|
+
end
|
121
133
|
Superbara.project_path = old_project_path
|
122
134
|
end
|
123
135
|
|
@@ -188,6 +200,35 @@ return Array.from(
|
|
188
200
|
true
|
189
201
|
end
|
190
202
|
|
203
|
+
def tag(*tags, &block)
|
204
|
+
tags.flatten!
|
205
|
+
|
206
|
+
desired = if Superbara.config.tags.empty?
|
207
|
+
true
|
208
|
+
else
|
209
|
+
found = false
|
210
|
+
for tag in tags do
|
211
|
+
if Superbara.config.tags.include? tag
|
212
|
+
found = true
|
213
|
+
break
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
found
|
218
|
+
end
|
219
|
+
|
220
|
+
if desired
|
221
|
+
if block.nil?
|
222
|
+
return
|
223
|
+
else
|
224
|
+
value = block.call
|
225
|
+
return value
|
226
|
+
end
|
227
|
+
else
|
228
|
+
raise Superbara::Errors::NotDesiredTagError
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
191
232
|
def wait(seconds=5, &block)
|
192
233
|
def wait_formatted_output(status, took_delta)
|
193
234
|
word, color = if status
|
data/lib/superbara/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
asdf_first
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
asdf_third
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: superbara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matti Paksula
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -315,6 +315,9 @@ files:
|
|
315
315
|
- examples/login-and-logout/main.rb
|
316
316
|
- examples/sites/pharos.sh/main.rb
|
317
317
|
- examples/sites/vr.fi/helsinki-tampere/main.rb
|
318
|
+
- examples/tags/block.rb
|
319
|
+
- examples/tags/main.rb
|
320
|
+
- examples/tags/simple.rb
|
318
321
|
- exe/superbara
|
319
322
|
- lib/capybara_monkey.rb
|
320
323
|
- lib/pry_monkey.rb
|
@@ -322,8 +325,10 @@ files:
|
|
322
325
|
- lib/superbara.rb
|
323
326
|
- lib/superbara/chrome.rb
|
324
327
|
- lib/superbara/cli.rb
|
328
|
+
- lib/superbara/config.rb
|
325
329
|
- lib/superbara/context.rb
|
326
330
|
- lib/superbara/dsl.rb
|
331
|
+
- lib/superbara/errors/not_desired_tag_error.rb
|
327
332
|
- lib/superbara/helpers.rb
|
328
333
|
- lib/superbara/rspec.rb
|
329
334
|
- lib/superbara/version.rb
|
@@ -333,6 +338,10 @@ files:
|
|
333
338
|
- tests/common/main.rb
|
334
339
|
- tests/common/vars.rb
|
335
340
|
- tests/common/webapp.rb
|
341
|
+
- tests/envs/on_error/first_failing.rb
|
342
|
+
- tests/envs/on_error/main.rb
|
343
|
+
- tests/envs/on_error/second_ok.rb
|
344
|
+
- tests/envs/on_error/third_failing.rb
|
336
345
|
- tests/fail/main.rb
|
337
346
|
- tests/features/examplecom.rb
|
338
347
|
- tests/features/find.rb
|