aruba 1.0.4 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +60 -2
- data/CONTRIBUTING.md +18 -22
- data/README.md +13 -18
- data/exe/aruba +2 -2
- data/lib/aruba.rb +1 -1
- data/lib/aruba/api.rb +11 -11
- data/lib/aruba/api/bundler.rb +2 -1
- data/lib/aruba/api/commands.rb +7 -7
- data/lib/aruba/api/core.rb +33 -29
- data/lib/aruba/api/environment.rb +2 -2
- data/lib/aruba/api/filesystem.rb +35 -14
- data/lib/aruba/api/text.rb +4 -4
- data/lib/aruba/aruba_path.rb +2 -2
- data/lib/aruba/basic_configuration.rb +11 -11
- data/lib/aruba/cli.rb +7 -7
- data/lib/aruba/command.rb +4 -4
- data/lib/aruba/config/jruby.rb +9 -9
- data/lib/aruba/config_wrapper.rb +2 -2
- data/lib/aruba/configuration.rb +14 -14
- data/lib/aruba/console.rb +11 -11
- data/lib/aruba/console/help.rb +5 -5
- data/lib/aruba/contracts/absolute_path.rb +1 -1
- data/lib/aruba/contracts/enum.rb +1 -1
- data/lib/aruba/contracts/is_power_of_two.rb +1 -1
- data/lib/aruba/contracts/relative_path.rb +1 -1
- data/lib/aruba/cucumber.rb +8 -7
- data/lib/aruba/cucumber/command.rb +187 -143
- data/lib/aruba/cucumber/environment.rb +7 -7
- data/lib/aruba/cucumber/file.rb +7 -3
- data/lib/aruba/cucumber/hooks.rb +29 -29
- data/lib/aruba/cucumber/parameter_types.rb +1 -0
- data/lib/aruba/cucumber/testing_frameworks.rb +18 -18
- data/lib/aruba/event_bus.rb +4 -4
- data/lib/aruba/event_bus/name_resolver.rb +5 -5
- data/lib/aruba/file_size.rb +1 -1
- data/lib/aruba/generators/script_file.rb +2 -2
- data/lib/aruba/in_config_wrapper.rb +1 -1
- data/lib/aruba/initializer.rb +10 -10
- data/lib/aruba/matchers/base/base_matcher.rb +1 -1
- data/lib/aruba/matchers/base/message_indenter.rb +1 -1
- data/lib/aruba/matchers/base/object_formatter.rb +2 -2
- data/lib/aruba/matchers/collection.rb +1 -1
- data/lib/aruba/matchers/collection/all.rb +1 -1
- data/lib/aruba/matchers/collection/include_an_object.rb +2 -2
- data/lib/aruba/matchers/command.rb +1 -1
- data/lib/aruba/matchers/command/be_successfully_executed.rb +4 -4
- data/lib/aruba/matchers/command/have_finished_in_time.rb +1 -1
- data/lib/aruba/matchers/command/have_output.rb +1 -1
- data/lib/aruba/matchers/directory.rb +1 -1
- data/lib/aruba/matchers/directory/be_an_existing_directory.rb +2 -2
- data/lib/aruba/matchers/directory/have_sub_directory.rb +3 -3
- data/lib/aruba/matchers/environment.rb +1 -1
- data/lib/aruba/matchers/file.rb +1 -1
- data/lib/aruba/matchers/file/be_a_command_found_in_path.rb +1 -1
- data/lib/aruba/matchers/file/be_an_existing_executable.rb +2 -2
- data/lib/aruba/matchers/file/be_an_existing_file.rb +2 -2
- data/lib/aruba/matchers/file/have_file_content.rb +1 -1
- data/lib/aruba/matchers/file/have_file_size.rb +1 -1
- data/lib/aruba/matchers/file/have_same_file_content.rb +2 -2
- data/lib/aruba/matchers/path.rb +1 -1
- data/lib/aruba/matchers/path/a_path_matching_pattern.rb +1 -1
- data/lib/aruba/matchers/path/be_an_absolute_path.rb +1 -1
- data/lib/aruba/matchers/path/be_an_existing_path.rb +1 -1
- data/lib/aruba/matchers/path/have_permissions.rb +2 -2
- data/lib/aruba/matchers/string.rb +1 -1
- data/lib/aruba/matchers/string/include_output_string.rb +1 -1
- data/lib/aruba/matchers/string/match_output_string.rb +1 -1
- data/lib/aruba/matchers/string/output_string_eq.rb +1 -1
- data/lib/aruba/platform.rb +2 -2
- data/lib/aruba/platforms/announcer.rb +14 -14
- data/lib/aruba/platforms/aruba_fixed_size_file_creator.rb +1 -1
- data/lib/aruba/platforms/aruba_logger.rb +1 -1
- data/lib/aruba/platforms/command_monitor.rb +5 -5
- data/lib/aruba/platforms/determine_disk_usage.rb +1 -1
- data/lib/aruba/platforms/filesystem_status.rb +1 -1
- data/lib/aruba/platforms/simple_table.rb +1 -1
- data/lib/aruba/platforms/unix_command_string.rb +2 -2
- data/lib/aruba/platforms/unix_platform.rb +23 -23
- data/lib/aruba/platforms/unix_which.rb +1 -1
- data/lib/aruba/platforms/windows_command_string.rb +2 -2
- data/lib/aruba/platforms/windows_environment_variables.rb +2 -2
- data/lib/aruba/platforms/windows_platform.rb +6 -8
- data/lib/aruba/platforms/windows_which.rb +5 -5
- data/lib/aruba/processes/basic_process.rb +2 -2
- data/lib/aruba/processes/debug_process.rb +5 -5
- data/lib/aruba/processes/in_process.rb +7 -7
- data/lib/aruba/processes/spawn_process.rb +17 -22
- data/lib/aruba/rspec.rb +6 -6
- data/lib/aruba/runtime.rb +6 -6
- data/lib/aruba/setup.rb +3 -3
- data/lib/aruba/version.rb +1 -1
- metadata +75 -29
- data/lib/aruba/tasks/docker_helpers.rb +0 -156
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "aruba/platform"
|
2
2
|
|
3
3
|
# Aruba
|
4
4
|
module Aruba
|
@@ -96,7 +96,7 @@ module Aruba
|
|
96
96
|
|
97
97
|
environment_change = { old: old_environment,
|
98
98
|
new: new_environment,
|
99
|
-
changed: { name: name, value:
|
99
|
+
changed: { name: name, value: "" } }
|
100
100
|
aruba.event_bus.notify Events::ChangedEnvironmentVariable.new(environment_change)
|
101
101
|
|
102
102
|
self
|
data/lib/aruba/api/filesystem.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
require
|
1
|
+
require "pathname"
|
2
2
|
|
3
|
-
require
|
3
|
+
require "aruba/platform"
|
4
4
|
|
5
|
-
Aruba.platform.require_matching_files(
|
6
|
-
Aruba.platform.require_matching_files(
|
7
|
-
Aruba.platform.require_matching_files(
|
5
|
+
Aruba.platform.require_matching_files("../matchers/file/*.rb", __FILE__)
|
6
|
+
Aruba.platform.require_matching_files("../matchers/directory/*.rb", __FILE__)
|
7
|
+
Aruba.platform.require_matching_files("../matchers/path/*.rb", __FILE__)
|
8
8
|
|
9
9
|
# Aruba
|
10
10
|
module Aruba
|
@@ -67,7 +67,7 @@ module Aruba
|
|
67
67
|
# @return [Array]
|
68
68
|
# List of files and directories
|
69
69
|
def all_paths
|
70
|
-
list(
|
70
|
+
list(".").map { |path| expand_path(path) }
|
71
71
|
end
|
72
72
|
|
73
73
|
# Return all existing files in current directory
|
@@ -75,7 +75,7 @@ module Aruba
|
|
75
75
|
# @return [Array]
|
76
76
|
# List of files
|
77
77
|
def all_files
|
78
|
-
list(
|
78
|
+
list(".").select { |p| file? p }.map { |p| expand_path(p) }
|
79
79
|
end
|
80
80
|
|
81
81
|
# Return all existing directories in current directory
|
@@ -83,7 +83,7 @@ module Aruba
|
|
83
83
|
# @return [Array]
|
84
84
|
# List of files
|
85
85
|
def all_directories
|
86
|
-
list(
|
86
|
+
list(".").select { |p| directory? p }.map { |p| expand_path(p) }
|
87
87
|
end
|
88
88
|
|
89
89
|
# Create directory object
|
@@ -108,8 +108,8 @@ module Aruba
|
|
108
108
|
%(Only directories are supported. Path "#{name}" is not a directory.)
|
109
109
|
end
|
110
110
|
|
111
|
-
existing_files = Dir.glob(expand_path(File.join(name,
|
112
|
-
current_working_directory = Pathname.new(expand_path(
|
111
|
+
existing_files = Dir.glob(expand_path(File.join(name, "**", "*")))
|
112
|
+
current_working_directory = Pathname.new(expand_path("."))
|
113
113
|
|
114
114
|
existing_files.map do |d|
|
115
115
|
Pathname.new(d).relative_path_from(current_working_directory).to_s
|
@@ -191,7 +191,7 @@ module Aruba
|
|
191
191
|
end
|
192
192
|
|
193
193
|
if source.count > 1 && exist?(destination) && !directory?(destination)
|
194
|
-
raise ArgumentError,
|
194
|
+
raise ArgumentError, "Multiples sources can only be copied to a directory"
|
195
195
|
end
|
196
196
|
|
197
197
|
source_paths = source.map { |f| expand_path(f) }
|
@@ -240,7 +240,7 @@ module Aruba
|
|
240
240
|
end
|
241
241
|
|
242
242
|
if source.count > 1 && exist?(destination) && !directory?(destination)
|
243
|
-
raise ArgumentError,
|
243
|
+
raise ArgumentError, "Multiple sources can only be copied to a directory"
|
244
244
|
end
|
245
245
|
|
246
246
|
source_paths = source.map { |f| expand_path(f) }
|
@@ -326,8 +326,29 @@ module Aruba
|
|
326
326
|
def append_to_file(file_name, file_content)
|
327
327
|
file_name = expand_path(file_name)
|
328
328
|
|
329
|
-
|
330
|
-
|
329
|
+
File.open(file_name, "a") { |f| f << file_content }
|
330
|
+
end
|
331
|
+
|
332
|
+
# Append lines to a (text) file. This will make sure a newline is present
|
333
|
+
# between the old content and the new.
|
334
|
+
#
|
335
|
+
# @param [String] file_name
|
336
|
+
# The name of the file to be used
|
337
|
+
#
|
338
|
+
# @param [String] file_content
|
339
|
+
# The lines which should be appended to file
|
340
|
+
def append_lines_to_file(file_name, file_content)
|
341
|
+
file_name = expand_path(file_name)
|
342
|
+
|
343
|
+
last = File.open(file_name) do |f|
|
344
|
+
f.seek(-3, IO::SEEK_END)
|
345
|
+
f.read
|
346
|
+
end
|
347
|
+
|
348
|
+
File.open(file_name, "a") do |f|
|
349
|
+
f << "\n" unless last.end_with? "\n"
|
350
|
+
f << file_content
|
351
|
+
end
|
331
352
|
end
|
332
353
|
|
333
354
|
# Create a directory in current directory
|
data/lib/aruba/api/text.rb
CHANGED
@@ -30,9 +30,9 @@ module Aruba
|
|
30
30
|
# Input
|
31
31
|
def extract_text(text)
|
32
32
|
text
|
33
|
-
.gsub(/(?:\e|\033)\[\d+(?>(;\d+)*)m/,
|
34
|
-
.gsub(/\\\[|\\\]/,
|
35
|
-
.gsub(/\007|\016|\017/,
|
33
|
+
.gsub(/(?:\e|\033)\[\d+(?>(;\d+)*)m/, "")
|
34
|
+
.gsub(/\\\[|\\\]/, "")
|
35
|
+
.gsub(/\007|\016|\017/, "")
|
36
36
|
end
|
37
37
|
|
38
38
|
# Unescape special characters and remove ANSI characters
|
@@ -51,7 +51,7 @@ module Aruba
|
|
51
51
|
# @param [#to_s] text
|
52
52
|
# The text to parse
|
53
53
|
def replace_variables(text)
|
54
|
-
if text.include?
|
54
|
+
if text.include? "<pid-last-command-started>"
|
55
55
|
text = text.gsub(/<pid-last-command-started>/, last_command_started.pid.to_s)
|
56
56
|
end
|
57
57
|
|
data/lib/aruba/aruba_path.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "pathname"
|
2
2
|
|
3
3
|
# Aruba
|
4
4
|
module Aruba
|
@@ -57,7 +57,7 @@ module Aruba
|
|
57
57
|
# Get path
|
58
58
|
def to_pathname
|
59
59
|
current_path = @obj.inject do |path, element|
|
60
|
-
if element.start_with?(
|
60
|
+
if element.start_with?("~") ||
|
61
61
|
Aruba.platform.absolute_path?(element)
|
62
62
|
element
|
63
63
|
else
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require "contracts"
|
2
|
+
require "aruba/basic_configuration/option"
|
3
|
+
require "aruba/in_config_wrapper"
|
4
4
|
|
5
5
|
# Aruba
|
6
6
|
module Aruba
|
@@ -26,7 +26,7 @@ module Aruba
|
|
26
26
|
# @option [Object] default
|
27
27
|
# The default value
|
28
28
|
def option_reader(name, type:, default: nil)
|
29
|
-
raise ArgumentError,
|
29
|
+
raise ArgumentError, "Either use block or default value" if block_given? && default
|
30
30
|
|
31
31
|
add_option(name, block_given? ? yield(InConfigWrapper.new(known_options)) : default)
|
32
32
|
|
@@ -46,7 +46,7 @@ module Aruba
|
|
46
46
|
# The default value
|
47
47
|
#
|
48
48
|
def option_accessor(name, type:, default: nil)
|
49
|
-
raise ArgumentError,
|
49
|
+
raise ArgumentError, "Either use block or default value" if block_given? && default
|
50
50
|
|
51
51
|
# Add writer
|
52
52
|
add_option(name, block_given? ? yield(InConfigWrapper.new(known_options)) : default)
|
@@ -110,8 +110,8 @@ module Aruba
|
|
110
110
|
# @yield
|
111
111
|
# The code block which should be run. This is a configure time only option
|
112
112
|
def before(name, &block)
|
113
|
-
name = format(
|
114
|
-
raise ArgumentError,
|
113
|
+
name = format("%s_%s", "before_", name.to_s).to_sym
|
114
|
+
raise ArgumentError, "A block is required" unless block
|
115
115
|
|
116
116
|
@hooks.append(name, block)
|
117
117
|
|
@@ -129,7 +129,7 @@ module Aruba
|
|
129
129
|
# @param [Array] args
|
130
130
|
# Arguments for the run of hook
|
131
131
|
def run_before_hook(name, context, *args)
|
132
|
-
name = format(
|
132
|
+
name = format("%s_%s", "before_", name.to_s).to_sym
|
133
133
|
|
134
134
|
@hooks.execute(name, context, *args)
|
135
135
|
end
|
@@ -142,8 +142,8 @@ module Aruba
|
|
142
142
|
# @yield
|
143
143
|
# The code block which should be run. This is a configure time only option
|
144
144
|
def after(name, &block)
|
145
|
-
name = format(
|
146
|
-
raise ArgumentError,
|
145
|
+
name = format("%s_%s", "after_", name.to_s).to_sym
|
146
|
+
raise ArgumentError, "A block is required" unless block
|
147
147
|
|
148
148
|
@hooks.append(name, block)
|
149
149
|
|
@@ -161,7 +161,7 @@ module Aruba
|
|
161
161
|
# @param [Array] args
|
162
162
|
# Arguments for the run of hook
|
163
163
|
def run_after_hook(name, context, *args)
|
164
|
-
name = format(
|
164
|
+
name = format("%s_%s", "after_", name.to_s).to_sym
|
165
165
|
|
166
166
|
@hooks.execute(name, context, *args)
|
167
167
|
end
|
data/lib/aruba/cli.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require "thor"
|
2
|
+
require "aruba/console"
|
3
|
+
require "aruba/initializer"
|
4
4
|
|
5
5
|
# Aruba
|
6
6
|
module Aruba
|
@@ -12,16 +12,16 @@ module Aruba
|
|
12
12
|
true
|
13
13
|
end
|
14
14
|
|
15
|
-
desc
|
15
|
+
desc "console", "Start aruba's console"
|
16
16
|
def console
|
17
17
|
Aruba::Console.new.start
|
18
18
|
end
|
19
19
|
|
20
|
-
desc
|
20
|
+
desc "init", "Initialize aruba"
|
21
21
|
option :test_framework,
|
22
|
-
default:
|
22
|
+
default: "cucumber",
|
23
23
|
enum: %w(cucumber rspec minitest),
|
24
|
-
desc:
|
24
|
+
desc: "Choose which test framework to use"
|
25
25
|
def init
|
26
26
|
Aruba::Initializer.new.call(options[:test_framework])
|
27
27
|
end
|
data/lib/aruba/command.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
1
|
+
require "delegate"
|
2
|
+
require "aruba/processes/spawn_process"
|
3
|
+
require "aruba/processes/in_process"
|
4
|
+
require "aruba/processes/debug_process"
|
5
5
|
|
6
6
|
# Aruba
|
7
7
|
module Aruba
|
data/lib/aruba/config/jruby.rb
CHANGED
@@ -1,27 +1,27 @@
|
|
1
|
-
require
|
1
|
+
require "rbconfig"
|
2
2
|
|
3
3
|
# ideas taken from: http://blog.headius.com/2010/03/jruby-startup-time-tips.html
|
4
4
|
Aruba.configure do |config|
|
5
5
|
config.before :command do |command|
|
6
|
-
next unless RUBY_PLATFORM ==
|
6
|
+
next unless RUBY_PLATFORM == "java"
|
7
7
|
|
8
8
|
env = command.environment
|
9
9
|
|
10
|
-
jruby_opts = env[
|
10
|
+
jruby_opts = env["JRUBY_OPTS"] || ""
|
11
11
|
|
12
12
|
# disable JIT since these processes are so short lived
|
13
|
-
jruby_opts = "-X-C #{jruby_opts}" unless jruby_opts.include?
|
13
|
+
jruby_opts = "-X-C #{jruby_opts}" unless jruby_opts.include? "-X-C"
|
14
14
|
|
15
15
|
# Faster startup for jruby
|
16
|
-
jruby_opts = "--dev #{jruby_opts}" unless jruby_opts.include?
|
16
|
+
jruby_opts = "--dev #{jruby_opts}" unless jruby_opts.include? "--dev"
|
17
17
|
|
18
|
-
env[
|
18
|
+
env["JRUBY_OPTS"] = jruby_opts
|
19
19
|
|
20
|
-
if /solaris|sunos/i.match?(RbConfig::CONFIG[
|
21
|
-
java_opts = env[
|
20
|
+
if /solaris|sunos/i.match?(RbConfig::CONFIG["host_os"])
|
21
|
+
java_opts = env["JAVA_OPTS"] || ""
|
22
22
|
|
23
23
|
# force jRuby to use client JVM for faster startup times
|
24
|
-
env[
|
24
|
+
env["JAVA_OPTS"] = "-d32 #{java_opts}" unless java_opts.include?("-d32")
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
data/lib/aruba/config_wrapper.rb
CHANGED
@@ -30,7 +30,7 @@ module Aruba
|
|
30
30
|
# If one method ends with "=", e.g. ":option1=", then notify the event
|
31
31
|
# queue, that the user changes the value of "option1"
|
32
32
|
def method_missing(name, *args, &block)
|
33
|
-
notify(name, args) if name.to_s.end_with?(
|
33
|
+
notify(name, args) if name.to_s.end_with?("=")
|
34
34
|
|
35
35
|
return config.send(name, *args, &block) if config.respond_to? name
|
36
36
|
|
@@ -63,7 +63,7 @@ module Aruba
|
|
63
63
|
event_bus.notify(
|
64
64
|
Events::ChangedConfiguration.new(
|
65
65
|
changed: {
|
66
|
-
name: name.to_s.gsub(/=$/,
|
66
|
+
name: name.to_s.gsub(/=$/, ""),
|
67
67
|
value: args.first
|
68
68
|
}
|
69
69
|
)
|
data/lib/aruba/configuration.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
require
|
1
|
+
require "contracts"
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
3
|
+
require "aruba/version"
|
4
|
+
require "aruba/basic_configuration"
|
5
|
+
require "aruba/in_config_wrapper"
|
6
|
+
require "aruba/hooks"
|
7
7
|
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
8
|
+
require "aruba/contracts/relative_path"
|
9
|
+
require "aruba/contracts/absolute_path"
|
10
|
+
require "aruba/contracts/enum"
|
11
11
|
|
12
|
-
require
|
12
|
+
require "aruba/contracts/is_power_of_two"
|
13
13
|
|
14
14
|
# Aruba
|
15
15
|
module Aruba
|
@@ -21,9 +21,9 @@ module Aruba
|
|
21
21
|
|
22
22
|
option_accessor :working_directory,
|
23
23
|
type: Aruba::Contracts::RelativePath,
|
24
|
-
default:
|
24
|
+
default: "tmp/aruba"
|
25
25
|
|
26
|
-
option_reader :fixtures_path_prefix, type: String, default:
|
26
|
+
option_reader :fixtures_path_prefix, type: String, default: "%"
|
27
27
|
|
28
28
|
option_accessor :exit_timeout, type: Num, default: 15
|
29
29
|
option_accessor :stop_signal, type: Maybe[String], default: nil
|
@@ -36,8 +36,8 @@ module Aruba
|
|
36
36
|
option_accessor :command_runtime_environment, type: Hash, default: {}
|
37
37
|
option_accessor :command_search_paths,
|
38
38
|
type: ArrayOf[String] do |config|
|
39
|
-
[File.join(config.root_directory.value,
|
40
|
-
File.join(config.root_directory.value,
|
39
|
+
[File.join(config.root_directory.value, "bin"),
|
40
|
+
File.join(config.root_directory.value, "exe")]
|
41
41
|
end
|
42
42
|
option_accessor :remove_ansi_escape_sequences, type: Bool, default: true
|
43
43
|
option_accessor :command_launcher,
|
@@ -64,7 +64,7 @@ module Aruba
|
|
64
64
|
type: Aruba::Contracts::IsPowerOfTwo,
|
65
65
|
default: 512
|
66
66
|
option_accessor :console_history_file, type: String,
|
67
|
-
default:
|
67
|
+
default: "~/.aruba_history"
|
68
68
|
|
69
69
|
option_accessor :activate_announcer_on_command_failure,
|
70
70
|
type: ArrayOf[Symbol],
|
data/lib/aruba/console.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
1
|
+
require "irb"
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "aruba/api"
|
4
|
+
require "aruba/console/help"
|
5
5
|
|
6
6
|
# Aruba
|
7
7
|
module Aruba
|
@@ -15,21 +15,21 @@ module Aruba
|
|
15
15
|
ARGV.clear
|
16
16
|
IRB.setup nil
|
17
17
|
|
18
|
-
IRB.conf[:IRB_NAME] =
|
18
|
+
IRB.conf[:IRB_NAME] = "aruba"
|
19
19
|
|
20
20
|
IRB.conf[:PROMPT] = {}
|
21
21
|
IRB.conf[:PROMPT][:ARUBA] = {
|
22
|
-
PROMPT_I:
|
23
|
-
PROMPT_S:
|
24
|
-
PROMPT_C:
|
22
|
+
PROMPT_I: "%N:%03n:%i> ",
|
23
|
+
PROMPT_S: "%N:%03n:%i%l ",
|
24
|
+
PROMPT_C: "%N:%03n:%i* ",
|
25
25
|
RETURN: "# => %s\n"
|
26
26
|
}
|
27
27
|
IRB.conf[:PROMPT_MODE] = :ARUBA
|
28
28
|
|
29
29
|
IRB.conf[:RC] = false
|
30
30
|
|
31
|
-
require
|
32
|
-
require
|
31
|
+
require "irb/completion"
|
32
|
+
require "irb/ext/save-history"
|
33
33
|
IRB.conf[:READLINE] = true
|
34
34
|
IRB.conf[:SAVE_HISTORY] = 1000
|
35
35
|
IRB.conf[:HISTORY_FILE] = Aruba.config.console_history_file
|
@@ -43,14 +43,14 @@ module Aruba
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def inspect
|
46
|
-
|
46
|
+
"nil"
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
50
|
irb = IRB::Irb.new(IRB::WorkSpace.new(context.new))
|
51
51
|
IRB.conf[:MAIN_CONTEXT] = irb.context
|
52
52
|
|
53
|
-
trap(
|
53
|
+
trap("SIGINT") do
|
54
54
|
irb.signal_handle
|
55
55
|
end
|
56
56
|
|
data/lib/aruba/console/help.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "aruba/api"
|
2
2
|
|
3
3
|
# Aruba
|
4
4
|
module Aruba
|
@@ -9,9 +9,9 @@ module Aruba
|
|
9
9
|
# Output help information
|
10
10
|
def aruba_help
|
11
11
|
puts "Aruba Version: #{Aruba::VERSION}"
|
12
|
-
puts
|
13
|
-
puts
|
14
|
-
puts
|
12
|
+
puts "Issue Tracker: https://github.com/cucumber/aruba/issues"
|
13
|
+
puts "Documentation:"
|
14
|
+
puts "* http://www.rubydoc.info/gems/aruba"
|
15
15
|
puts
|
16
16
|
|
17
17
|
nil
|
@@ -20,7 +20,7 @@ module Aruba
|
|
20
20
|
# List available methods in aruba
|
21
21
|
def aruba_methods
|
22
22
|
ms = (Aruba::Api.instance_methods - Module.instance_methods)
|
23
|
-
.each_with_object([]) { |e, a| a << format(
|
23
|
+
.each_with_object([]) { |e, a| a << format("* %s", e) }
|
24
24
|
.sort
|
25
25
|
|
26
26
|
puts "Available Methods:\n#{ms.join("\n")}"
|