Sha256: acc84764433f348dc6e5320be3ff6d8f4d077623fb4fc7ef80dc0aa54ac323c1

Contents?: true

Size: 675 Bytes

Versions: 1

Compression:

Stored size: 675 Bytes

Contents

#!/usr/bin/env ruby
# %% -*- ruby -*-

require 'esruby'


def show_help_and_exit!
  puts <<END
esruby: compile your favourite Ruby source code for the browser!

Usage:
  esruby clean [config.rb]
  esruby build [config.rb]
END
  exit 0
end


case
when ARGV[0] == 'clean'
  config_path = ARGV[1] || 'config.rb'
  config_path = File.expand_path(config_path)
  show_help_and_exit! unless File.file?(config_path)
  require config_path
  ESRuby.clean
when ARGV[0] == 'build'
  config_path = ARGV[1] || 'config.rb'
  config_path = File.expand_path(config_path)
  show_help_and_exit! unless File.file?(config_path)
  require config_path
  ESRuby.build
else
  show_help_and_exit!
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
esruby-0.0.0 bin/esruby