Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/myokoym/daberu
おしゃべりなオブジェクトをつくることができます。 [You can create a talkative object.]
https://github.com/myokoym/daberu
Last synced: 2 days ago
JSON representation
おしゃべりなオブジェクトをつくることができます。 [You can create a talkative object.]
- Host: GitHub
- URL: https://github.com/myokoym/daberu
- Owner: myokoym
- License: mit
- Created: 2012-08-23T14:17:40.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-11-22T11:18:36.000Z (almost 11 years ago)
- Last Synced: 2024-10-31T13:09:23.146Z (15 days ago)
- Language: Ruby
- Homepage: https://rubygems.org/gems/daberu
- Size: 199 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Daberu - Create a talkative object.
[![Build Status](https://secure.travis-ci.org/myokoym/daberu.png?branch=master)](http://travis-ci.org/myokoym/daberu)
[![Dependency Status](https://gemnasium.com/myokoym/daberu.png)](https://gemnasium.com/myokoym/daberu)おしゃべりなオブジェクトをつくることができます。
[You can create a talkative object.]メソッドが呼ばれると、その情報を指定されたフォーマットで出力します。
[If a method is called, it will output in the format which had the information specified.]主な用途:デバッグ
[One way, Debugging.]## Installation
Add this line to your application's Gemfile:
gem 'daberu'
And then execute:
$ bundle
Or install it yourself as:
$ gem install daberu
## Usage
require 'daberu'
a = Daberu::Talker.new([])
a << 1 #=> "Class: Array, Method: <<, Arguments: [1], Block: "
a << 2 #=> "Class: Array, Method: <<, Arguments: [2], Block: "
a << 3 #=> "Class: Array, Method: <<, Arguments: [3], Block: "
a.each do |i|
p i
end
#=> "Class: Array, Method: each, Arguments: [], Block: #"
1
2
3include Daberu # With liking
p Talker.format_get(a) #=> "Class: %s, Method: %s, Arguments: [%s], Block: %s"
Talker.format_set(a, "%s#%s(%s)")
p Talker.format_get(a) #=> "%s#%s(%s)"
a << 4 #=> "Array#<<(4)"### Ruby version
開発/テストは1.9系で行なっています。
[Development and Testing on 1.9.x.]1.8系でも動作しますが、ドキュメントと挙動が違うかもしれません。
[Although 1.8.x operates, an action may differ from documents.]## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request