ehbrs-tools 0.23.1 → 0.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ehbrs/tools/runner/finances/bb_browser.rb +38 -9
  3. data/lib/ehbrs/tools/version.rb +1 -1
  4. data/vendor/aranha-parsers/aranha-parsers.gemspec +2 -2
  5. data/vendor/aranha-parsers/lib/aranha/parsers/rspec.rb +11 -0
  6. data/vendor/aranha-parsers/lib/aranha/parsers/rspec/setup_include.rb +17 -0
  7. data/vendor/aranha-parsers/lib/aranha/parsers/{spec → rspec}/source_target_fixtures_example.rb +0 -0
  8. data/vendor/aranha-parsers/lib/aranha/parsers/version.rb +1 -1
  9. data/vendor/aranha-parsers/spec/lib/rubocop_check_spec.rb +1 -1
  10. data/vendor/aranha-parsers/spec/spec_helper.rb +2 -9
  11. data/vendor/aranha-selenium/aranha-selenium.gemspec +2 -2
  12. data/vendor/aranha-selenium/lib/aranha/selenium/version.rb +1 -1
  13. data/vendor/aranha-selenium/spec/rubocop_check_spec.rb +1 -5
  14. data/vendor/aranha-selenium/spec/spec_helper.rb +2 -98
  15. data/vendor/eac_cli/eac_cli.gemspec +3 -3
  16. data/vendor/eac_cli/lib/eac_cli/config/entry.rb +0 -2
  17. data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
  18. data/vendor/eac_cli/spec/rubocop_spec.rb +1 -1
  19. data/vendor/eac_cli/spec/spec_helper.rb +2 -101
  20. data/vendor/eac_config/eac_config.gemspec +2 -2
  21. data/vendor/eac_config/lib/eac_config/version.rb +1 -1
  22. data/vendor/eac_config/spec/rubocop_spec.rb +1 -1
  23. data/vendor/eac_config/spec/spec_helper.rb +2 -15
  24. data/vendor/eac_docker/eac_docker.gemspec +2 -2
  25. data/vendor/eac_docker/lib/eac_docker/container.rb +7 -3
  26. data/vendor/eac_docker/lib/eac_docker/images/templatized.rb +4 -0
  27. data/vendor/eac_docker/lib/eac_docker/rspec.rb +2 -10
  28. data/vendor/eac_docker/lib/eac_docker/rspec/setup_include.rb +23 -0
  29. data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
  30. data/vendor/eac_docker/spec/rubocop_spec.rb +1 -1
  31. data/vendor/eac_docker/spec/spec_helper.rb +2 -104
  32. data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +4 -4
  33. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
  34. data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +1 -1
  35. data/vendor/eac_ruby_base0/spec/spec_helper.rb +2 -101
  36. data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +1 -1
  37. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/executable.rb +15 -3
  38. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +36 -0
  39. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +39 -0
  40. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/default_setup.rb +18 -0
  41. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup.rb +45 -0
  42. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  43. data/vendor/eac_ruby_utils/spec/rubocop_check_spec.rb +1 -1
  44. data/vendor/eac_ruby_utils/spec/spec_helper.rb +6 -6
  45. data/vendor/ehbrs_ruby_utils/ehbrs_ruby_utils.gemspec +4 -3
  46. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/finances/bb_browser/docker_image.rb +18 -0
  47. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/patches/object/template.rb +6 -0
  48. data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/version.rb +1 -1
  49. data/vendor/ehbrs_ruby_utils/spec/lib/ehbrs_ruby_utils/videos/stream_spec.rb +0 -1
  50. data/vendor/ehbrs_ruby_utils/spec/rubocop_check_spec.rb +1 -1
  51. data/vendor/ehbrs_ruby_utils/spec/spec_helper.rb +2 -101
  52. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/Dockerfile +44 -0
  53. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/Makefile +35 -0
  54. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/README.md +16 -0
  55. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/context/firefox.service +8 -0
  56. data/vendor/ehbrs_ruby_utils/template/ehbrs_ruby_utils/finances/bb_browser/docker_image/context/startbrowser.sh +9 -0
  57. metadata +21 -7
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rubygems'
4
+ require 'eac_ruby_utils/gems_registry/gem'
5
+
6
+ module EacRubyUtils
7
+ # Search in each gem for a class determined by registry and run the method "register" on each
8
+ # found.
9
+ #
10
+ # Example:
11
+ # * The module suffix is `TheClass`;
12
+ # * A gem with name "my-lib" is being analyzed
13
+ # * If a require for "my/lib/the_class" is succesful the class/module `My::Lib::TheClass` will
14
+ # be collected.
15
+ class GemsRegistry
16
+ attr_reader :module_suffix
17
+
18
+ def initialize(module_suffix)
19
+ @module_suffix = module_suffix
20
+ end
21
+
22
+ # @return [Array<EacRubyUtils::GemsRegistry::Gem>]
23
+ def registered
24
+ @registered ||= all_gems.select(&:found?)
25
+ end
26
+
27
+ private
28
+
29
+ # @return [Array<EacRubyUtils::GemsRegistry::Gem>]
30
+ def all_gems
31
+ ::Gem::Specification.map do |gemspec|
32
+ ::EacRubyUtils::GemsRegistry::Gem.new(self, gemspec)
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support/core_ext/string/inflections'
4
+
5
+ module EacRubyUtils
6
+ class GemsRegistry
7
+ class Gem
8
+ attr_reader :registry, :gemspec
9
+
10
+ def initialize(registry, gemspec)
11
+ @registry = registry
12
+ @gemspec = gemspec
13
+ end
14
+
15
+ def found?
16
+ lib_file_found? && registered_module.is_a?(::Module)
17
+ end
18
+
19
+ def lib_file_found?
20
+ gemspec.require_paths.any? do |require_path|
21
+ ::Pathname.new(require_path).expand_path(gemspec.gem_dir).join(path_to_require + '.rb')
22
+ .file?
23
+ end
24
+ end
25
+
26
+ def registered_module
27
+ return nil unless lib_file_found?
28
+
29
+ require path_to_require
30
+ path_to_require.classify.constantize
31
+ end
32
+
33
+ # @return [String]
34
+ def path_to_require
35
+ gemspec.name.gsub('-', '/') + '/' + registry.module_suffix.underscore
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/rspec/setup'
4
+
5
+ module EacRubyUtils
6
+ module Rspec
7
+ class << self
8
+ def default_setup
9
+ @default_setup ||
10
+ raise("Default instance was not set. Use #{self.class.name}.default_setup_create")
11
+ end
12
+
13
+ def default_setup_create(app_root_path, rspec_config = nil)
14
+ @default_setup = ::EacRubyUtils::Rspec::Setup.create(app_root_path, rspec_config)
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/gems_registry'
4
+ require 'eac_ruby_utils/patches/object/if_respond'
5
+ require 'eac_ruby_utils/patches/object/to_pathname'
6
+
7
+ module EacRubyUtils
8
+ module Rspec
9
+ class Setup
10
+ GEMS_REGISTRY_SUFFIX = 'Rspec::SetupInclude'
11
+
12
+ class << self
13
+ def create(app_root_path, rspec_config = nil)
14
+ if rspec_config
15
+ new(app_root_path, rspec_config)
16
+ else
17
+ ::RSpec.configure { |new_rspec_config| new(app_root_path, new_rspec_config) }
18
+ end
19
+ end
20
+ end
21
+
22
+ attr_reader :app_root_path, :rspec_config
23
+
24
+ def initialize(app_root_path, rspec_config)
25
+ @app_root_path = app_root_path.to_pathname
26
+ @rspec_config = rspec_config
27
+ include_registry
28
+ end
29
+
30
+ # @return [EacRubyUtils::GemsRegistry]
31
+ def gems_registry
32
+ @gems_registry ||= ::EacRubyUtils::GemsRegistry.new(GEMS_REGISTRY_SUFFIX)
33
+ end
34
+
35
+ protected
36
+
37
+ def include_registry
38
+ gems_registry.registered.each do |gem|
39
+ singleton_class.include(gem.registered_module)
40
+ gem.registered_module.setup(self) if gem.registered_module.respond_to?(:setup)
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyUtils
4
- VERSION = '0.69.1'
4
+ VERSION = '0.71.0'
5
5
  end
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ::EacRubyGemSupport::Rspec.default.describe_rubocop
3
+ ::EacRubyUtils::Rspec.default_setup.describe_rubocop
@@ -3,13 +3,13 @@
3
3
  $LOAD_PATH.push File.expand_path('../lib', __dir__)
4
4
  require 'tmpdir'
5
5
 
6
+ require 'i18n'
7
+ ::I18n.load_path << ::File.join(__dir__, 'locales/pt-BR.yml')
8
+ ::I18n.locale = 'pt-BR'
9
+
6
10
  RSpec.configure do |config|
7
11
  config.example_status_persistence_file_path = ::File.join(::Dir.tmpdir, 'eac_ruby_utils_rspec')
8
12
 
9
- require 'eac_ruby_gem_support/rspec'
10
- ::EacRubyGemSupport::Rspec.setup(::File.expand_path('..', __dir__), config)
13
+ require 'eac_ruby_utils/rspec/default_setup'
14
+ ::EacRubyUtils::Rspec.default_setup_create(::File.expand_path('..', __dir__), config)
11
15
  end
12
-
13
- require 'i18n'
14
- ::I18n.load_path << ::File.join(__dir__, 'locales/pt-BR.yml')
15
- ::I18n.locale = 'pt-BR'
@@ -14,8 +14,9 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.files = Dir['{lib}/**/*']
16
16
 
17
- s.add_dependency 'eac_ruby_utils', '~> 0.69', '>= 0.69.1'
17
+ s.add_dependency 'eac_ruby_utils', '~> 0.70'
18
+ s.add_dependency 'eac_templates', '~> 0.1', '>= 0.1.1'
18
19
 
19
- s.add_development_dependency 'aranha-parsers', '~> 0.7', '>= 0.7.2'
20
- s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
20
+ s.add_development_dependency 'aranha-parsers', '~> 0.8'
21
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.3'
21
22
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_docker/images/templatized'
4
+ require 'ehbrs_ruby_utils/patches/object/template'
5
+
6
+ module EhbrsRubyUtils
7
+ module Finances
8
+ module BbBrowser
9
+ class DockerImage < ::EacDocker::Images::Templatized
10
+ class << self
11
+ def create
12
+ new.tag(name.variableize)
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_templates/patches/object/template'
4
+
5
+ ::EacTemplates::Searcher.default.included_paths <<
6
+ ::File.expand_path('../../../../template', __dir__)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EhbrsRubyUtils
4
- VERSION = '0.6.0'
4
+ VERSION = '0.7.0'
5
5
  end
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'aranha/parsers/spec/source_target_fixtures_example'
4
3
  require 'ehbrs_ruby_utils/videos/stream'
5
4
 
6
5
  RSpec.describe ::EhbrsRubyUtils::Videos::Stream do
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ::EacRubyGemSupport::Rspec.default.describe_rubocop
3
+ ::EacRubyUtils::Rspec.default_setup.describe_rubocop
@@ -1,103 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # This file was generated by the `rspec --init` command. Conventionally, all
4
- # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
5
- # The generated `.rspec` file contains `--require spec_helper` which will cause
6
- # this file to always be loaded, without a need to explicitly require it in any
7
- # files.
8
- #
9
- # Given that it is always loaded, you are encouraged to keep this file as
10
- # light-weight as possible. Requiring heavyweight dependencies from this file
11
- # will add to the boot time of your test suite on EVERY test run, even for an
12
- # individual file that may not need all of that loaded. Instead, consider making
13
- # a separate helper file that requires the additional dependencies and performs
14
- # the additional setup, and require it from the spec files that actually need
15
- # it.
16
- #
17
- # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
18
- RSpec.configure do |config|
19
- require 'eac_ruby_gem_support/rspec'
20
- ::EacRubyGemSupport::Rspec.setup(::File.expand_path('..', __dir__), config)
21
-
22
- # rspec-expectations config goes here. You can use an alternate
23
- # assertion/expectation library such as wrong or the stdlib/minitest
24
- # assertions if you prefer.
25
- config.expect_with :rspec do |expectations|
26
- # This option will default to `true` in RSpec 4. It makes the `description`
27
- # and `failure_message` of custom matchers include text for helper methods
28
- # defined using `chain`, e.g.:
29
- # be_bigger_than(2).and_smaller_than(4).description
30
- # # => "be bigger than 2 and smaller than 4"
31
- # ...rather than:
32
- # # => "be bigger than 2"
33
- expectations.include_chain_clauses_in_custom_matcher_descriptions = true
34
- end
35
-
36
- # rspec-mocks config goes here. You can use an alternate test double
37
- # library (such as bogus or mocha) by changing the `mock_with` option here.
38
- config.mock_with :rspec do |mocks|
39
- # Prevents you from mocking or stubbing a method that does not exist on
40
- # a real object. This is generally recommended, and will default to
41
- # `true` in RSpec 4.
42
- mocks.verify_partial_doubles = true
43
- end
44
-
45
- # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
46
- # have no way to turn it off -- the option exists only for backwards
47
- # compatibility in RSpec 3). It causes shared context metadata to be
48
- # inherited by the metadata hash of host groups and examples, rather than
49
- # triggering implicit auto-inclusion in groups with matching metadata.
50
- config.shared_context_metadata_behavior = :apply_to_host_groups
51
-
52
- # The settings below are suggested to provide a good initial experience
53
- # with RSpec, but feel free to customize to your heart's content.
54
- # # This allows you to limit a spec run to individual examples or groups
55
- # # you care about by tagging them with `:focus` metadata. When nothing
56
- # # is tagged with `:focus`, all examples get run. RSpec also provides
57
- # # aliases for `it`, `describe`, and `context` that include `:focus`
58
- # # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
59
- # config.filter_run_when_matching :focus
60
- #
61
- # # Allows RSpec to persist some state between runs in order to support
62
- # # the `--only-failures` and `--next-failure` CLI options. We recommend
63
- # # you configure your source control system to ignore this file.
64
- # config.example_status_persistence_file_path = "spec/examples.txt"
65
- #
66
- # # Limits the available syntax to the non-monkey patched syntax that is
67
- # # recommended. For more details, see:
68
- # # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
69
- # # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
70
- # # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
71
- # config.disable_monkey_patching!
72
- #
73
- # # This setting enables warnings. It's recommended, but in some cases may
74
- # # be too noisy due to issues in dependencies.
75
- # config.warnings = true
76
- #
77
- # # Many RSpec users commonly either run the entire suite or an individual
78
- # # file, and it's useful to allow more verbose output when running an
79
- # # individual spec file.
80
- # if config.files_to_run.one?
81
- # # Use the documentation formatter for detailed output,
82
- # # unless a formatter has already been configured
83
- # # (e.g. via a command-line flag).
84
- # config.default_formatter = "doc"
85
- # end
86
- #
87
- # # Print the 10 slowest examples and example groups at the
88
- # # end of the spec run, to help surface which specs are running
89
- # # particularly slow.
90
- # config.profile_examples = 10
91
- #
92
- # # Run specs in random order to surface order dependencies. If you find an
93
- # # order dependency and want to debug it, you can fix the order by providing
94
- # # the seed, which is printed after each run.
95
- # # --seed 1234
96
- # config.order = :random
97
- #
98
- # # Seed global randomization in this process using the `--seed` CLI option.
99
- # # Setting this allows you to use `--seed` to deterministically reproduce
100
- # # test failures related to randomization by passing the same `--seed` value
101
- # # as the one that triggered the failure.
102
- # Kernel.srand config.seed
103
- end
3
+ require 'eac_ruby_utils/rspec/default_setup'
4
+ ::EacRubyUtils::Rspec.default_setup_create(::File.expand_path('..', __dir__))
@@ -0,0 +1,44 @@
1
+ FROM ubuntu:18.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+ ENV USER_UID=1000
5
+ ENV USER_GID=1000
6
+ ENV USERNAME=user
7
+
8
+ # sudo gosu \
9
+
10
+ RUN ln -sf /bin/true /usr/bin/chfn && apt-get update && apt-get install -y \
11
+ libnss3-tools \
12
+ zenity \
13
+ libgtk2.0-0 \
14
+ dbus-x11 \
15
+ yad \
16
+ libcurl3 \
17
+ libdbus-1.3 \
18
+ libxss1 \
19
+ lsb-release \
20
+ net-tools \
21
+ openssl \
22
+ firefox \
23
+ systemd \
24
+ systemd-sysv
25
+
26
+
27
+ ADD https://cloud.gastecnologia.com.br/cef/warsaw/install/GBPCEFwr64.deb /src/warsaw.deb
28
+ RUN groupadd -g ${USER_GID} user && useradd -u ${USER_UID} -g ${USER_GID} -ms /bin/bash user && chown -R user.user /home/user
29
+
30
+ #RUN dpkg -i /w.deb || exit 0
31
+
32
+ COPY context/firefox.service /etc/systemd/system/
33
+ COPY context/startbrowser.sh /usr/local/bin/
34
+
35
+ # systemctl enable warsaw && \
36
+
37
+ RUN mkdir -p /var/run/dbus && \
38
+ systemctl enable firefox && \
39
+ systemctl disable systemd-resolved && systemctl disable systemd-tmpfiles-setup.service
40
+
41
+ STOPSIGNAL SIGRTMIN+3
42
+
43
+
44
+ ENTRYPOINT [ "/sbin/init" ]
@@ -0,0 +1,35 @@
1
+ IMG=jsalatiel/wsbb-podman:latest
2
+ CONTAINER_NAME=wsbb
3
+ DOCKERCMD=sudo podman
4
+
5
+
6
+ USER_UID = $(shell id -u $(USER))
7
+ USER_GID = $(shell id -g $(USER))
8
+ ifeq ($(shell uname),Darwin)
9
+ USER_GID = $(shell id -u $(USER))
10
+ endif
11
+
12
+ build:
13
+ $(DOCKERCMD) build -t ${IMG} .
14
+
15
+ start:
16
+ $(DOCKERCMD) run -d --rm -it --name ${CONTAINER_NAME} \
17
+ --cap-add CAP_AUDIT_WRITE --cap-add CAP_SYS_PTRACE \
18
+ -e USER_UID=$(USER_UID) \
19
+ -e USER_GID=$(USER_GID) \
20
+ -v "$(HOME)/.Xauthority:/home/user/.Xauthority:ro" \
21
+ -v "/tmp/.X11-unix:/tmp/.X11-unix:ro" \
22
+ -v "/etc/machine-id:/etc/machine-id:ro" \
23
+ $(IMG) seg.bb.com.br
24
+ logs:
25
+ $(DOCKERCMD) logs -f ${CONTAINER_NAME}
26
+
27
+ shell:
28
+ $(DOCKERCMD) exec -it ${CONTAINER_NAME} bash
29
+
30
+ stop:
31
+ -$(DOCKERCMD) kill ${CONTAINER_NAME}
32
+
33
+ remove:
34
+ -$(DOCKERCMD) image rm ${CONTAINER_NAME}
35
+
@@ -0,0 +1,16 @@
1
+ # wsbb-podman
2
+ Credits go to farribeiro/wscef-docker and juliohm1978/dockerbb
3
+
4
+
5
+ **make build** to build the container
6
+
7
+ **make start** to run the container ( It may take a while to start firefox - Just wait)
8
+
9
+ When you close firefox the container will be deleted.
10
+
11
+
12
+
13
+
14
+
15
+
16
+