Sha256: 49b68e020e9b55e427386a59452c6d10db3da1c035bc64d336eb273f30995fe2

Contents?: true

Size: 775 Bytes

Versions: 7

Compression:

Stored size: 775 Bytes

Contents

module GitCompound
  module Worker
    # Worker that builds components
    #
    class ComponentBuilder < Worker
      def initialize(lock = nil)
        @lock  = lock
        @print = PrettyPrint.new
      end

      def visit_component(component)
        raise GitCompoundError,
              "Destination directory `#{component.path}` " \
              'already exists !' if component.exists?

        Logger.inline 'Building:  '
        @print.visit_component(component)

        component.build!

        raise GitCompoundError,
              "Destination  `#{component.path}` " \
              'verification failed !' unless component.exists?

        return unless @lock
        @lock.lock_component(component) unless @lock.find(component)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
git_compound-0.2.2 lib/git_compound/worker/component_builder.rb
git_compound-0.2.1 lib/git_compound/worker/component_builder.rb
git_compound-0.2.0 lib/git_compound/worker/component_builder.rb
git_compound-0.1.2 lib/git_compound/worker/component_builder.rb
git_compound-0.1.1 lib/git_compound/worker/component_builder.rb
git_compound-0.1.0 lib/git_compound/worker/component_builder.rb
git_compound-0.0.10 lib/git_compound/worker/component_builder.rb