Sha256: ee0a7410ae43357a1312ac319e1d308d90143f301ea9466398f8f4f4c85c6879

Contents?: true

Size: 596 Bytes

Versions: 6

Compression:

Stored size: 596 Bytes

Contents

# encoding: UTF-8

module Tetra
  # encapsulates a Tetra kit directory
  class Kit
    include Logging

    def initialize(project)
      @project = project
    end

    # finds an executable in a bin/ subdirectory of kit
    # returns nil if executable cannot be found
    def find_executable(name)
      @project.from_directory do
        Find.find("kit") do |path|
          next unless path =~ %r{(.*bin)/#{name}$}
          result = Regexp.last_match[1]

          log.debug("found #{name} executable in #{result}")
          return result
        end
      end

      nil
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tetra-2.0.1 lib/tetra/kit.rb
tetra-2.0.0 lib/tetra/kit.rb
tetra-1.2.2 lib/tetra/kit.rb
tetra-1.2.1 lib/tetra/kit.rb
tetra-1.2.0 lib/tetra/kit.rb
tetra-1.1.0 lib/tetra/kit.rb