Class: ZephyrRb::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/cli.rb

Class Method Summary collapse

Class Method Details

.buildObject



27
28
29
30
31
32
33
34
# File 'lib/cli.rb', line 27

def build
  puts "🔨 Building ZephyrRb v#{VERSION}..."
  puts "📦 Bundling Ruby WASM #{RUBY_WASM_VERSION}..."

  Builder.new.build

  puts "✅ Build complete!"
end

.run(args) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/cli.rb', line 11

def run(args)
  command = args[0]

  case command
  when 'build'
    build
  when 'version', '-v', '--version'
    puts "ZephyrRb v#{VERSION}"
  when 'help', '-h', '--help', nil
    show_help
  else
    puts "Unknown command: #{command}"
    show_help
  end
end

.show_helpObject



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/cli.rb', line 36

def show_help
  puts <<~HELP
    ZephyrRb - Build reactive web components using Ruby and WebAssembly
    
    Usage:
      zephyr-rb <command> [options]
    
    Commands:
      build       Build the bundled zephyr.js distribution file
      version     Show version information
      help        Show this help message
    
    Examples:
      zephyr-rb build
      zephyr-rb version
  HELP
end