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