fix Commands namespace

This commit is contained in:
Jorge Morante 2020-12-27 20:29:47 +01:00
parent 7dcae54cd2
commit f0de6fafd7
6 changed files with 17 additions and 21 deletions

View File

@ -12,13 +12,13 @@ module Fingers
command_class = case ARGV[0]
when 'start'
Fingers::Command::Start
Fingers::Commands::Start
when 'check_version'
Fingers::Command::CheckVersion
Fingers::Commands::CheckVersion
when 'send_input'
Fingers::Command::SendInput
Fingers::Commands::SendInput
when 'load_config'
Fingers::Command::LoadConfig
Fingers::Commands::LoadConfig
else
raise "Unknown command #{ARGV[0]}"
end

View File

@ -1,18 +1,14 @@
module Fingers
module Command
class Base
def initialize(args, cli)
@args = args
@cli = cli
end
class Fingers::Commands::Base
def initialize(args, cli)
@args = args
@cli = cli
end
protected
protected
attr_reader :args, :cli
attr_reader :args, :cli
def tmux
@tmux ||= Tmux.instance
end
end
def tmux
@tmux ||= ::Tmux.instance
end
end

View File

@ -1,4 +1,4 @@
class Fingers::Command::CheckVersion < Fingers::Command::Base
class Fingers::Commands::CheckVersion < Fingers::Commands::Base
def run
require 'net/https'

View File

@ -1,4 +1,4 @@
class Fingers::Command::LoadConfig < Fingers::Command::Base
class Fingers::Commands::LoadConfig < Fingers::Commands::Base
DISALLOWED_CHARS = /cimqn/.freeze
DEFAULT_PATTERNS = {

View File

@ -1,4 +1,4 @@
class Fingers::Command::SendInput < Fingers::Command::Base
class Fingers::Commands::SendInput < Fingers::Commands::Base
def run
socket = InputSocket.new

View File

@ -9,7 +9,7 @@ class PanePrinter
end
end
class Fingers::Command::Start < Fingers::Command::Base
class Fingers::Commands::Start < Fingers::Commands::Base
State = Struct.new(
:show_help,
:compact_mode,