aruba 1.0.0.pre.alpha.2 → 1.0.0.pre.alpha.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/PULL_REQUEST_TEMPLATE.md +2 -1
- data/.rubocop.yml +6 -181
- data/.rubocop_todo.yml +364 -0
- data/.travis.yml +63 -34
- data/.yardopts +3 -0
- data/CHANGELOG.md +1121 -0
- data/CONTRIBUTING.md +179 -78
- data/Gemfile +29 -44
- data/README.md +41 -11
- data/Rakefile +35 -35
- data/appveyor.yml +6 -5
- data/aruba.gemspec +14 -16
- data/bin/console +2 -11
- data/cucumber.yml +0 -7
- data/fixtures/cli-app/README.md +1 -1
- data/fixtures/cli-app/Rakefile +1 -1
- data/fixtures/cli-app/cli-app.gemspec +1 -0
- data/fixtures/cli-app/lib/cli/app/suppress_simple_cov_output.rb +3 -3
- data/fixtures/cli-app/lib/cli/app/version.rb +1 -1
- data/fixtures/empty-app/Rakefile +1 -1
- data/fixtures/empty-app/cli-app.gemspec +1 -0
- data/fixtures/empty-app/lib/cli/app/version.rb +1 -1
- data/fixtures/getting-started-app/Gemfile +1 -1
- data/lib/aruba/api.rb +3 -10
- data/lib/aruba/api/bundler.rb +16 -0
- data/lib/aruba/api/commands.rb +249 -0
- data/lib/aruba/api/core.rb +24 -10
- data/lib/aruba/api/environment.rb +12 -7
- data/lib/aruba/api/filesystem.rb +22 -20
- data/lib/aruba/api/text.rb +3 -9
- data/lib/aruba/aruba_path.rb +3 -18
- data/lib/aruba/basic_configuration.rb +3 -19
- data/lib/aruba/cli.rb +1 -1
- data/lib/aruba/colorizer.rb +33 -33
- data/lib/aruba/command.rb +4 -0
- data/lib/aruba/config_wrapper.rb +1 -1
- data/lib/aruba/configuration.rb +78 -0
- data/lib/aruba/console.rb +5 -5
- data/lib/aruba/console/help.rb +1 -1
- data/lib/aruba/cucumber.rb +0 -1
- data/lib/aruba/cucumber/command.rb +55 -115
- data/lib/aruba/cucumber/environment.rb +1 -1
- data/lib/aruba/cucumber/file.rb +9 -21
- data/lib/aruba/cucumber/hooks.rb +6 -62
- data/lib/aruba/event_bus/name_resolver.rb +1 -2
- data/lib/aruba/hooks.rb +1 -1
- data/lib/aruba/initializer.rb +3 -3
- data/lib/aruba/matchers/base/base_matcher.rb +2 -2
- data/lib/aruba/matchers/base/message_indenter.rb +19 -0
- data/lib/aruba/matchers/base/object_formatter.rb +2 -2
- data/lib/aruba/matchers/collection/include_an_object.rb +7 -9
- data/lib/aruba/matchers/command/be_successfully_executed.rb +2 -4
- data/lib/aruba/matchers/command/have_exit_status.rb +1 -1
- data/lib/aruba/matchers/command/have_finished_in_time.rb +2 -4
- data/lib/aruba/matchers/command/have_output.rb +9 -4
- data/lib/aruba/matchers/command/have_output_on_stderr.rb +1 -1
- data/lib/aruba/matchers/command/have_output_on_stdout.rb +1 -1
- data/lib/aruba/matchers/command/have_output_size.rb +1 -1
- data/lib/aruba/matchers/directory/be_an_existing_directory.rb +4 -6
- data/lib/aruba/matchers/directory/have_sub_directory.rb +4 -6
- data/lib/aruba/matchers/file/be_a_command_found_in_path.rb +2 -4
- data/lib/aruba/matchers/file/be_an_existing_executable.rb +4 -6
- data/lib/aruba/matchers/file/be_an_existing_file.rb +4 -6
- data/lib/aruba/matchers/file/have_file_content.rb +4 -4
- data/lib/aruba/matchers/file/have_file_size.rb +6 -8
- data/lib/aruba/matchers/file/have_same_file_content.rb +9 -12
- data/lib/aruba/matchers/path/a_path_matching_pattern.rb +2 -4
- data/lib/aruba/matchers/path/be_an_absolute_path.rb +3 -5
- data/lib/aruba/matchers/path/be_an_existing_path.rb +4 -6
- data/lib/aruba/matchers/path/have_permissions.rb +6 -8
- data/lib/aruba/matchers/string/include_output_string.rb +8 -10
- data/lib/aruba/matchers/string/match_output_string.rb +9 -11
- data/lib/aruba/matchers/string/output_string_eq.rb +7 -9
- data/lib/aruba/platform.rb +0 -1
- data/lib/aruba/platforms/announcer.rb +26 -70
- data/lib/aruba/platforms/aruba_file_creator.rb +1 -1
- data/lib/aruba/platforms/aruba_fixed_size_file_creator.rb +2 -2
- data/lib/aruba/platforms/aruba_logger.rb +22 -2
- data/lib/aruba/platforms/command_monitor.rb +2 -125
- data/lib/aruba/platforms/filesystem_status.rb +9 -9
- data/lib/aruba/platforms/local_environment.rb +2 -2
- data/lib/aruba/platforms/simple_table.rb +3 -3
- data/lib/aruba/platforms/unix_command_string.rb +7 -4
- data/lib/aruba/platforms/unix_environment_variables.rb +9 -13
- data/lib/aruba/platforms/unix_platform.rb +2 -27
- data/lib/aruba/platforms/unix_which.rb +2 -1
- data/lib/aruba/platforms/windows_command_string.rb +20 -7
- data/lib/aruba/platforms/windows_environment_variables.rb +35 -30
- data/lib/aruba/platforms/windows_which.rb +4 -3
- data/lib/aruba/processes/basic_process.rb +11 -15
- data/lib/aruba/processes/debug_process.rb +5 -0
- data/lib/aruba/processes/in_process.rb +17 -8
- data/lib/aruba/processes/spawn_process.rb +35 -23
- data/lib/aruba/rspec.rb +9 -22
- data/lib/aruba/runtime.rb +7 -5
- data/lib/aruba/setup.rb +6 -4
- data/lib/aruba/tasks/docker_helpers.rb +1 -1
- data/lib/aruba/version.rb +1 -1
- metadata +37 -57
- data/History.md +0 -612
- data/bin/bootstrap +0 -34
- data/fixtures/spawn_process/stderr.sh +0 -3
- data/lib/aruba/api/command.rb +0 -309
- data/lib/aruba/api/deprecated.rb +0 -895
- data/lib/aruba/api/rvm.rb +0 -44
- data/lib/aruba/config.rb +0 -101
- data/lib/aruba/cucumber/rvm.rb +0 -3
- data/lib/aruba/in_process.rb +0 -14
- data/lib/aruba/jruby.rb +0 -4
- data/lib/aruba/matchers/path/match_path_pattern.rb +0 -41
- data/lib/aruba/matchers/rspec_matcher_include_regexp.rb +0 -25
- data/lib/aruba/spawn_process.rb +0 -11
data/lib/aruba/api/rvm.rb
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
require 'aruba/api/environment'
|
2
|
-
require 'aruba/api/command'
|
3
|
-
|
4
|
-
# Aruba
|
5
|
-
module Aruba
|
6
|
-
# Api
|
7
|
-
module Api
|
8
|
-
# RVM
|
9
|
-
#
|
10
|
-
# @deprecated
|
11
|
-
module Rvm
|
12
|
-
# Use a clean rvm gemset
|
13
|
-
#
|
14
|
-
# Please make sure that you've got [rvm](http://rvm.io/) installed.
|
15
|
-
#
|
16
|
-
# @param [String] gemset
|
17
|
-
# The name of the gemset to be used
|
18
|
-
def use_clean_gemset(gemset)
|
19
|
-
run_command_and_stop(%{rvm gemset create "#{gemset}"}, true)
|
20
|
-
if all_stdout =~ /'#{gemset}' gemset created \((.*)\)\./
|
21
|
-
gem_home = Regexp.last_match[1]
|
22
|
-
set_environment_variable('GEM_HOME', gem_home)
|
23
|
-
set_environment_variable('GEM_PATH', gem_home)
|
24
|
-
set_environment_variable('BUNDLE_PATH', gem_home)
|
25
|
-
|
26
|
-
paths = (ENV['PATH'] || "").split(File::PATH_SEPARATOR)
|
27
|
-
paths.unshift(File.join(gem_home, 'bin'))
|
28
|
-
set_environment_variable('PATH', paths.uniq.join(File::PATH_SEPARATOR))
|
29
|
-
|
30
|
-
run_command_and_stop("gem install bundler", true)
|
31
|
-
else
|
32
|
-
raise "I didn't understand rvm's output: #{all_stdout}"
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
# Unset variables used by bundler
|
37
|
-
def unset_bundler_env_vars
|
38
|
-
%w[RUBYOPT BUNDLE_PATH BUNDLE_BIN_PATH BUNDLE_GEMFILE].each do |key|
|
39
|
-
set_environment_variable(key, nil)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
data/lib/aruba/config.rb
DELETED
@@ -1,101 +0,0 @@
|
|
1
|
-
require 'contracts'
|
2
|
-
|
3
|
-
require 'aruba/version'
|
4
|
-
require 'aruba/basic_configuration'
|
5
|
-
require 'aruba/in_config_wrapper'
|
6
|
-
require 'aruba/hooks'
|
7
|
-
|
8
|
-
require 'aruba/contracts/relative_path'
|
9
|
-
require 'aruba/contracts/absolute_path'
|
10
|
-
require 'aruba/contracts/enum'
|
11
|
-
|
12
|
-
require 'aruba/contracts/is_power_of_two'
|
13
|
-
|
14
|
-
# Aruba
|
15
|
-
module Aruba
|
16
|
-
# Aruba Configuration
|
17
|
-
#
|
18
|
-
# This defines the configuration options of aruba
|
19
|
-
class Configuration < BasicConfiguration
|
20
|
-
if Aruba::VERSION >= '1.0.0'
|
21
|
-
option_reader :root_directory, :contract => { None => String }, :default => Dir.getwd
|
22
|
-
else
|
23
|
-
option_accessor :root_directory, :contract => { String => String }, :default => Dir.getwd
|
24
|
-
end
|
25
|
-
|
26
|
-
option_accessor :working_directory, :contract => { Aruba::Contracts::RelativePath => Aruba::Contracts::RelativePath }, :default => 'tmp/aruba'
|
27
|
-
|
28
|
-
option_reader :fixtures_path_prefix, :contract => { None => String }, :default => ?%
|
29
|
-
|
30
|
-
option_accessor :exit_timeout, :contract => { Num => Num }, :default => 15
|
31
|
-
option_accessor :stop_signal, :contract => { Maybe[String] => Maybe[String] }, :default => nil
|
32
|
-
option_accessor :io_wait_timeout, :contract => { Num => Num }, :default => 0.1
|
33
|
-
option_accessor :startup_wait_time, :contract => { Num => Num }, :default => 0
|
34
|
-
option_accessor :fixtures_directories, :contract => { Array => ArrayOf[String] }, :default => %w(features/fixtures spec/fixtures test/fixtures fixtures)
|
35
|
-
option_accessor :command_runtime_environment, :contract => { Hash => Hash }, :default => ENV.to_hash
|
36
|
-
# rubocop:disable Metrics/LineLength
|
37
|
-
option_accessor(:command_search_paths, :contract => { ArrayOf[String] => ArrayOf[String] }) { |config| [File.join(config.root_directory.value, 'bin'), File.join(config.root_directory.value, 'exe')] }
|
38
|
-
# rubocop:enable Metrics/LineLength
|
39
|
-
option_accessor :keep_ansi, :contract => { Bool => Bool }, :default => false
|
40
|
-
option_accessor :remove_ansi_escape_sequences, :contract => { Bool => Bool }, :default => true
|
41
|
-
# rubocop:disable Metrics/LineLength
|
42
|
-
option_accessor :command_launcher, :contract => { Aruba::Contracts::Enum[:in_process, :spawn, :debug] => Aruba::Contracts::Enum[:in_process, :spawn, :debug] }, :default => :spawn
|
43
|
-
option_accessor :main_class, :contract => { Class => Maybe[Class] }, :default => nil
|
44
|
-
|
45
|
-
if Aruba::VERSION >= '1.0.0'
|
46
|
-
option_accessor :home_directory, :contract => { Or[Aruba::Contracts::AbsolutePath, Aruba::Contracts::RelativePath] => Or[Aruba::Contracts::AbsolutePath, Aruba::Contracts::RelativePath] } do |config|
|
47
|
-
File.join(config.root_directory.value, config.working_directory.value)
|
48
|
-
end
|
49
|
-
else
|
50
|
-
option_accessor :home_directory, :contract => { Or[Aruba::Contracts::AbsolutePath, Aruba::Contracts::RelativePath] => Or[Aruba::Contracts::AbsolutePath, Aruba::Contracts::RelativePath] }, :default => ENV['HOME']
|
51
|
-
end
|
52
|
-
|
53
|
-
option_accessor :log_level, :contract => { Aruba::Contracts::Enum[:fatal, :warn, :debug, :info, :error, :unknown, :silent] => Aruba::Contracts::Enum[:fatal, :warn, :debug, :info, :error, :unknown, :silent] }, :default => :info
|
54
|
-
|
55
|
-
# TODO: deprecate this value and replace with "filesystem allocation unit"
|
56
|
-
# equal to 4096 by default. "filesystem allocation unit" would represent
|
57
|
-
# the actual MINIMUM space taken in bytes by a 1-byte file
|
58
|
-
option_accessor :physical_block_size, :contract => { Aruba::Contracts::IsPowerOfTwo => Aruba::Contracts::IsPowerOfTwo }, :default => 512
|
59
|
-
option_accessor :console_history_file, :contract => { String => String }, :default => '~/.aruba_history'
|
60
|
-
|
61
|
-
option_accessor :activate_announcer_on_command_failure, :contract => { ArrayOf[Symbol] => ArrayOf[Symbol] }, :default => []
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
# Aruba
|
66
|
-
module Aruba
|
67
|
-
@config = Configuration.new
|
68
|
-
|
69
|
-
class << self
|
70
|
-
attr_reader :config
|
71
|
-
|
72
|
-
# Configure aruba
|
73
|
-
#
|
74
|
-
# @example How to configure aruba
|
75
|
-
#
|
76
|
-
# Aruba.configure do |config|
|
77
|
-
# config.<option> = <value>
|
78
|
-
# end
|
79
|
-
#
|
80
|
-
def configure(&block)
|
81
|
-
@config.configure(&block)
|
82
|
-
|
83
|
-
self
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
# Aruba
|
89
|
-
module Aruba
|
90
|
-
# Old Config
|
91
|
-
#
|
92
|
-
# @private
|
93
|
-
# @deprecated
|
94
|
-
class Config < Configuration
|
95
|
-
def initialize(*args)
|
96
|
-
warn('The use of "Aruba::Config" is deprecated. Use "Aruba::Configuration" instead.')
|
97
|
-
|
98
|
-
super
|
99
|
-
end
|
100
|
-
end
|
101
|
-
end
|
data/lib/aruba/cucumber/rvm.rb
DELETED
data/lib/aruba/in_process.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
require 'aruba/processes/in_process'
|
2
|
-
require 'aruba/platform'
|
3
|
-
|
4
|
-
# Aruba
|
5
|
-
module Aruba
|
6
|
-
# @deprecated
|
7
|
-
class InProcess < Aruba::Processes::InProcess
|
8
|
-
def initialize(*args)
|
9
|
-
Aruba.platform.deprecated('The use of "Aruba::InProcess" is deprecated. Use "Aruba::Processes::InProcess" instead.')
|
10
|
-
|
11
|
-
super
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
data/lib/aruba/jruby.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
# @!method match_path_pattern(pattern)
|
2
|
-
# This matchers checks if <files>/directories match <pattern>
|
3
|
-
#
|
4
|
-
# @param [String, Regexp] pattern
|
5
|
-
# The pattern to use.
|
6
|
-
#
|
7
|
-
# @return [TrueClass, FalseClass] The result
|
8
|
-
#
|
9
|
-
# false:
|
10
|
-
# * if there are no files/directories which match the pattern
|
11
|
-
# true:
|
12
|
-
# * if there are files/directories which match the pattern
|
13
|
-
#
|
14
|
-
# @example Use matcher with regex
|
15
|
-
#
|
16
|
-
# RSpec.describe do
|
17
|
-
# it { expect(Dir.glob(**/*)).to match_file_pattern(/.txt$/) }
|
18
|
-
# end
|
19
|
-
#
|
20
|
-
# @example Use matcher with string
|
21
|
-
#
|
22
|
-
# RSpec.describe do
|
23
|
-
# it { expect(Dir.glob(**/*)).to match_file_pattern('.txt$') }
|
24
|
-
# end
|
25
|
-
RSpec::Matchers.define :match_path_pattern do |_|
|
26
|
-
match do |actual|
|
27
|
-
Aruba.platform.deprecated('The use of `expect().to match_path_pattern` is deprecated. Please use `expect().to include pattern /regex/` instead.')
|
28
|
-
|
29
|
-
next !actual.select { |a| a == expected }.empty? if expected.is_a? String
|
30
|
-
|
31
|
-
!actual.grep(expected).empty?
|
32
|
-
end
|
33
|
-
|
34
|
-
failure_message do |actual|
|
35
|
-
format("expected that path \"%s\" matches pattern \"%s\".", actual.join(", "), expected)
|
36
|
-
end
|
37
|
-
|
38
|
-
failure_message_when_negated do |actual|
|
39
|
-
format("expected that path \"%s\" does not match pattern \"%s\".", actual.join(", "), expected)
|
40
|
-
end
|
41
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# @!method include_regexp(regexp)
|
2
|
-
# This matchers checks if items of an <array> matches regexp
|
3
|
-
#
|
4
|
-
# @param [Regexp] regexp
|
5
|
-
# The regular expression to use
|
6
|
-
#
|
7
|
-
# @return [TrueClass, FalseClass] The result
|
8
|
-
#
|
9
|
-
# false:
|
10
|
-
# * if regexp does not match
|
11
|
-
# true:
|
12
|
-
# * if regexp matches
|
13
|
-
#
|
14
|
-
# @example Use matcher
|
15
|
-
#
|
16
|
-
# RSpec.describe do
|
17
|
-
# it { expect(%w(asdf qwert)).to include_regexp(/asdf/) }
|
18
|
-
# end
|
19
|
-
RSpec::Matchers.define :include_regexp do |expected|
|
20
|
-
match do |actual|
|
21
|
-
Aruba.platform.deprecated('The use of "include_regexp"-matchers is deprecated. It will be removed soon.')
|
22
|
-
|
23
|
-
!actual.grep(expected).empty?
|
24
|
-
end
|
25
|
-
end
|
data/lib/aruba/spawn_process.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
require 'aruba/processes/spawn_process'
|
2
|
-
|
3
|
-
module Aruba
|
4
|
-
class SpawnProcess < Aruba::Processes::SpawnProcess
|
5
|
-
def initialize(*args)
|
6
|
-
warn('The use of "Aruba::SpawnProcess" is deprecated. Use "Aruba::Processes::SpawnProcess" instead.')
|
7
|
-
|
8
|
-
super
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|