AsFoo

Convert Ruby String object to something.

Installation

Add this line to your application's Gemfile:

gem 'as_foo'

And then execute:

$ bundle

Or install it yourself as:

$ gem install as_foo

Requirement

  • w3m, lynx, links or elinks command to use as_html (The command used to render html is autodetected.)
  • redcarpet gem to use as_markdown

Usage

>> require 'as_foo'
=> true
>> md = "# Sample\n- a\n- b\n"
=> "# Sample\n- a\n- b\n"
>> md.as_markdown
=> "<h1>Sample</h1>\n\n<ul>\n<li>a</li>\n<li>b</li>\n</ul>\n"
>> puts md.as_markdown.as_html
Sample

  

Contributing

  1. Fork it ( https://github.com/tmaeda/as_foo/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request