Sha256: 06206bc146819be7e5ecebc026c3eac455a8a3053ebce7fb3431f541fd8cf214

Contents?: true

Size: 737 Bytes

Versions: 3

Compression:

Stored size: 737 Bytes

Contents

require 'shoe/version'

module Shoe
  autoload :Extensions, 'shoe/extensions'
  autoload :Tasks,      'shoe/tasks'

  class << self
    def browse(url)
      system(browser, url)
    end

    def install_tasks(name='*')
      Tasks.define Dir["#{name}.gemspec"].first
    end

    private

    # stolen from hub
    def browser
      if ENV['BROWSER']
        ENV['BROWSER']
      elsif RUBY_PLATFORM.include?('darwin')
        'open'
      elsif command?("xdg-open")
        'xdg-open'
      elsif command?("cygstart")
        'cygstart'
      else
        abort 'Please set $BROWSER to a web launcher to use this command.'
      end
    end

    def command?(name)
      `which #{name} 2>/dev/null`
      $?.success?
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shoe-0.8.0 lib/shoe.rb
shoe-0.7.1 lib/shoe.rb
shoe-0.7.0 lib/shoe.rb