Sha256: 060a2303427ac03c51f4c65efc65f90cef6f53b6d6b41afc94fec77d4c13a0b3

Contents?: true

Size: 1.59 KB

Versions: 67

Compression:

Stored size: 1.59 KB

Contents

# frozen_string_literal: true

require 'avm/eac_generic_base0/sources/base'
require 'avm/eac_ruby_base1/rubygems/version_file'
require 'avm/eac_ruby_base1/sources/runners'
require 'avm/version_number'
require 'eac_ruby_utils/core_ext'

module Avm
  module EacRubyBase1
    module Sources
      class Base < ::Avm::EacGenericBase0::Sources::Base
        RSPEC_TEST_COMMAND = 'rspec'

        require_sub __FILE__, include_modules: :prepend

        # @return [Hash<String, EacRubyUtils::Envs::Command>]
        def default_test_commands
          {
            RSPEC_TEST_COMMAND => rspec_test_command
          }
        end

        # To-do: dismiss this method at Avm::EacRailsBase1::Instance and remove.
        # @return [EacRubyUtils::Envs::BaseEnv]
        def env
          @env.presence || super
        end

        # To-do: dismiss this method at Avm::EacRailsBase1::Instance and remove.
        # @return [Avm::EacRubyBase1::Sources::Base]
        def env_set(env)
          @env = env

          self
        end

        # @return [Avm::EacRubyBase1::Source::Base]
        def ruby_parent
          a_parent = parent

          loop do
            raise 'No Ruby parent found' if a_parent.blank?
            return a_parent if a_parent.is_a?(::Avm::EacRubyBase1::Sources::Base)

            a_parent = a_parent.parent
          end
        end

        # @return [EacRubyUtils::Envs::Command]
        def rspec_test_command
          bundle('exec', 'rspec', '--fail-fast').chdir_root
        end

        def valid?
          gemfile_path.exist? || gemspec_path.present?
        end
      end
    end
  end
end

Version data entries

67 entries across 67 versions & 2 rubygems

Version Path
avm-eac_ruby_base1-0.35.1 lib/avm/eac_ruby_base1/sources/base.rb
eac_tools-0.96.1 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb
avm-eac_ruby_base1-0.35.0 lib/avm/eac_ruby_base1/sources/base.rb
eac_tools-0.95.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb
avm-eac_ruby_base1-0.34.1 lib/avm/eac_ruby_base1/sources/base.rb
eac_tools-0.91.1 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb
avm-eac_ruby_base1-0.34.0 lib/avm/eac_ruby_base1/sources/base.rb
eac_tools-0.91.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb
avm-eac_ruby_base1-0.33.1 lib/avm/eac_ruby_base1/sources/base.rb
eac_tools-0.83.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb
eac_tools-0.82.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb
eac_tools-0.81.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb
avm-eac_ruby_base1-0.33.0 lib/avm/eac_ruby_base1/sources/base.rb
eac_tools-0.80.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb
eac_tools-0.79.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb
avm-eac_ruby_base1-0.32.1 lib/avm/eac_ruby_base1/sources/base.rb
eac_tools-0.78.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb
avm-eac_ruby_base1-0.32.0 lib/avm/eac_ruby_base1/sources/base.rb
eac_tools-0.77.1 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb
eac_tools-0.77.0 sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb