Sha256: 294832775375f05e8af9a304f2cfcb1f5d6b6b075a5dacd725a0ea1931e07e32

Contents?: true

Size: 350 Bytes

Versions: 43

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 ? '1' : '0'
    else
      Shellwords.escape value.to_s
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
markdown_exec-2.3.0 lib/cli.rb
markdown_exec-2.2.0 lib/cli.rb
markdown_exec-2.1.0 lib/cli.rb
markdown_exec-2.0.8.4 lib/cli.rb
markdown_exec-2.0.8.3 lib/cli.rb
markdown_exec-2.0.8.2 lib/cli.rb
markdown_exec-2.0.8.1 lib/cli.rb
markdown_exec-2.0.8 lib/cli.rb
markdown_exec-2.0.7 lib/cli.rb
markdown_exec-2.0.6 lib/cli.rb
markdown_exec-2.0.5 lib/cli.rb
markdown_exec-2.0.4 lib/cli.rb
markdown_exec-2.0.3.2 lib/cli.rb
markdown_exec-2.0.3.1 lib/cli.rb
markdown_exec-2.0.3 lib/cli.rb
markdown_exec-2.0.2 lib/cli.rb
markdown_exec-2.0.1 lib/cli.rb
markdown_exec-2.0.0 lib/cli.rb
markdown_exec-1.8.9 lib/cli.rb
markdown_exec-1.8.8 lib/cli.rb