aruba 1.0.2 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +54 -2
  3. data/CONTRIBUTING.md +18 -22
  4. data/README.md +7 -8
  5. data/exe/aruba +2 -2
  6. data/lib/aruba.rb +1 -1
  7. data/lib/aruba/api.rb +11 -12
  8. data/lib/aruba/api/bundler.rb +19 -3
  9. data/lib/aruba/api/commands.rb +11 -11
  10. data/lib/aruba/api/core.rb +21 -21
  11. data/lib/aruba/api/environment.rb +2 -2
  12. data/lib/aruba/api/filesystem.rb +41 -15
  13. data/lib/aruba/api/text.rb +4 -4
  14. data/lib/aruba/aruba_path.rb +3 -4
  15. data/lib/aruba/basic_configuration.rb +51 -69
  16. data/lib/aruba/cli.rb +7 -7
  17. data/lib/aruba/command.rb +4 -4
  18. data/lib/aruba/config/jruby.rb +9 -9
  19. data/lib/aruba/config_wrapper.rb +2 -2
  20. data/lib/aruba/configuration.rb +36 -46
  21. data/lib/aruba/console.rb +11 -11
  22. data/lib/aruba/console/help.rb +7 -7
  23. data/lib/aruba/contracts/absolute_path.rb +1 -1
  24. data/lib/aruba/contracts/enum.rb +1 -1
  25. data/lib/aruba/contracts/is_power_of_two.rb +1 -1
  26. data/lib/aruba/contracts/relative_path.rb +1 -1
  27. data/lib/aruba/cucumber.rb +7 -7
  28. data/lib/aruba/cucumber/command.rb +41 -49
  29. data/lib/aruba/cucumber/environment.rb +7 -7
  30. data/lib/aruba/cucumber/file.rb +7 -3
  31. data/lib/aruba/cucumber/hooks.rb +29 -29
  32. data/lib/aruba/cucumber/testing_frameworks.rb +18 -18
  33. data/lib/aruba/event_bus.rb +4 -4
  34. data/lib/aruba/event_bus/name_resolver.rb +4 -4
  35. data/lib/aruba/file_size.rb +1 -1
  36. data/lib/aruba/generators/script_file.rb +2 -2
  37. data/lib/aruba/in_config_wrapper.rb +1 -1
  38. data/lib/aruba/initializer.rb +10 -10
  39. data/lib/aruba/matchers/base/base_matcher.rb +1 -1
  40. data/lib/aruba/matchers/base/message_indenter.rb +2 -2
  41. data/lib/aruba/matchers/base/object_formatter.rb +2 -2
  42. data/lib/aruba/matchers/collection.rb +1 -1
  43. data/lib/aruba/matchers/collection/all.rb +1 -1
  44. data/lib/aruba/matchers/collection/include_an_object.rb +2 -2
  45. data/lib/aruba/matchers/command.rb +1 -1
  46. data/lib/aruba/matchers/command/be_successfully_executed.rb +4 -4
  47. data/lib/aruba/matchers/command/have_finished_in_time.rb +1 -1
  48. data/lib/aruba/matchers/command/have_output.rb +1 -1
  49. data/lib/aruba/matchers/directory.rb +1 -1
  50. data/lib/aruba/matchers/directory/be_an_existing_directory.rb +2 -2
  51. data/lib/aruba/matchers/directory/have_sub_directory.rb +3 -3
  52. data/lib/aruba/matchers/environment.rb +1 -1
  53. data/lib/aruba/matchers/file.rb +1 -1
  54. data/lib/aruba/matchers/file/be_a_command_found_in_path.rb +1 -1
  55. data/lib/aruba/matchers/file/be_an_existing_executable.rb +2 -2
  56. data/lib/aruba/matchers/file/be_an_existing_file.rb +2 -2
  57. data/lib/aruba/matchers/file/have_file_content.rb +1 -1
  58. data/lib/aruba/matchers/file/have_file_size.rb +1 -1
  59. data/lib/aruba/matchers/file/have_same_file_content.rb +2 -2
  60. data/lib/aruba/matchers/path.rb +1 -1
  61. data/lib/aruba/matchers/path/a_path_matching_pattern.rb +1 -1
  62. data/lib/aruba/matchers/path/be_an_absolute_path.rb +1 -1
  63. data/lib/aruba/matchers/path/be_an_existing_path.rb +1 -1
  64. data/lib/aruba/matchers/path/have_permissions.rb +5 -4
  65. data/lib/aruba/matchers/string.rb +1 -1
  66. data/lib/aruba/matchers/string/include_output_string.rb +1 -1
  67. data/lib/aruba/matchers/string/match_output_string.rb +1 -1
  68. data/lib/aruba/matchers/string/output_string_eq.rb +1 -1
  69. data/lib/aruba/platform.rb +2 -2
  70. data/lib/aruba/platforms/announcer.rb +15 -15
  71. data/lib/aruba/platforms/aruba_fixed_size_file_creator.rb +1 -1
  72. data/lib/aruba/platforms/aruba_logger.rb +11 -10
  73. data/lib/aruba/platforms/command_monitor.rb +6 -8
  74. data/lib/aruba/platforms/determine_disk_usage.rb +2 -4
  75. data/lib/aruba/platforms/filesystem_status.rb +20 -14
  76. data/lib/aruba/platforms/simple_table.rb +1 -1
  77. data/lib/aruba/platforms/unix_command_string.rb +2 -2
  78. data/lib/aruba/platforms/unix_environment_variables.rb +1 -1
  79. data/lib/aruba/platforms/unix_platform.rb +23 -23
  80. data/lib/aruba/platforms/unix_which.rb +1 -1
  81. data/lib/aruba/platforms/windows_command_string.rb +2 -2
  82. data/lib/aruba/platforms/windows_environment_variables.rb +1 -1
  83. data/lib/aruba/platforms/windows_platform.rb +7 -7
  84. data/lib/aruba/platforms/windows_which.rb +5 -5
  85. data/lib/aruba/processes/basic_process.rb +4 -4
  86. data/lib/aruba/processes/debug_process.rb +5 -5
  87. data/lib/aruba/processes/in_process.rb +8 -8
  88. data/lib/aruba/processes/spawn_process.rb +18 -23
  89. data/lib/aruba/rspec.rb +6 -6
  90. data/lib/aruba/runtime.rb +6 -6
  91. data/lib/aruba/setup.rb +3 -3
  92. data/lib/aruba/version.rb +1 -1
  93. metadata +103 -88
  94. data/.cucumberproignore +0 -3
  95. data/.document +0 -5
  96. data/.github/ISSUE_TEMPLATE.md +0 -48
  97. data/.github/PULL_REQUEST_TEMPLATE.md +0 -41
  98. data/.gitignore +0 -38
  99. data/.rspec +0 -3
  100. data/.rubocop.yml +0 -52
  101. data/.rubocop_todo.yml +0 -216
  102. data/.simplecov +0 -36
  103. data/.travis.yml +0 -62
  104. data/.yardopts +0 -11
  105. data/Dockerfile +0 -67
  106. data/Gemfile +0 -14
  107. data/Rakefile +0 -82
  108. data/TODO.md +0 -13
  109. data/appveyor.yml +0 -28
  110. data/aruba.gemspec +0 -57
  111. data/bin/console +0 -7
  112. data/bin/test +0 -9
  113. data/config/.gitignore +0 -1
  114. data/cucumber.yml +0 -6
  115. data/docker-compose.yml +0 -26
  116. data/fixtures/cli-app/.gitignore +0 -9
  117. data/fixtures/cli-app/.rspec +0 -2
  118. data/fixtures/cli-app/README.md +0 -39
  119. data/fixtures/cli-app/Rakefile +0 -1
  120. data/fixtures/cli-app/bin/aruba-test-cli +0 -6
  121. data/fixtures/cli-app/cli-app.gemspec +0 -26
  122. data/fixtures/cli-app/features/support/aruba.rb +0 -1
  123. data/fixtures/cli-app/features/support/env.rb +0 -1
  124. data/fixtures/cli-app/lib/cli/app.rb +0 -9
  125. data/fixtures/cli-app/lib/cli/app/suppress_simple_cov_output.rb +0 -15
  126. data/fixtures/cli-app/lib/cli/app/version.rb +0 -5
  127. data/fixtures/cli-app/script/console +0 -14
  128. data/fixtures/cli-app/spec/spec_helper.rb +0 -8
  129. data/fixtures/cli-app/spec/support/aruba.rb +0 -1
  130. data/fixtures/copy/file.txt +0 -1
  131. data/fixtures/empty-app/.gitignore +0 -9
  132. data/fixtures/empty-app/.rspec +0 -2
  133. data/fixtures/empty-app/README.md +0 -24
  134. data/fixtures/empty-app/Rakefile +0 -1
  135. data/fixtures/empty-app/cli-app.gemspec +0 -26
  136. data/fixtures/empty-app/lib/cli/app.rb +0 -7
  137. data/fixtures/empty-app/lib/cli/app/version.rb +0 -5
  138. data/fixtures/getting-started-app/.gitignore +0 -4
  139. data/fixtures/getting-started-app/Gemfile +0 -4
  140. data/fixtures/getting-started-app/README.md +0 -3
  141. data/fixtures/getting-started-app/features/support/env.rb +0 -1
  142. data/lib/aruba/extensions/string/strip.rb +0 -25
  143. data/lib/aruba/tasks/docker_helpers.rb +0 -156
@@ -1 +0,0 @@
1
- require 'bundler/gem_tasks'
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- $LOAD_PATH << File.expand_path('../lib', __dir__)
4
- require 'cli/app'
5
-
6
- exit 0
@@ -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,9 +0,0 @@
1
- require 'cli/app/version'
2
-
3
- ::Dir.glob(File.expand_path('**/*.rb', __dir__)).each { |f| require_relative f }
4
-
5
- module Cli
6
- module App
7
- # Your code goes here...
8
- end
9
- end
@@ -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,5 +0,0 @@
1
- module Cli
2
- module App
3
- VERSION = '0.1.0'.freeze
4
- end
5
- 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,8 +0,0 @@
1
- $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
2
-
3
- require 'cli/app'
4
-
5
- require_relative 'support/aruba'
6
-
7
- ::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__))
8
- .each { |f| require_relative f }
@@ -1 +0,0 @@
1
- require 'aruba/rspec'
@@ -1 +0,0 @@
1
- a
@@ -1,9 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
@@ -1,2 +0,0 @@
1
- --format documentation
2
- --color
@@ -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.
@@ -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,7 +0,0 @@
1
- require 'cli/app/version'
2
-
3
- module Cli
4
- module App
5
- # Your code goes here...
6
- end
7
- end
@@ -1,5 +0,0 @@
1
- module Cli
2
- module App
3
- VERSION = '0.1.0'.freeze
4
- end
5
- end
@@ -1,4 +0,0 @@
1
- /coverage/
2
- /doc/
3
- /pkg/
4
- /tmp/
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'aruba', path: File.expand_path('../../..', __dir__)
4
- gem 'cucumber'
@@ -1,3 +0,0 @@
1
- # Simple Cli App
2
-
3
- This is a simple app to get started with `aruba`.
@@ -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