fix Commands namespace
This commit is contained in:
parent
7dcae54cd2
commit
f0de6fafd7
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Fingers::Command::CheckVersion < Fingers::Command::Base
|
||||
class Fingers::Commands::CheckVersion < Fingers::Commands::Base
|
||||
def run
|
||||
require 'net/https'
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Fingers::Command::LoadConfig < Fingers::Command::Base
|
||||
class Fingers::Commands::LoadConfig < Fingers::Commands::Base
|
||||
DISALLOWED_CHARS = /cimqn/.freeze
|
||||
|
||||
DEFAULT_PATTERNS = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Fingers::Command::SendInput < Fingers::Command::Base
|
||||
class Fingers::Commands::SendInput < Fingers::Commands::Base
|
||||
def run
|
||||
socket = InputSocket.new
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue