Sha256: b51e2781626f51945268e1f504031a06d5fabdd077b77a4b3293b53138c920d5

Contents?: true

Size: 695 Bytes

Versions: 2

Compression:

Stored size: 695 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

ENV["SKIP_CRUD_SETUP"] = "true"
require "rails/crud/tools/cli"

def display_help
  puts <<~HELP
    Usage: crud [command]

    Commands:
      init    Initialize by generating CRUD and config files
      gen crud    Generate CRUD file
      gen config  Generate config file
      help    Display this help message
  HELP
end

if ARGV.empty? || ARGV.include?("help")
  display_help
elsif ARGV.include?("init")
  RailsCrudTools::CLI.init
elsif ARGV == %w[gen crud]
  RailsCrudTools::CLI.generate_crud_file
elsif ARGV == %w[gen config]
  RailsCrudTools::CLI.generate_crud_config
else
  puts "Unknown command: #{ARGV.join(" ")}"
  display_help
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails-crud-tools-0.6.10 exe/crud
rails-crud-tools-0.6.9 exe/crud