Sha256: 014ac657588586b986c3cd65ae92e5ce1d30947a78dc7a862adaa5884d2c57c3

Contents?: true

Size: 691 Bytes

Versions: 1

Compression:

Stored size: 691 Bytes

Contents

#!/usr/bin/env ruby

require "pathname"
require "flex_station_data/concerns/callable"

class App
  include FlexStationData::Concerns::Callable[:run]

  attr_reader :command, :args

  def initialize(command = "help", *args)
    @command = command
    @args    = args
  end

  def dir_path
    Pathname(__dir__)
  end

  def linear_regression_path
    dir_path.join("flex-station-linear-regression")
  end

  def run
    case command
    when "linear-regression"
      exec(linear_regression_path.to_path, *args)
    when "help", "--help"
      puts "USAGE: flex-station <command>"
    else
      $stderr.puts "Unrecognised command: #{command}"
      exit(1)
    end
  end
end

App.run(*ARGV)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flex-station-data-1.0.1 bin/flex-station