gauge-ruby 0.0.4.1 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/configuration.rb +16 -17
- data/lib/method_cache.rb +2 -3
- data/lib/processors/execution_handler.rb +19 -11
- 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: ca1c1ef4c0bc30a15af7176cf126f85c2bb7ea28
|
4
|
+
data.tar.gz: 0533e8641e36c79b6b4a01cf80cf3f682c19e668
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c35043657b58688950fbb2034cdf1a0637644c7ec7a113e76000638f8abac2a318d9aa4e97bc9d00c2d3de12f3335c951ece1dac34195b0c45bf55b0a4b09b09
|
7
|
+
data.tar.gz: 32e28492115359abec73578c54389a8b7d7d46d8b5d423537587604a1cb1bb4564f2819810d0004a15affa16efff12753a0624a20e07da75bfee373e621574bb
|
data/lib/configuration.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Copyright 2015 ThoughtWorks, Inc.
|
2
|
-
|
2
|
+
#
|
3
3
|
# This file is part of Gauge-Ruby.
|
4
4
|
#
|
5
5
|
# Gauge-Ruby is free software: you can redistribute it and/or modify
|
@@ -15,29 +15,28 @@
|
|
15
15
|
# You should have received a copy of the GNU General Public License
|
16
16
|
# along with Gauge-Ruby. If not, see <http://www.gnu.org/licenses/>.
|
17
17
|
|
18
|
+
# Gauge runtime for Ruby language. Read more about Gauge: http://getgauge.io
|
19
|
+
|
18
20
|
# @api public
|
19
21
|
module Gauge
|
20
|
-
# @api public
|
21
22
|
class << self
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
# Custom configuration for Gauge
|
26
|
-
# Lets you configure modules that need to be included at runtime.
|
23
|
+
# @api public
|
24
|
+
# Custom configuration for Gauge
|
25
|
+
# Lets you configure modules that need to be included at runtime.
|
27
26
|
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
27
|
+
# @example
|
28
|
+
# # Given there are two modules defined
|
29
|
+
# module Foo
|
30
|
+
# end
|
32
31
|
#
|
33
|
-
#
|
34
|
-
#
|
32
|
+
# module Bar
|
33
|
+
# end
|
35
34
|
#
|
36
|
-
#
|
35
|
+
# # Gauge can be configured to include these modules at runtime.
|
37
36
|
#
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
37
|
+
# Gauge.configure do |config|
|
38
|
+
# config.include Foo, Bar
|
39
|
+
# end
|
41
40
|
def configure(&block)
|
42
41
|
Configuration.instance.instance_eval &block
|
43
42
|
end
|
data/lib/method_cache.rb
CHANGED
@@ -19,7 +19,7 @@ require_relative 'configuration'
|
|
19
19
|
module Gauge
|
20
20
|
# @api private
|
21
21
|
class MethodCache
|
22
|
-
|
22
|
+
["before_step", "after_step", "before_spec", "after_spec", "before_scenario", "after_scenario", "before_suite", "after_suite"].each { |hook|
|
23
23
|
define_singleton_method "add_#{hook}_hook" do |&block|
|
24
24
|
self.class_variable_get("@@#{hook}_hooks").push block
|
25
25
|
end
|
@@ -27,7 +27,7 @@ module Gauge
|
|
27
27
|
self.class_variable_get("@@#{hook}_hooks")
|
28
28
|
end
|
29
29
|
}
|
30
|
-
|
30
|
+
|
31
31
|
def self.add_step(parameterized_step_text, &block)
|
32
32
|
@@steps_map[parameterized_step_text] = block
|
33
33
|
end
|
@@ -61,7 +61,6 @@ module Gauge
|
|
61
61
|
end
|
62
62
|
|
63
63
|
private
|
64
|
-
HOOKS = ["before_step", "after_step", "before_spec", "after_spec", "before_scenario", "after_scenario", "before_suite", "after_suite"]
|
65
64
|
@@steps_map = Hash.new
|
66
65
|
@@steps_text_map = Hash.new
|
67
66
|
@@steps_with_aliases = []
|
@@ -50,16 +50,12 @@ module Gauge
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def screenshot_bytes
|
53
|
-
return nil if (ENV['screenshot_enabled'] || "").downcase == "false"
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
File.delete file
|
60
|
-
return file_content
|
61
|
-
end
|
62
|
-
return nil
|
53
|
+
return nil if (ENV['screenshot_enabled'] || "").downcase == "false" || which("gauge_screenshot").nil?
|
54
|
+
file = File.open("#{Dir.tmpdir}/screenshot.png", "w+")
|
55
|
+
`gauge_screenshot #{file.path}`
|
56
|
+
file_content = File.binread(file.path)
|
57
|
+
File.delete file
|
58
|
+
return file_content
|
63
59
|
end
|
64
60
|
|
65
61
|
def time_elapsed_since(start_time)
|
@@ -77,7 +73,19 @@ module Gauge
|
|
77
73
|
end
|
78
74
|
end
|
79
75
|
return params
|
80
|
-
end
|
76
|
+
end
|
77
|
+
|
78
|
+
private
|
79
|
+
def which(cmd)
|
80
|
+
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
81
|
+
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
|
82
|
+
exts.each { |ext|
|
83
|
+
exe = File.join(path, "#{cmd}#{ext}")
|
84
|
+
return exe if File.executable?(exe) && !File.directory?(exe)
|
85
|
+
}
|
86
|
+
end
|
87
|
+
return nil
|
88
|
+
end
|
81
89
|
end
|
82
90
|
end
|
83
91
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gauge-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gauge Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-protocol-buffers
|