diff --git a/Gemfile b/Gemfile index 74e5c04..801e4d1 100755 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,5 @@ # frozen_string_literal: true source "https://rubygems.org" gem "cmd.rb", github: "0x1eef/cmd.rb" +gem "ryo.rb", github: "0x1eef/ryo.rb" gemspec diff --git a/bin/twenty b/bin/twenty new file mode 100755 index 0000000..49ffd26 --- /dev/null +++ b/bin/twenty @@ -0,0 +1 @@ +#!/usr/bin/env ruby diff --git a/lib/twenty.rb b/lib/twenty.rb new file mode 100644 index 0000000..d104d3f --- /dev/null +++ b/lib/twenty.rb @@ -0,0 +1,3 @@ +module Twenty + require_relative "twenty/command" +end diff --git a/lib/twenty/command.rb b/lib/twenty/command.rb new file mode 100644 index 0000000..994a24f --- /dev/null +++ b/lib/twenty/command.rb @@ -0,0 +1,8 @@ +require "cmd" + +class Twenty::Command < Cmd + require_relative "command/up" + require_relative "command/down" + require_relative "command/connect" + require_relative "command/disconnect" +end diff --git a/lib/twenty/command/connect.rb b/lib/twenty/command/connect.rb new file mode 100644 index 0000000..c70d079 --- /dev/null +++ b/lib/twenty/command/connect.rb @@ -0,0 +1,15 @@ +class Twenty::Command::Connect < Twenty::Command + set_banner usage: "twenty connect [OPTIONS]", + description: "Connect a project to twenty" + + def run + options = parse_options(argv) + options.help ? show_help : run_command + end + + private + + def run_command + warn "[twenty] connect..." + end +end diff --git a/lib/twenty/command/disconnect.rb b/lib/twenty/command/disconnect.rb new file mode 100644 index 0000000..aa473e4 --- /dev/null +++ b/lib/twenty/command/disconnect.rb @@ -0,0 +1,15 @@ +class Twenty::Command::Disconnect < Twenty::Command + set_banner usage: "twenty disconnect [OPTIONS]", + description: "Disconnect a project from twenty" + + def run + options = parse_options(argv) + options.help ? show_help : run_command + end + + private + + def run_command + warn "[twenty] disconnect..." + end +end diff --git a/lib/twenty/command/down.rb b/lib/twenty/command/down.rb new file mode 100644 index 0000000..4d862a9 --- /dev/null +++ b/lib/twenty/command/down.rb @@ -0,0 +1,15 @@ +class Twenty::Command::Down < Twenty::Command + set_banner usage: "twenty down [OPTIONS]", + description: "Stop the twenty web server" + + def run + options = parse_options(argv) + options.help ? show_help : run_command + end + + private + + def run_command + warn "[twenty] down..." + end +end diff --git a/lib/twenty/command/up.rb b/lib/twenty/command/up.rb new file mode 100644 index 0000000..4f0c8e9 --- /dev/null +++ b/lib/twenty/command/up.rb @@ -0,0 +1,15 @@ +class Twenty::Command::Up < Twenty::Command + set_banner usage: "twenty up [OPTIONS]", + description: "Start the twenty web server" + + def run + options = parse_options(argv) + options.help ? show_help : run_command + end + + private + + def run_command + warn "[twenty] up..." + end +end diff --git a/libexec/twenty/connect b/libexec/twenty/connect new file mode 100644 index 0000000..e69de29 diff --git a/libexec/twenty/disconnect b/libexec/twenty/disconnect new file mode 100644 index 0000000..e69de29 diff --git a/libexec/twenty/down b/libexec/twenty/down new file mode 100644 index 0000000..e69de29 diff --git a/libexec/twenty/up b/libexec/twenty/up new file mode 100644 index 0000000..e69de29 diff --git a/twenty.gemspec b/twenty.gemspec index 44f3a1c..45a955a 100644 --- a/twenty.gemspec +++ b/twenty.gemspec @@ -16,6 +16,5 @@ Gem::Specification.new do |gem| gem.add_development_dependency "yard", "~> 0.9" gem.add_development_dependency "redcarpet", "~> 3.5" gem.add_development_dependency "standard", "~> 1.13" - gem.add_development_dependency "test-cmd.rb", "~> 0.2" gem.add_development_dependency "rake", "~> 13.1" end