Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Beginning Ruby with Markdown and more

wtnabe
August 18, 2012

Beginning Ruby with Markdown and more

テキストフォーマッタで始めるRubyとGemの基礎 2012-08-18(Sat) kanazawa.rb meetup #1

wtnabe

August 18, 2012
Tweet

More Decks by wtnabe

Other Decks in Programming

Transcript

  1. お品書き Markdown の紹介 Ruby / Rubygems / GitHub and more

    Rubyの動かし⽅ / リファレンス ライブラリを使おう Markdown の変換
  2. ⾒出し ====== 1. Ordered List * Unordered List - Unordered

    List よく bullet list と呼ぶ。- でも * でもよい 階層はインデントで表現
  3. Gem パッケージそのもの ex) rails gem, nokogiri gem パッケージ管理コマンド gem -v

    ※ Ruby 1.9から標準なのでインストール⽅法などは割愛
  4. ヘルプを⾒る $ ruby --help Usage: ruby [switches] [--] [programfile] [arg

    -0[octal] specify record separator (\0 -a autosplit mode with -n or -p -c check syntax only -Cdirectory cd to directory, before exec -d set debugging flags (set $DE -e 'command' one line of script. Several ....
  5. よく使うオプションを抜粋 -c check syntax only -d set debugging flags (set

    $DEBUG to true) -e 'command' one line of script. Several -e's allowed. Omit [programfile] -rlibrary require the library, before executing your script
  6. ri $ ri Array.include\? = Array.include? (from ruby site) -----------------------------------------

    ary.include?(obj) -> true or false --------------------------------------- Returns true if the given object is present in self (that is, if any object == anObject), false otherwise. ...
  7. #! /usr/bin/env ruby # -*- coding: utf-8 -*- require "redcarpet"

    puts Redcarpet::Markdown. new(Redcarpet::Render::HTML). render(<<EOD) ここに ====== * markdownの⽂法で * テキストを書くことができます EOD
  8. リファレンス yard-doc-core gem YARD - A Ruby Documentation Tool pry-doc

    gem Pry - an IRB alternative and runtime developer console
  9. Resources Rails Hub - @IT Ruby on Rails Screencasts -

    RailsCasts ASCIIcasts - Recent Episodes