Module: Encruby

Defined in:
lib/encruby.rb,
lib/encruby/cli.rb,
lib/encruby/file.rb,
lib/encruby/message.rb,
lib/encruby/version.rb

Defined Under Namespace

Classes: CLI, Error, File, Message

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.bin_pathObject



17
18
19
20
21
22
23
# File 'lib/encruby.rb', line 17

def self.bin_path
  exes = ENV['PATH'].split(":").map do |p|
    path = Pathname.new(p).join(self.class.name.downcase)
    path if path.executable?
  end.compact
  exes.any? ? exes.min : Encruby.root.join("exe", "encruby")
end

.rootObject



13
14
15
# File 'lib/encruby.rb', line 13

def self.root
  Pathname.new(__FILE__).dirname.dirname
end

.shebangObject



25
26
27
# File 'lib/encruby.rb', line 25

def self.shebang
  "#!#{bin_path} exec --verify"
end