module Dokkufy::Utils

Public Class Methods

script(name) click to toggle source
# File lib/dokkufy/utils.rb, line 12
def self.script name
  File.join(scripts_directory, "#{name}.sh")
end
scripts_directory() click to toggle source
# File lib/dokkufy/utils.rb, line 5
def self.scripts_directory
  t = [File.expand_path("#{File.dirname(File.expand_path($0))}/../scripts"),
       "#{Gem.dir}/gems/#{Dokkufy::NAME}-#{Dokkufy::VERSION}/scripts"]
  t.each {|i| return i if File.readable?(i) }
  raise "No scripts found"
end
stable_version() click to toggle source
# File lib/dokkufy/utils.rb, line 16
def self.stable_version
  uri = "https://github.com/progrium/dokku/releases/latest"
  open(uri) do |resp|
    return resp.base_uri.to_s.split("/").last
  end
end