Sha256: 38cca6ee6f7b704fd274a3f0a76c7309030ecfd6320d2920ee70cc1923bb63b9

Contents?: true

Size: 682 Bytes

Versions: 26

Compression:

Stored size: 682 Bytes

Contents

#!/usr/bin/env ruby

class Attribute
  attr_accessor :name
  attr_accessor :space
  def initialize(name, space)
    @name = name
    @space = space
  end
  def to_s
    raise 'child must implement'
  end
end

class SimpleMethod < Attribute
  def to_s
    "\n#{space}def #{name}\n#{space}end"
  end
end

names = []
objects = []

STDIN.each_line do |line|
  name = line.chomp
  space =  name.scan(/^\s+/)[0].to_s
  name = name.gsub(/^\s+/, '')
  name = name.gsub(/\W+/, '_')
  name = name.downcase
  names.push(name)
  objects.push(SimpleMethod.new(name, space))
end

names.sort.each do |name|
  objects.each do |object|
    if object.name == name
      puts object
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

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