Sha256: 369602bedc2945324c2a91d18eb475f3d05a3ccf1404c54fdb4e74a1d13bb509

Contents?: true

Size: 350 Bytes

Versions: 6

Compression:

Stored size: 350 Bytes

Contents

# frozen_string_literal: true

# encoding=utf-8

# utility functions to provide CLI
#
module CLI
  # skip :reek:UtilityFunction
  def value_for_cli(value)
    case value.class.to_s
    when 'String'
      Shellwords.escape value
    when 'FalseClass', 'TrueClass'
      value ? 't' : 'f'
    else
      Shellwords.escape value.to_s
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
markdown_exec-2.7.2 lib/cli.rb
markdown_exec-2.7.1 lib/cli.rb
markdown_exec-2.7.0 lib/cli.rb
markdown_exec-2.6.0 lib/cli.rb
markdown_exec-2.5.0 lib/cli.rb
markdown_exec-2.4.0 lib/cli.rb