Sha256: 6226aeb705c47a0e088580964e35912b7dbf835c44fe645b41a94b70d3cd8722

Contents?: true

Size: 1019 Bytes

Versions: 16

Compression:

Stored size: 1019 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 new <project directory>
  esruby clean [config.rb]
  esruby build [config.rb]
END
  exit 0
end


case
when ARGV[0] == 'new'
  project_path = ARGV[1]
  show_help_and_exit! unless project_path
  project_path = File.expand_path(project_path)
  raise "directory #{project_path} already exists" if File.exists?(project_path)
  ESRuby.new(project_path)
when ARGV[0] == 'clean'
  config_path = ARGV[1] || 'config.rb'
  show_help_and_exit! if ARGV[2]
  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'
  show_help_and_exit! if ARGV[2]
  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

16 entries across 16 versions & 1 rubygems

Version Path
esruby-0.2.0 bin/esruby
esruby-0.1.5 bin/esruby
esruby-0.1.4 bin/esruby
esruby-0.1.3 bin/esruby
esruby-0.1.2 bin/esruby
esruby-0.1.1 bin/esruby
esruby-0.1.0 bin/esruby
esruby-0.0.11 bin/esruby
esruby-0.0.10 bin/esruby
esruby-0.0.9 bin/esruby
esruby-0.0.8 bin/esruby
esruby-0.0.7 bin/esruby
esruby-0.0.6 bin/esruby
esruby-0.0.5 bin/esruby
esruby-0.0.3 bin/esruby
esruby-0.0.2 bin/esruby