Sha256: e30eb376681e8ecd335c7abb2aae6a59a64bad0a16282a939915ed7f0212eb51

Contents?: true

Size: 411 Bytes

Versions: 26

Compression:

Stored size: 411 Bytes

Contents

#!/usr/bin/env ruby

def commandify(string)
  words = {}
  interpolation_buffer = []
  string.scan(/\w+/).each do |word|
    word.downcase!
    interpolation_buffer.push(word)
  end
  interpolation = (interpolation_buffer * '_')
  words[string] = "%<#{interpolation}>s"
  words
end

STDIN.each_line do |line|
  line = line.chomp!
  hash = commandify(line)
  hash.each do |k, v|
    puts "#{k} #{v}" 
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
ix-cli-0.0.27 bin/ix-commandify
ix-cli-0.0.26 bin/ix-commandify
ix-cli-0.0.25 bin/ix-commandify
ix-cli-0.0.24 bin/ix-commandify
ix-cli-0.0.23 bin/ix-commandify
ix-cli-0.0.22 bin/ix-commandify
ix-cli-0.0.21 bin/ix-commandify
ix-cli-0.0.20 bin/ix-commandify
ix-cli-0.0.19 bin/ix-commandify
ix-cli-0.0.18 bin/ix-commandify
ix-cli-0.0.17 bin/ix-commandify
ix-cli-0.0.16 bin/ix-commandify
ix-cli-0.0.15 bin/ix-commandify
ix-cli-0.0.14 bin/ix-commandify
ix-cli-0.0.13 bin/ix-commandify
ix-cli-0.0.12 bin/ix-commandify
ix-cli-0.0.11 bin/ix-commandify
ix-cli-0.0.10 bin/ix-commandify
ix-cli-0.0.9 bin/ix-commandify
ix-cli-0.0.7 bin/ix-commandify