Skip to content

Simple library that helps to find path to a executable.

License

Notifications You must be signed in to change notification settings

DmitryBochkarev/find_binary-crystal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

find_binary GitHub release Build Status

docs

Simple library that helps to find path to a executable.

Installation

Add this to your application's shard.yml:

dependencies:
  find_binary:
    github: DmitryBochkarev/find_binary-crystal

Usage

require "find_binary"

crystal = FindBinary.find("crystal")
if crystal.nil?
  puts "crystal not found"
else
  puts "crystal found: #{crystal}"
  puts `#{crystal} -v`
end

Custom paths

You can provide an additional paths for the search.

build_in_binary = File.join(Dir.current, "vendor/ag")
find_the_silver_searcher = FindBinary.new("ag")
find_the_silver_searcher.append_path(build_in_binary)
silver_searcher = find_the_silver_searcher.find

puts "ag found: #{silver_searcher}"
puts `#{silver_searcher.not_nil!} --version`

Contributing

  1. Fork it (https://github.com/DmitryBochkarev/find_binary-crystal/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

About

Simple library that helps to find path to a executable.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published