Class: Pandocomatic::SkipCommand
- Defined in:
- lib/pandocomatic/command/skip_command.rb
Overview
A command to skip a file or directory
Instance Attribute Summary collapse
-
#message ⇒ String
Message explaining why the file or directory is being skipped.
-
#src ⇒ String
The file or directory to skip.
Attributes inherited from Command
Instance Method Summary collapse
-
#initialize(src, message) ⇒ SkipCommand
constructor
Create a new SkipCommand.
-
#message? ⇒ Boolean
Has this SkipCommand a message?.
-
#run ⇒ Object
‘Run’ this SkipCommand by doing nothing.
-
#skip? ⇒ Boolean
Skip this command.
-
#to_s ⇒ String
A string representation of this SkipCommand.
Methods inherited from Command
#all_errors, #count, #directory?, #dry_run?, #errors?, #execute, #file_modified?, #index_to_s, #make_quiet, #modified_only?, #multiple?, #quiet?, reset, #runnable?, #src_root, #uncount
Constructor Details
#initialize(src, message) ⇒ SkipCommand
Create a new SkipCommand
39 40 41 42 43 |
# File 'lib/pandocomatic/command/skip_command.rb', line 39 def initialize(src, ) super() @src = src @message = end |
Instance Attribute Details
#message ⇒ String
Returns message explaining why the file or directory is being skipped.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/pandocomatic/command/skip_command.rb', line 31 class SkipCommand < Command attr_reader :src, :message # Create a new SkipCommand # # @param src [String] path to the file to skip # @param message [String] the message explaining why this file is being # skipped def initialize(src, ) super() @src = src @message = end # Has this SkipCommand a message? # # @return [Boolean] def !((@message.nil? or @message.empty?)) end # 'Run' this SkipCommand by doing nothing def run; end # Skip this command # # @return [Boolean] true def skip? true end # A string representation of this SkipCommand # # @return [String] def to_s "skipping #{File.basename @src}" + (": #{@message}" if ) end end |
#src ⇒ String
Returns the file or directory to skip.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/pandocomatic/command/skip_command.rb', line 31 class SkipCommand < Command attr_reader :src, :message # Create a new SkipCommand # # @param src [String] path to the file to skip # @param message [String] the message explaining why this file is being # skipped def initialize(src, ) super() @src = src @message = end # Has this SkipCommand a message? # # @return [Boolean] def !((@message.nil? or @message.empty?)) end # 'Run' this SkipCommand by doing nothing def run; end # Skip this command # # @return [Boolean] true def skip? true end # A string representation of this SkipCommand # # @return [String] def to_s "skipping #{File.basename @src}" + (": #{@message}" if ) end end |
Instance Method Details
#message? ⇒ Boolean
Has this SkipCommand a message?
48 49 50 |
# File 'lib/pandocomatic/command/skip_command.rb', line 48 def !((@message.nil? or @message.empty?)) end |
#run ⇒ Object
‘Run’ this SkipCommand by doing nothing
53 |
# File 'lib/pandocomatic/command/skip_command.rb', line 53 def run; end |
#skip? ⇒ Boolean
Skip this command
58 59 60 |
# File 'lib/pandocomatic/command/skip_command.rb', line 58 def skip? true end |
#to_s ⇒ String
A string representation of this SkipCommand
65 66 67 |
# File 'lib/pandocomatic/command/skip_command.rb', line 65 def to_s "skipping #{File.basename @src}" + (": #{@message}" if ) end |