aruba 1.0.2 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +54 -2
- data/CONTRIBUTING.md +18 -22
- data/README.md +7 -8
- data/exe/aruba +2 -2
- data/lib/aruba.rb +1 -1
- data/lib/aruba/api.rb +11 -12
- data/lib/aruba/api/bundler.rb +19 -3
- data/lib/aruba/api/commands.rb +11 -11
- data/lib/aruba/api/core.rb +21 -21
- data/lib/aruba/api/environment.rb +2 -2
- data/lib/aruba/api/filesystem.rb +41 -15
- data/lib/aruba/api/text.rb +4 -4
- data/lib/aruba/aruba_path.rb +3 -4
- data/lib/aruba/basic_configuration.rb +51 -69
- 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 +36 -46
- data/lib/aruba/console.rb +11 -11
- data/lib/aruba/console/help.rb +7 -7
- 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 +7 -7
- data/lib/aruba/cucumber/command.rb +41 -49
- 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/testing_frameworks.rb +18 -18
- data/lib/aruba/event_bus.rb +4 -4
- data/lib/aruba/event_bus/name_resolver.rb +4 -4
- 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 +2 -2
- 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 +5 -4
- 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 +15 -15
- data/lib/aruba/platforms/aruba_fixed_size_file_creator.rb +1 -1
- data/lib/aruba/platforms/aruba_logger.rb +11 -10
- data/lib/aruba/platforms/command_monitor.rb +6 -8
- data/lib/aruba/platforms/determine_disk_usage.rb +2 -4
- data/lib/aruba/platforms/filesystem_status.rb +20 -14
- data/lib/aruba/platforms/simple_table.rb +1 -1
- data/lib/aruba/platforms/unix_command_string.rb +2 -2
- data/lib/aruba/platforms/unix_environment_variables.rb +1 -1
- 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 +1 -1
- data/lib/aruba/platforms/windows_platform.rb +7 -7
- data/lib/aruba/platforms/windows_which.rb +5 -5
- data/lib/aruba/processes/basic_process.rb +4 -4
- data/lib/aruba/processes/debug_process.rb +5 -5
- data/lib/aruba/processes/in_process.rb +8 -8
- data/lib/aruba/processes/spawn_process.rb +18 -23
- 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 +103 -88
- data/.cucumberproignore +0 -3
- data/.document +0 -5
- data/.github/ISSUE_TEMPLATE.md +0 -48
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -41
- data/.gitignore +0 -38
- data/.rspec +0 -3
- data/.rubocop.yml +0 -52
- data/.rubocop_todo.yml +0 -216
- data/.simplecov +0 -36
- data/.travis.yml +0 -62
- data/.yardopts +0 -11
- data/Dockerfile +0 -67
- data/Gemfile +0 -14
- data/Rakefile +0 -82
- data/TODO.md +0 -13
- data/appveyor.yml +0 -28
- data/aruba.gemspec +0 -57
- data/bin/console +0 -7
- data/bin/test +0 -9
- data/config/.gitignore +0 -1
- data/cucumber.yml +0 -6
- data/docker-compose.yml +0 -26
- data/fixtures/cli-app/.gitignore +0 -9
- data/fixtures/cli-app/.rspec +0 -2
- data/fixtures/cli-app/README.md +0 -39
- data/fixtures/cli-app/Rakefile +0 -1
- data/fixtures/cli-app/bin/aruba-test-cli +0 -6
- data/fixtures/cli-app/cli-app.gemspec +0 -26
- data/fixtures/cli-app/features/support/aruba.rb +0 -1
- data/fixtures/cli-app/features/support/env.rb +0 -1
- data/fixtures/cli-app/lib/cli/app.rb +0 -9
- data/fixtures/cli-app/lib/cli/app/suppress_simple_cov_output.rb +0 -15
- data/fixtures/cli-app/lib/cli/app/version.rb +0 -5
- data/fixtures/cli-app/script/console +0 -14
- data/fixtures/cli-app/spec/spec_helper.rb +0 -8
- data/fixtures/cli-app/spec/support/aruba.rb +0 -1
- data/fixtures/copy/file.txt +0 -1
- data/fixtures/empty-app/.gitignore +0 -9
- data/fixtures/empty-app/.rspec +0 -2
- data/fixtures/empty-app/README.md +0 -24
- data/fixtures/empty-app/Rakefile +0 -1
- data/fixtures/empty-app/cli-app.gemspec +0 -26
- data/fixtures/empty-app/lib/cli/app.rb +0 -7
- data/fixtures/empty-app/lib/cli/app/version.rb +0 -5
- data/fixtures/getting-started-app/.gitignore +0 -4
- data/fixtures/getting-started-app/Gemfile +0 -4
- data/fixtures/getting-started-app/README.md +0 -3
- data/fixtures/getting-started-app/features/support/env.rb +0 -1
- data/lib/aruba/extensions/string/strip.rb +0 -25
- data/lib/aruba/tasks/docker_helpers.rb +0 -156
data/fixtures/cli-app/Rakefile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'bundler/gem_tasks'
|
@@ -1,26 +0,0 @@
|
|
1
|
-
lib = File.expand_path('lib', __dir__)
|
2
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require 'cli/app/version'
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = 'cli-app'
|
7
|
-
spec.version = Cli::App::VERSION
|
8
|
-
spec.authors = ['Aruba Developers']
|
9
|
-
spec.email = 'cukes@googlegroups.com'
|
10
|
-
|
11
|
-
spec.summary = 'Summary'
|
12
|
-
spec.description = 'Description'
|
13
|
-
spec.homepage = 'http://example.com'
|
14
|
-
|
15
|
-
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
16
|
-
# delete this section to allow pushing this gem to any host.
|
17
|
-
|
18
|
-
spec.files = `git ls-files -z`.split("\x0")
|
19
|
-
.reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
-
spec.bindir = 'exe'
|
21
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
-
spec.require_paths = ['lib']
|
23
|
-
|
24
|
-
spec.add_development_dependency 'bundler', '~> 1.9'
|
25
|
-
spec.add_development_dependency 'rake', '~> 13.0'
|
26
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
require 'aruba/cucumber'
|
@@ -1 +0,0 @@
|
|
1
|
-
require_relative 'aruba'
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module SimpleCov
|
2
|
-
module Formatter
|
3
|
-
class HTMLFormatter
|
4
|
-
def format(result)
|
5
|
-
Dir[File.join(File.dirname(__FILE__), '../public/*')].each do |path|
|
6
|
-
FileUtils.cp_r(path, asset_output_path)
|
7
|
-
end
|
8
|
-
|
9
|
-
File.open(File.join(output_path, 'index.html'), 'wb') do |file|
|
10
|
-
file.puts template('layout').result(binding)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'bundler/setup'
|
4
|
-
require 'cli/app'
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require 'irb'
|
14
|
-
IRB.start
|
@@ -1 +0,0 @@
|
|
1
|
-
require 'aruba/rspec'
|
data/fixtures/copy/file.txt
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
a
|
data/fixtures/empty-app/.rspec
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
# Empty Cli App
|
2
|
-
|
3
|
-
This is a simple test cli app
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
```ruby
|
10
|
-
gem 'cli-app'
|
11
|
-
```
|
12
|
-
|
13
|
-
And then execute:
|
14
|
-
|
15
|
-
$ bundle
|
16
|
-
|
17
|
-
Or install it yourself as:
|
18
|
-
|
19
|
-
$ gem install cli-app
|
20
|
-
|
21
|
-
## Usage
|
22
|
-
|
23
|
-
Place files in `lib/cli/app/`. They are loaded automatically. If you need a
|
24
|
-
specific load order, use `require` in your files.
|
data/fixtures/empty-app/Rakefile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'bundler/gem_tasks'
|
@@ -1,26 +0,0 @@
|
|
1
|
-
lib = File.expand_path('lib', __dir__)
|
2
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require 'cli/app/version'
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = 'cli-app'
|
7
|
-
spec.version = Cli::App::VERSION
|
8
|
-
spec.authors = ['Aruba Developers']
|
9
|
-
spec.email = 'cukes@googlegroups.com'
|
10
|
-
|
11
|
-
spec.summary = 'Summary'
|
12
|
-
spec.description = 'Description'
|
13
|
-
spec.homepage = 'http://example.com'
|
14
|
-
|
15
|
-
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
16
|
-
# delete this section to allow pushing this gem to any host.
|
17
|
-
|
18
|
-
spec.files = `git ls-files -z`.split("\x0")
|
19
|
-
.reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
-
spec.bindir = 'exe'
|
21
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
-
spec.require_paths = ['lib']
|
23
|
-
|
24
|
-
spec.add_development_dependency 'bundler', '~> 1.9'
|
25
|
-
spec.add_development_dependency 'rake', '~> 13.0'
|
26
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
require 'aruba/cucumber'
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# String
|
2
|
-
class String
|
3
|
-
# Strips indentation in heredocs.
|
4
|
-
#
|
5
|
-
# For example in
|
6
|
-
#
|
7
|
-
# if options[:usage]
|
8
|
-
# puts <<-USAGE.strip_heredoc
|
9
|
-
# This command does such and such.
|
10
|
-
#
|
11
|
-
# Supported options are:
|
12
|
-
# -h This message
|
13
|
-
# ...
|
14
|
-
# USAGE
|
15
|
-
# end
|
16
|
-
#
|
17
|
-
# the user would see the usage message aligned against the left margin.
|
18
|
-
#
|
19
|
-
# Technically, it looks for the least indented line in the whole string, and removes
|
20
|
-
# that amount of leading whitespace.
|
21
|
-
def strip_heredoc
|
22
|
-
indent = scan(/^[ \t]*(?=\S)/).min.to_s.size
|
23
|
-
gsub(/^[ \t]{#{indent}}/, '')
|
24
|
-
end
|
25
|
-
end
|
@@ -1,156 +0,0 @@
|
|
1
|
-
require 'psych'
|
2
|
-
|
3
|
-
module Aruba
|
4
|
-
class DockerRunInstance
|
5
|
-
protected
|
6
|
-
|
7
|
-
attr_reader :file, :instance
|
8
|
-
|
9
|
-
public
|
10
|
-
|
11
|
-
def initialize(file, instance)
|
12
|
-
@file = file
|
13
|
-
@instance = instance
|
14
|
-
end
|
15
|
-
|
16
|
-
def method_missing(m, *_args)
|
17
|
-
return @file.public_send m, instance if @file.respond_to?(m)
|
18
|
-
|
19
|
-
super
|
20
|
-
end
|
21
|
-
|
22
|
-
def respond_to_missing?(m)
|
23
|
-
@file.respond_to? m
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
class DockerBuildCommandLineBuilder
|
28
|
-
protected
|
29
|
-
|
30
|
-
attr_reader :run_instance, :opts
|
31
|
-
|
32
|
-
public
|
33
|
-
|
34
|
-
def initialize(run_instance, opts = {})
|
35
|
-
@run_instance = run_instance
|
36
|
-
@opts = opts
|
37
|
-
end
|
38
|
-
|
39
|
-
def to_cli
|
40
|
-
cache = opts[:cache]
|
41
|
-
application_version = opts[:version]
|
42
|
-
docker_file = run_instance.docker_file
|
43
|
-
docker_image = run_instance.image
|
44
|
-
|
45
|
-
cmdline = []
|
46
|
-
cmdline << 'docker'
|
47
|
-
cmdline << 'build'
|
48
|
-
cmdline << '--no-cache=true' if cache == 'false'
|
49
|
-
|
50
|
-
%w(http_proxy https_proxy HTTP_PROXY HTTPS_PROXY).each do |var|
|
51
|
-
next unless ENV.key? var
|
52
|
-
|
53
|
-
proxy_uri = URI(ENV[var])
|
54
|
-
proxy_uri.host = '172.17.0.1'
|
55
|
-
cmdline << "--build-arg #{var}=#{proxy_uri}"
|
56
|
-
end
|
57
|
-
|
58
|
-
cmdline << "-t #{docker_image}:#{application_version}"
|
59
|
-
cmdline << "-f #{docker_file}"
|
60
|
-
cmdline << File.dirname(docker_file)
|
61
|
-
|
62
|
-
cmdline.join(' ')
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
class DockerRunCommandLineBuilder
|
67
|
-
protected
|
68
|
-
|
69
|
-
attr_reader :run_instance, :opts
|
70
|
-
|
71
|
-
public
|
72
|
-
|
73
|
-
def initialize(run_instance, opts = {})
|
74
|
-
@run_instance = run_instance
|
75
|
-
@opts = opts
|
76
|
-
end
|
77
|
-
|
78
|
-
def to_cli
|
79
|
-
volumes = run_instance.volumes
|
80
|
-
image = run_instance.image
|
81
|
-
command = opts[:command]
|
82
|
-
|
83
|
-
cmdline = []
|
84
|
-
cmdline << 'docker'
|
85
|
-
cmdline << 'run'
|
86
|
-
cmdline << '-it'
|
87
|
-
cmdline << '--rm'
|
88
|
-
cmdline << "--name #{run_instance.container_name}"
|
89
|
-
|
90
|
-
volumes.each do |v|
|
91
|
-
cmdline << "-v #{expand_volume_paths(v)}"
|
92
|
-
end
|
93
|
-
|
94
|
-
cmdline << image
|
95
|
-
cmdline << command if command
|
96
|
-
|
97
|
-
cmdline.join(' ')
|
98
|
-
end
|
99
|
-
|
100
|
-
private
|
101
|
-
|
102
|
-
def expand_volume_paths(volume_paths)
|
103
|
-
volume_paths.split(':').map { |path| File.expand_path(path) }.join(':')
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
class DockerComposeFile
|
108
|
-
protected
|
109
|
-
|
110
|
-
attr_reader :data
|
111
|
-
|
112
|
-
public
|
113
|
-
|
114
|
-
def initialize(path)
|
115
|
-
@data = Psych.load_file(path)['services']
|
116
|
-
end
|
117
|
-
|
118
|
-
def volumes(instance)
|
119
|
-
fetch(instance)['volumes']
|
120
|
-
end
|
121
|
-
|
122
|
-
def build_context(instance)
|
123
|
-
fetch(instance).fetch('build', {})['context']
|
124
|
-
end
|
125
|
-
|
126
|
-
def build_arguments(instance)
|
127
|
-
fetch(instance).fetch('build', {})['args']
|
128
|
-
end
|
129
|
-
|
130
|
-
def docker_file(instance)
|
131
|
-
fetch(instance).fetch('build', {})['dockerfile']
|
132
|
-
end
|
133
|
-
|
134
|
-
def image(instance)
|
135
|
-
fetch(instance)['image']
|
136
|
-
end
|
137
|
-
|
138
|
-
def container_name(instance)
|
139
|
-
fetch(instance)['container_name']
|
140
|
-
end
|
141
|
-
|
142
|
-
def command(instance)
|
143
|
-
fetch(instance)['command']
|
144
|
-
end
|
145
|
-
|
146
|
-
def working_directory(instance)
|
147
|
-
fetch(instance)['working_dir']
|
148
|
-
end
|
149
|
-
|
150
|
-
private
|
151
|
-
|
152
|
-
def fetch(instance)
|
153
|
-
Hash(data).fetch(instance.to_s)
|
154
|
-
end
|
155
|
-
end
|
156
|
-
end
|