Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shikhalev/gems
Ruby Gems by Ivan Shikhalev
https://github.com/shikhalev/gems
Last synced: about 1 month ago
JSON representation
Ruby Gems by Ivan Shikhalev
- Host: GitHub
- URL: https://github.com/shikhalev/gems
- Owner: shikhalev
- License: other
- Created: 2013-04-15T14:11:58.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-09-01T11:56:35.000Z (about 10 years ago)
- Last Synced: 2024-09-17T02:32:35.089Z (2 months ago)
- Language: Ruby
- Homepage: http://rubydoc.info/github/shikhalev/gems/frames
- Size: 461 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Ruby Gems by Ivan Shikhalev
[![endorse](https://api.coderwall.com/shikhalev/endorsecount.png)](https://coderwall.com/shikhalev)
## Overview
### License
This code is distributed under the
{file:LICENSE.md GNU Lesser General Public License}### Links
* [Project](https://github.com/shikhalev/gems) @ [GitHub](https://github.com/)
* [Tracker](https://github.com/shikhalev/gems/issues) &
[Wiki](https://github.com/shikhalev/gems/wiki) @ [GitHub](https://github.com/)
* [Documentation](http://rubydoc.info/github/shikhalev/gems/master/frames)
@ [RubyDoc.info](http://rubydoc.info/)## “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| "
puts "\t-h, --help -- Show this help."
puts "\taccess -- Show access time for files."
puts "\tcreate -- Show creation time."
puts "\tmodify -- Show modification time."
halt 0
endaction :access do |*args|
args.each do |filename|
puts "#{filename} => #{File.atime(filename)}"
end
endaction :create do |*args|
args.each do |filename|
puts "#{filename} => #{File.ctime(filename)}"
end
endaction :modify do |*args|
args.each do |filename|
puts "#{filename} => #{File.mtime(filename)}"
end
enddefault do
$stderr.puts 'Command not found.'
halt 1
endend
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 doinclude 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
* [is-command-0.8.1](https://rubygems.org/gems/is-command) @
[RubyGems.org](https://rubygems.org/)### ToDo
Console help automaker like the OptionParser.
## “Lazy” Gem
Provides an object-placeholder for lazy and threaded calculations.
See the {Is::Lazy} module.
### Links
* [is-lazy-0.9.0](https://rubygems.org/gems/is-lazy) @
[RubyGems.org](https://rubygems.org/)## “Monkey” Gems
Set of the monkey-patches.
See the {Module}, {Object} etc.
### Links
* [is-monkey-0.1.0](https://rubygems.org/gems/is-monkey) @
[RubyGems.org](https://rubygems.org/)