busser 0.8.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/.github/workflows/ci.yml +32 -0
- data/.github/workflows/pr-title.yml +28 -0
- data/.github/workflows/publish.yml +45 -0
- data/.gitignore +0 -1
- data/.markdownlint.yaml +6 -0
- data/.release-please-manifest.json +3 -0
- data/.rubocop.yml +9 -0
- data/.yamllint +6 -0
- data/CHANGELOG.md +43 -0
- data/CONTRIBUTING.md +103 -0
- data/Gemfile +10 -6
- data/README.md +77 -19
- data/Rakefile +6 -23
- data/bin/busser +2 -4
- data/busser.gemspec +12 -15
- data/features/deserialize_command.feature +4 -1
- data/features/plugin_create_command.feature +7 -9
- data/features/plugin_install_command.feature +1 -1
- data/features/support/env.rb +4 -16
- data/lib/busser/cli.rb +6 -7
- data/lib/busser/command/deserialize.rb +16 -11
- data/lib/busser/command/plugin.rb +4 -5
- data/lib/busser/command/plugin_create.rb +40 -27
- data/lib/busser/command/plugin_install.rb +15 -16
- data/lib/busser/command/plugin_list.rb +3 -4
- data/lib/busser/command/setup.rb +34 -21
- data/lib/busser/command/suite.rb +3 -4
- data/lib/busser/command/suite_cleanup.rb +3 -3
- data/lib/busser/command/suite_path.rb +2 -3
- data/lib/busser/command/test.rb +4 -4
- data/lib/busser/cucumber/hooks.rb +1 -9
- data/lib/busser/cucumber.rb +69 -49
- data/lib/busser/helpers.rb +4 -5
- data/lib/busser/plugin.rb +12 -6
- data/lib/busser/rubygems.rb +25 -11
- data/lib/busser/runner_plugin/dummy.rb +2 -3
- data/lib/busser/runner_plugin.rb +1 -2
- data/lib/busser/thor.rb +3 -4
- data/lib/busser/ui.rb +23 -5
- data/lib/busser/version.rb +1 -2
- data/lib/busser.rb +3 -4
- data/release-please-config.json +13 -0
- data/renovate.json +8 -0
- data/spec/busser/command/deserialize_spec.rb +110 -0
- data/spec/busser/command/plugin_create_spec.rb +175 -0
- data/spec/busser/command/setup_spec.rb +121 -0
- data/spec/busser/helpers_spec.rb +10 -10
- data/spec/busser/plugin_spec.rb +133 -0
- data/spec/busser/ui_spec.rb +84 -32
- data/spec/spec_helper.rb +1 -7
- data/templates/plugin/Rakefile.erb +4 -24
- data/templates/plugin/features_env.rb.erb +4 -4
- data/templates/plugin/gemspec.erb +7 -8
- data/templates/plugin/github_workflow.yml.erb +26 -0
- metadata +29 -88
- data/.cane +0 -0
- data/.simplecov +0 -10
- data/.travis.yml +0 -52
- data/Guardfile +0 -18
- data/appveyor.yml +0 -36
- data/templates/plugin/tailor.erb +0 -4
- data/templates/plugin/travis.yml.erb +0 -11
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
1
|
#
|
|
3
2
|
# Author:: Fletcher Nichol (<fnichol@nichol.ca>)
|
|
4
3
|
#
|
|
@@ -16,10 +15,12 @@
|
|
|
16
15
|
# See the License for the specific language governing permissions and
|
|
17
16
|
# limitations under the License.
|
|
18
17
|
|
|
19
|
-
require
|
|
20
|
-
require
|
|
18
|
+
require "base64" unless defined?(Base64)
|
|
19
|
+
require "fileutils" unless defined?(FileUtils)
|
|
20
|
+
require "digest/md5" unless defined?(Digest::MD5)
|
|
21
|
+
require "digest" unless defined?(Digest)
|
|
21
22
|
|
|
22
|
-
require
|
|
23
|
+
require "busser/thor"
|
|
23
24
|
|
|
24
25
|
module Busser
|
|
25
26
|
|
|
@@ -31,23 +32,27 @@ module Busser
|
|
|
31
32
|
#
|
|
32
33
|
class Deserialize < Busser::Thor::BaseGroup
|
|
33
34
|
|
|
34
|
-
class_option :destination, :
|
|
35
|
+
class_option :destination, desc: "Destination file path"
|
|
35
36
|
|
|
36
|
-
class_option :md5sum, :
|
|
37
|
+
class_option :md5sum, desc: "MD5 digest of original file"
|
|
37
38
|
|
|
38
|
-
class_option :perms, :
|
|
39
|
+
class_option :perms, desc: "Unix permissions on destination file"
|
|
39
40
|
|
|
40
41
|
def perform
|
|
41
42
|
file = File.expand_path(options[:destination])
|
|
42
43
|
contents = Base64.decode64(STDIN.read)
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
# Verify before writing. Checking afterwards still failed the command,
|
|
46
|
+
# but only once the unverified content was already on disk with its
|
|
47
|
+
# requested permissions, so a truncated stream left an executable file
|
|
48
|
+
# behind for anything later to pick up.
|
|
48
49
|
if Digest::MD5.hexdigest(contents) != options[:md5sum]
|
|
49
50
|
abort "Streamed file #{file} does not match source file md5"
|
|
50
51
|
end
|
|
52
|
+
|
|
53
|
+
FileUtils.mkdir_p(File.dirname(file))
|
|
54
|
+
File.open(file, "wb") { |f| f.write(contents) }
|
|
55
|
+
FileUtils.chmod(Integer(options[:perms]), file)
|
|
51
56
|
end
|
|
52
57
|
end
|
|
53
58
|
end
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
1
|
#
|
|
3
2
|
# Author:: Fletcher Nichol (<fnichol@nichol.ca>)
|
|
4
3
|
#
|
|
@@ -16,10 +15,10 @@
|
|
|
16
15
|
# See the License for the specific language governing permissions and
|
|
17
16
|
# limitations under the License.
|
|
18
17
|
|
|
19
|
-
require
|
|
20
|
-
require
|
|
21
|
-
require
|
|
22
|
-
require
|
|
18
|
+
require "busser/thor"
|
|
19
|
+
require "busser/command/plugin_create"
|
|
20
|
+
require "busser/command/plugin_install"
|
|
21
|
+
require "busser/command/plugin_list"
|
|
23
22
|
|
|
24
23
|
module Busser
|
|
25
24
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
1
|
#
|
|
3
2
|
# Author:: Fletcher Nichol (<fnichol@nichol.ca>)
|
|
4
3
|
#
|
|
@@ -16,8 +15,8 @@
|
|
|
16
15
|
# See the License for the specific language governing permissions and
|
|
17
16
|
# limitations under the License.
|
|
18
17
|
|
|
19
|
-
require
|
|
20
|
-
require
|
|
18
|
+
require "busser"
|
|
19
|
+
require "busser/thor"
|
|
21
20
|
|
|
22
21
|
module Busser
|
|
23
22
|
|
|
@@ -29,13 +28,13 @@ module Busser
|
|
|
29
28
|
#
|
|
30
29
|
class PluginCreate < Busser::Thor::BaseGroup
|
|
31
30
|
|
|
32
|
-
argument :name, :
|
|
31
|
+
argument :name, type: :string
|
|
33
32
|
|
|
34
|
-
class_option :type, :
|
|
35
|
-
:
|
|
33
|
+
class_option :type, aliases: "-t", type: :string,
|
|
34
|
+
default: "runner", desc: "Type of plugin (runner)"
|
|
36
35
|
|
|
37
|
-
class_option :license, :
|
|
38
|
-
:
|
|
36
|
+
class_option :license, aliases: "-l", default: "apachev2",
|
|
37
|
+
desc: "License type for gem (apachev2, mit, lgplv3, reserved)"
|
|
39
38
|
|
|
40
39
|
def create
|
|
41
40
|
self.class.source_root(Busser.source_root.join("templates", "plugin"))
|
|
@@ -58,9 +57,7 @@ module Busser
|
|
|
58
57
|
create_template("gemspec.erb", "#{config[:gem_name]}.gemspec")
|
|
59
58
|
create_template("license_#{config[:license]}.erb", license_filename)
|
|
60
59
|
create_template("gitignore.erb", ".gitignore")
|
|
61
|
-
create_template("
|
|
62
|
-
create_template("travis.yml.erb", ".travis.yml")
|
|
63
|
-
create_file(File.join(target_dir, ".cane"))
|
|
60
|
+
create_template("github_workflow.yml.erb", ".github/workflows/test.yml")
|
|
64
61
|
end
|
|
65
62
|
|
|
66
63
|
def create_source_files
|
|
@@ -118,29 +115,30 @@ module Busser
|
|
|
118
115
|
type_klass_name = "#{::Thor::Util.camel_case(options[:type])}Plugin"
|
|
119
116
|
|
|
120
117
|
{
|
|
121
|
-
:
|
|
122
|
-
:
|
|
123
|
-
:
|
|
124
|
-
:
|
|
125
|
-
:
|
|
126
|
-
:
|
|
127
|
-
:
|
|
128
|
-
:
|
|
129
|
-
:
|
|
130
|
-
:
|
|
131
|
-
:
|
|
132
|
-
:
|
|
118
|
+
name: name,
|
|
119
|
+
gem_name: "busser-#{name}",
|
|
120
|
+
gemspec: "busser-#{name}.gemspec",
|
|
121
|
+
klass_name: ::Thor::Util.camel_case(name),
|
|
122
|
+
type: options[:type],
|
|
123
|
+
type_klass_name: type_klass_name,
|
|
124
|
+
constant_name: ::Thor::Util.snake_case(name).upcase,
|
|
125
|
+
author: author,
|
|
126
|
+
email: email,
|
|
127
|
+
license: options[:license],
|
|
128
|
+
license_string: license_string,
|
|
129
|
+
license_spdx: license_spdx,
|
|
130
|
+
year: Time.now.year,
|
|
133
131
|
}
|
|
134
132
|
end
|
|
135
133
|
end
|
|
136
134
|
|
|
137
135
|
def author
|
|
138
|
-
git_user_name =
|
|
136
|
+
git_user_name = `git config user.name`.chomp
|
|
139
137
|
git_user_name.empty? ? "TODO: Write your name" : git_user_name
|
|
140
138
|
end
|
|
141
139
|
|
|
142
140
|
def email
|
|
143
|
-
git_user_email =
|
|
141
|
+
git_user_email = `git config user.email`.chomp
|
|
144
142
|
git_user_email.empty? ? "TODO: Write your email" : git_user_email
|
|
145
143
|
end
|
|
146
144
|
|
|
@@ -155,6 +153,21 @@ module Busser
|
|
|
155
153
|
end
|
|
156
154
|
end
|
|
157
155
|
|
|
156
|
+
# RubyGems validates spec.license against the SPDX list and warns on
|
|
157
|
+
# anything else, so the gemspec cannot reuse the human readable name
|
|
158
|
+
# that the README wants. "All rights reserved" has no SPDX identifier,
|
|
159
|
+
# so those gemspecs declare no license at all.
|
|
160
|
+
def license_spdx
|
|
161
|
+
case options[:license]
|
|
162
|
+
when "mit" then "MIT"
|
|
163
|
+
when "apachev2" then "Apache-2.0"
|
|
164
|
+
when "lgplv3" then "LGPL-3.0-only"
|
|
165
|
+
when "reserved" then nil
|
|
166
|
+
else
|
|
167
|
+
raise ArgumentError, "No such license #{options[:license]}"
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
|
|
158
171
|
def license_filename
|
|
159
172
|
case options[:license]
|
|
160
173
|
when "mit" then "LICENSE.txt"
|
|
@@ -166,8 +179,8 @@ module Busser
|
|
|
166
179
|
end
|
|
167
180
|
|
|
168
181
|
def license_comment
|
|
169
|
-
@license_comment ||= IO.read(File.join(target_dir, license_filename))
|
|
170
|
-
gsub(/^/,
|
|
182
|
+
@license_comment ||= IO.read(File.join(target_dir, license_filename))
|
|
183
|
+
.gsub(/^/, "# ").gsub(/\s+$/, "")
|
|
171
184
|
end
|
|
172
185
|
end
|
|
173
186
|
end
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
1
|
#
|
|
3
2
|
# Author:: Fletcher Nichol (<fnichol@nichol.ca>)
|
|
4
3
|
#
|
|
@@ -16,10 +15,10 @@
|
|
|
16
15
|
# See the License for the specific language governing permissions and
|
|
17
16
|
# limitations under the License.
|
|
18
17
|
|
|
19
|
-
require
|
|
18
|
+
require "openssl" unless defined?(OpenSSL)
|
|
20
19
|
|
|
21
|
-
require
|
|
22
|
-
require
|
|
20
|
+
require "busser/rubygems"
|
|
21
|
+
require "busser/thor"
|
|
23
22
|
|
|
24
23
|
module Busser
|
|
25
24
|
|
|
@@ -33,13 +32,13 @@ module Busser
|
|
|
33
32
|
|
|
34
33
|
include Busser::RubyGems
|
|
35
34
|
|
|
36
|
-
argument :plugins, :
|
|
35
|
+
argument :plugins, type: :array
|
|
37
36
|
|
|
38
|
-
class_option :force_postinstall, :
|
|
39
|
-
:
|
|
37
|
+
class_option :force_postinstall, type: :boolean, default: false,
|
|
38
|
+
desc: "Run the plugin's postinstall if it is already installed"
|
|
40
39
|
|
|
41
|
-
class_option :verbose, :
|
|
42
|
-
:
|
|
40
|
+
class_option :verbose, type: :boolean, default: false,
|
|
41
|
+
desc: "Set a more verbose output"
|
|
43
42
|
|
|
44
43
|
def install_all
|
|
45
44
|
if options[:verbose]
|
|
@@ -56,7 +55,7 @@ module Busser
|
|
|
56
55
|
|
|
57
56
|
def install(plugin)
|
|
58
57
|
gem_name, version = plugin.split("@")
|
|
59
|
-
name = gem_name.sub(/^busser-/,
|
|
58
|
+
name = gem_name.sub(/^busser-/, "")
|
|
60
59
|
|
|
61
60
|
new_install = install_plugin_gem(gem_name, version, name)
|
|
62
61
|
|
|
@@ -69,11 +68,11 @@ module Busser
|
|
|
69
68
|
def install_plugin_gem(gem, version, name)
|
|
70
69
|
if internal_plugin?(name) || gem_installed?(gem, version)
|
|
71
70
|
info "Plugin #{name} already installed"
|
|
72
|
-
|
|
71
|
+
false
|
|
73
72
|
else
|
|
74
73
|
spec = install_gem(gem, version)
|
|
75
74
|
info "Plugin #{name} installed (version #{spec.version})"
|
|
76
|
-
|
|
75
|
+
true
|
|
77
76
|
end
|
|
78
77
|
end
|
|
79
78
|
|
|
@@ -103,11 +102,11 @@ module Busser
|
|
|
103
102
|
#
|
|
104
103
|
def drop_ssl_verify_peer
|
|
105
104
|
before = OpenSSL::SSL::VERIFY_PEER
|
|
106
|
-
OpenSSL::SSL.send(:remove_const,
|
|
107
|
-
OpenSSL::SSL.const_set(
|
|
105
|
+
OpenSSL::SSL.send(:remove_const, "VERIFY_PEER")
|
|
106
|
+
OpenSSL::SSL.const_set("VERIFY_PEER", OpenSSL::SSL::VERIFY_NONE)
|
|
108
107
|
yield
|
|
109
|
-
OpenSSL::SSL.send(:remove_const,
|
|
110
|
-
OpenSSL::SSL.const_set(
|
|
108
|
+
OpenSSL::SSL.send(:remove_const, "VERIFY_PEER")
|
|
109
|
+
OpenSSL::SSL.const_set("VERIFY_PEER", before)
|
|
111
110
|
end
|
|
112
111
|
end
|
|
113
112
|
end
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
1
|
#
|
|
3
2
|
# Author:: Fletcher Nichol (<fnichol@nichol.ca>)
|
|
4
3
|
#
|
|
@@ -16,8 +15,8 @@
|
|
|
16
15
|
# See the License for the specific language governing permissions and
|
|
17
16
|
# limitations under the License.
|
|
18
17
|
|
|
19
|
-
require
|
|
20
|
-
require
|
|
18
|
+
require "busser/plugin"
|
|
19
|
+
require "busser/thor"
|
|
21
20
|
|
|
22
21
|
module Busser
|
|
23
22
|
|
|
@@ -33,7 +32,7 @@ module Busser
|
|
|
33
32
|
if plugin_data.empty?
|
|
34
33
|
say "No plugins installed yet"
|
|
35
34
|
else
|
|
36
|
-
print_table([
|
|
35
|
+
print_table([%w{Plugin Version}] + plugin_data)
|
|
37
36
|
end
|
|
38
37
|
end
|
|
39
38
|
|
data/lib/busser/command/setup.rb
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
1
|
#
|
|
3
2
|
# Author:: Fletcher Nichol (<fnichol@nichol.ca>)
|
|
4
3
|
#
|
|
@@ -16,8 +15,8 @@
|
|
|
16
15
|
# See the License for the specific language governing permissions and
|
|
17
16
|
# limitations under the License.
|
|
18
17
|
|
|
19
|
-
require
|
|
20
|
-
require
|
|
18
|
+
require "busser/thor"
|
|
19
|
+
require "busser/plugin"
|
|
21
20
|
|
|
22
21
|
module Busser
|
|
23
22
|
|
|
@@ -30,8 +29,8 @@ module Busser
|
|
|
30
29
|
class Setup < Busser::Thor::BaseGroup
|
|
31
30
|
|
|
32
31
|
class_option :type,
|
|
33
|
-
:
|
|
34
|
-
:
|
|
32
|
+
desc: "Type of binstub file to create (bourne or bat)",
|
|
33
|
+
default: "bourne"
|
|
35
34
|
|
|
36
35
|
def perform
|
|
37
36
|
banner "Setting up Busser"
|
|
@@ -43,7 +42,7 @@ module Busser
|
|
|
43
42
|
|
|
44
43
|
def create_busser_root
|
|
45
44
|
info "Creating BUSSER_ROOT in #{root_path}"
|
|
46
|
-
empty_directory(root_path, :
|
|
45
|
+
empty_directory(root_path, verbose: false)
|
|
47
46
|
end
|
|
48
47
|
|
|
49
48
|
def generate_busser_binstub
|
|
@@ -60,9 +59,9 @@ module Busser
|
|
|
60
59
|
binstub = root_path + "bin/busser.bat"
|
|
61
60
|
busser_root = root_path.to_s.gsub("/", "\\")
|
|
62
61
|
|
|
63
|
-
File.unlink(binstub) if File.
|
|
64
|
-
create_file(binstub, :
|
|
65
|
-
<<-BUSSER_BINSTUB.gsub(/^ {12}/,
|
|
62
|
+
File.unlink(binstub) if File.exist?(binstub)
|
|
63
|
+
create_file(binstub, verbose: false) do
|
|
64
|
+
<<-BUSSER_BINSTUB.gsub(/^ {12}/, "")
|
|
66
65
|
@ECHO OFF
|
|
67
66
|
REM This file was generated by Busser.
|
|
68
67
|
REM
|
|
@@ -80,9 +79,19 @@ module Busser
|
|
|
80
79
|
SET "GEM_PATH=#{gem_path}"
|
|
81
80
|
SET "GEM_CACHE=#{gem_home}\\cache"
|
|
82
81
|
|
|
83
|
-
REM
|
|
82
|
+
REM Keep the calling Ruby environment out of this one. Clearing
|
|
83
|
+
REM RUBYOPT is no longer enough: RubyGems requires bundler/setup
|
|
84
|
+
REM whenever BUNDLER_SETUP is set, and bundler then points GEM_HOME
|
|
85
|
+
REM at the calling project's bundle, undoing the isolation above.
|
|
84
86
|
SET RUBYOPT=
|
|
85
87
|
SET GEMRC=
|
|
88
|
+
SET RUBYLIB=
|
|
89
|
+
SET BUNDLER_SETUP=
|
|
90
|
+
SET BUNDLER_VERSION=
|
|
91
|
+
SET BUNDLE_BIN_PATH=
|
|
92
|
+
SET BUNDLE_GEMFILE=
|
|
93
|
+
SET BUNDLE_LOCKFILE=
|
|
94
|
+
SET BUNDLE_PATH=
|
|
86
95
|
|
|
87
96
|
REM Call the actual Busser bin with our arguments
|
|
88
97
|
"#{ruby_bin}" "#{gem_bindir}\\busser" %*
|
|
@@ -99,9 +108,9 @@ module Busser
|
|
|
99
108
|
def generate_busser_binstub_for_bourne
|
|
100
109
|
binstub = root_path + "bin/busser"
|
|
101
110
|
|
|
102
|
-
File.unlink(binstub) if File.
|
|
103
|
-
create_file(binstub, :
|
|
104
|
-
<<-BUSSER_BINSTUB.gsub(/^ {12}/,
|
|
111
|
+
File.unlink(binstub) if File.exist?(binstub)
|
|
112
|
+
create_file(binstub, verbose: false) do
|
|
113
|
+
<<-BUSSER_BINSTUB.gsub(/^ {12}/, "")
|
|
105
114
|
#!/usr/bin/env sh
|
|
106
115
|
#
|
|
107
116
|
# This file was generated by Busser.
|
|
@@ -121,22 +130,26 @@ module Busser
|
|
|
121
130
|
GEM_PATH="#{gem_path}"; export GEM_PATH
|
|
122
131
|
GEM_CACHE="#{gem_home}/cache"; export GEM_CACHE
|
|
123
132
|
|
|
124
|
-
#
|
|
125
|
-
|
|
133
|
+
# Keep the calling Ruby environment out of this one. Unsetting
|
|
134
|
+
# RUBYOPT is no longer enough: RubyGems requires bundler/setup
|
|
135
|
+
# whenever BUNDLER_SETUP is set, and bundler then points GEM_HOME
|
|
136
|
+
# at the calling project's bundle, undoing the isolation above.
|
|
137
|
+
unset RUBYOPT GEMRC RUBYLIB BUNDLER_SETUP BUNDLER_VERSION
|
|
138
|
+
unset BUNDLE_BIN_PATH BUNDLE_GEMFILE BUNDLE_LOCKFILE BUNDLE_PATH
|
|
126
139
|
|
|
127
140
|
# Call the actual Busser bin with our arguments
|
|
128
141
|
exec "#{ruby_bin}" "#{gem_bindir}/busser" "$@"
|
|
129
142
|
BUSSER_BINSTUB
|
|
130
143
|
end
|
|
131
|
-
chmod(binstub, 0755, :
|
|
144
|
+
chmod(binstub, 0755, verbose: false)
|
|
132
145
|
end
|
|
133
146
|
|
|
134
147
|
def ruby_bin
|
|
135
|
-
result = if bindir = RbConfig::CONFIG["bindir"]
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
148
|
+
result = if (bindir = RbConfig::CONFIG["bindir"])
|
|
149
|
+
File.join(bindir, "ruby")
|
|
150
|
+
else
|
|
151
|
+
"ruby"
|
|
152
|
+
end
|
|
140
153
|
result = result.gsub("/", "\\").concat(".exe") if bat?
|
|
141
154
|
result
|
|
142
155
|
end
|
data/lib/busser/command/suite.rb
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
1
|
#
|
|
3
2
|
# Author:: Fletcher Nichol (<fnichol@nichol.ca>)
|
|
4
3
|
#
|
|
@@ -16,9 +15,9 @@
|
|
|
16
15
|
# See the License for the specific language governing permissions and
|
|
17
16
|
# limitations under the License.
|
|
18
17
|
|
|
19
|
-
require
|
|
20
|
-
require
|
|
21
|
-
require
|
|
18
|
+
require "busser/thor"
|
|
19
|
+
require "busser/command/suite_cleanup"
|
|
20
|
+
require "busser/command/suite_path"
|
|
22
21
|
|
|
23
22
|
module Busser
|
|
24
23
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
1
|
#
|
|
3
2
|
# Author:: Fletcher Nichol (<fnichol@nichol.ca>)
|
|
4
3
|
#
|
|
@@ -16,7 +15,8 @@
|
|
|
16
15
|
# See the License for the specific language governing permissions and
|
|
17
16
|
# limitations under the License.
|
|
18
17
|
|
|
19
|
-
require
|
|
18
|
+
require "fileutils" unless defined?(FileUtils) # Pathname#rmtree needs it
|
|
19
|
+
require "busser/thor"
|
|
20
20
|
|
|
21
21
|
module Busser
|
|
22
22
|
|
|
@@ -32,7 +32,7 @@ module Busser
|
|
|
32
32
|
if suite_path.directory?
|
|
33
33
|
Pathname.glob(suite_path + "*").each do |dir|
|
|
34
34
|
info "Removing #{dir}"
|
|
35
|
-
dir
|
|
35
|
+
FileUtils.rm_rf(dir)
|
|
36
36
|
end
|
|
37
37
|
else
|
|
38
38
|
info "Suite path directory #{suite_path} does not exist, skipping."
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
1
|
#
|
|
3
2
|
# Author:: Fletcher Nichol (<fnichol@nichol.ca>)
|
|
4
3
|
#
|
|
@@ -16,7 +15,7 @@
|
|
|
16
15
|
# See the License for the specific language governing permissions and
|
|
17
16
|
# limitations under the License.
|
|
18
17
|
|
|
19
|
-
require
|
|
18
|
+
require "busser/thor"
|
|
20
19
|
|
|
21
20
|
module Busser
|
|
22
21
|
|
|
@@ -28,7 +27,7 @@ module Busser
|
|
|
28
27
|
#
|
|
29
28
|
class SuitePath < Busser::Thor::BaseGroup
|
|
30
29
|
|
|
31
|
-
argument :suite_name, :
|
|
30
|
+
argument :suite_name, required: false
|
|
32
31
|
|
|
33
32
|
def path
|
|
34
33
|
say suite_path(suite_name).to_s
|
data/lib/busser/command/test.rb
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
1
|
#
|
|
3
2
|
# Author:: Fletcher Nichol (<fnichol@nichol.ca>)
|
|
4
3
|
#
|
|
@@ -16,8 +15,8 @@
|
|
|
16
15
|
# See the License for the specific language governing permissions and
|
|
17
16
|
# limitations under the License.
|
|
18
17
|
|
|
19
|
-
require
|
|
20
|
-
require
|
|
18
|
+
require "busser/thor"
|
|
19
|
+
require "busser/plugin"
|
|
21
20
|
|
|
22
21
|
module Busser
|
|
23
22
|
|
|
@@ -29,12 +28,13 @@ module Busser
|
|
|
29
28
|
#
|
|
30
29
|
class Test < Busser::Thor::BaseGroup
|
|
31
30
|
|
|
32
|
-
argument :plugins, :
|
|
31
|
+
argument :plugins, type: :array, required: false
|
|
33
32
|
|
|
34
33
|
def perform
|
|
35
34
|
Busser::Plugin.runner_plugins(plugins).each do |runner_path|
|
|
36
35
|
runner = File.basename(runner_path)
|
|
37
36
|
next if skip_runner?(runner)
|
|
37
|
+
|
|
38
38
|
klass = ::Thor::Util.camel_case(runner)
|
|
39
39
|
|
|
40
40
|
banner "Running #{runner} test suite"
|
|
@@ -10,7 +10,7 @@ end
|
|
|
10
10
|
# been saved off
|
|
11
11
|
After do
|
|
12
12
|
ENV.keys.select { |key| key =~ /^_CUKE_/ }.each do |backup_key|
|
|
13
|
-
ENV[backup_key.sub(/^_CUKE_/,
|
|
13
|
+
ENV[backup_key.sub(/^_CUKE_/, "")] = ENV.delete(backup_key)
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
@@ -21,11 +21,3 @@ end
|
|
|
21
21
|
def restore_envvar(key)
|
|
22
22
|
ENV[key] = ENV.delete("_CUKE_#{key}")
|
|
23
23
|
end
|
|
24
|
-
|
|
25
|
-
def unbundlerize
|
|
26
|
-
keys = %w[BUNDLER_EDITOR BUNDLE_BIN_PATH BUNDLE_GEMFILE RUBYOPT]
|
|
27
|
-
|
|
28
|
-
keys.each { |key| backup_envvar(key) ; ENV.delete(key) }
|
|
29
|
-
yield
|
|
30
|
-
keys.each { |key| restore_envvar(key) }
|
|
31
|
-
end
|