0.0
No commit activity in last 3 years
No release in over 3 years
YARD plugin for use with is-monkey gem.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Ruby Gems by Ivan Shikhalev

endorse

Overview

License

This code is distributed under the {file:LICENSE.md GNU Lesser General Public License}

Links

“Command” Gem

This is helper for creating multi-command apps (like Git, for example).

Provides the {Is::Command} class.

Usage example

Application

require 'is/command'

app = Is::Command::Application.new do

  key '-h', '--help' do
    puts "#{$0} -h|--help|<command> <files>"
    puts "\t-h, --help -- Show this help."
    puts "\taccess <files> -- Show access time for files."
    puts "\tcreate <files> -- Show creation time."
    puts "\tmodify <files> -- Show modification time."
    halt 0
  end

  action :access do |*args|
    args.each do |filename|
      puts "#{filename} => #{File.atime(filename)}"
    end
  end

  action :create do |*args|
    args.each do |filename|
      puts "#{filename} => #{File.ctime(filename)}"
    end
  end

  action :modify do |*args|
    args.each do |filename|
      puts "#{filename} => #{File.mtime(filename)}"
    end
  end

  default do
    $stderr.puts 'Command not found.'
    halt 1
  end

end

app.run    # <=> app.process *ARGV

One-block application

require 'is/command'

Is::Command.runapp do

  # ... key definitions like above

  # ... action definitions...

end

Other object wrap

require 'is/command'

obj = Object.new
obj.instance_eval do

  include Is::Command::Mixin    # sic!

  # ... key definitions like above

  # ... action definitions...

end
obj.process *ARGV

Global object mixed

require 'is/command'

include Is::Command::Mixin

# ... key definitions like above

# ... action definitions...

process *ARGS

Links

ToDo

Console help automaker like the OptionParser.

“Lazy” Gem

Provides an object-placeholder for lazy and threaded calculations.

See the {Is::Lazy} module.

Links

“Monkey” Gems

Set of the monkey-patches.

See the {Module}, {Object} etc.

Links