2016 meta-ruby

Table of Contents

ホーム / 講義 / ruby / OO / poker開発 / emacs / meta-ruby / note / github-repos / svn-repos 2015 /

1 おしらせ

1.1 2017-02-06

レポート課題です。

〆切は,成績報告に間に合わせるため,一応 2/16 にします。

提出が終了したら,その旨メールを下さい。

宛先は,msyk054@gmail.com です。

遅れる人も,その旨メールを下さい。

遅れる人も,3月の第3週末までには提出してください。

Object指向に関するまとめ oo.org

下記ドキュメントおよび講義中にふれたObject指向に関することを, 適切にまとめてください。

meta-ruby.org

Ruby における,次の事柄について,まとめてください:

ruby programming examples/*.rb

  • [X] file_print.rb <2016-11-21 月>
  • [X] home_directory.rb <2016-11-28 月>
  • [X] shuzo-meigen.rb <2016-11-28 月> home work
  • [X] dir_traverse.rb <2016-12-08 木> home work
  • [X] sinatra による org-mode 文書閲覧サービス <2017-01-16 月>

デザインパターン pattern/*.org

Ruby2.0.0で学ぶ、14個のデザインパターンを作りました について,講義 ではやらなかったデザイン・パターンについて,一つのパターンを動かし てください。

  • org ファイルにまとめる
  • 適切なディレクトリに分ける

感想と意見 myopinion.org

講義への感想・意見を書いてください。

1.2 2017-01-30

レポート

  • oo.org
  • meta-ruby.org
  • examples/
  • pattern/なにか一つのパターンを動かす

1.3 2016-12-12 学生さんのフォルダ

レポート提出用に,学生さんのフォルダ @ GoogleDriveを用意しました。 登録されていない人は言ってください。

1.5 2016-12-12 例題プログラムを github に置きました

work に置きました。

1.6 2016-12-05

サブバージョン リポジトリ https://wiki.cis.iwate-u.ac.jp/svn/meta-ruby/

2016 を 用意しました。

1.7 2016-10-17 休講します。

((s-:)) ネンリンピック長崎 サッカー出場のため

1.8 2016-10-12

初回の講義に参加できなかった人のために, もう一度軽くガイダンスを行ないす。

1.9 2016-10-03 開講します。

2 講義予定 (15) 2017-02-06

self => ~suzuki/meta-ruby.git/org/lects/15/plan.org

2.1 講義内容

Done Ruby programming

課題の提出
  • 自分のレポート提出フォルダに,Examples フォルダを作成し,
  • 課題ごとに,作成したプログラムと,その説明,実行とその結果をまと めた org 文書を作成し,
  • 上記 Examples/ フォルダに提出してください。
Done Examples [5/5]

実践的なプログラムを作ってみましょう。

先生の見本は,~suzuki/rubys/examples/ の下, work (github) に,個々 のプログラムを置くようにします。((@cis, @s))

  • [X] file_print.rb <2016-11-21 月>
  • [X] home_directory.rb <2016-11-28 月>
  • [X] shuzo-meigen.rb <2016-11-28 月> home work
  • [X] dir_traverse.rb <2016-12-08 木> home work
  • [X]

    sinatra による org-mode 文書閲覧サービス <2017-01-16 月>

    説明は ((@github/@cis/@s)) にあります。

Todo オブジェクト指向について

Todo Rubyのオブジェクト原理主義

https://docs.ruby-lang.org/ja/latest/doc/spec=2fintro.html

を読んで Ruby らしさについて考えましょう。

Todo メタプログラミング Ruby

file://~suzuki/COMM/Lects/meta-ruby/book を使います。

~/rubys/meta-programming-ruby.org にまとめながらやっていきましょう。

今日は,meta-ruby と meta-programming-ruby.org ((org@github/org@cis/@)) を使って,

  • [ ] <2017-02-06 月> instance_eval と 呼び出し可能オブジェクトに ついて説明します。
  • [X] <2017-01-30 月> ブロックとクロージャ,スコープゲートについて説明します。
  • [X] <2017-01-23 月> ブロックとクロージャについて説明します。

Ruby オブジェクト指向プログラミング

デザイン・パターン (@github @cis @s)

Ruby2.0.0で学ぶ、14個のデザインパターンを作りました は,ruby で書 いたデザイン・パターンの実装例です。これを読んで,デザイン・パター ンの心を理解しましょう。

  • ((s-:)) の design-pattern.org ((org@github/org@cis/@))
    • [ ] AbstractFactory・パターン 2/6 もう一度やります

## nil

abstract-factory-pattern.org ((@github/@cis/@s))

  • [X] シングルトン・パターン

## nil

singleton.org ((@github/@cis/@s))

  • [X] ビルダ・パターン

## nil

builder-pattern.org ((@github/@cis/@s))

  • [X] オブザーバ・・パターン

## nil

observer-pattern.org ((@github/@cis/@s))

単体テストを体験しましょう。

2.2 終わったこと

Doing Ruby programming

Done Ruby入門 [1/2]
Done とほほのRuby入門 (./ruby.html 2.ruby入門-2.1 2016)

~/rubys/ruby-begin.org にまとめながらやっていきましょう。

  • begin~end, 例外処理
  • 正規表現
  • メソッド
  • クラス

Todo オブジェクト指向について

Done 人類がオブジェクト指向を手に入れるまでの軌跡 - Qiita

読みまとめ始めましょう。Strategic Choice も参考にします。

  • [X] ソフトウェア危機
  • [X] 構造化プログラミング
  • [X] モジュラープログラミング
  • [X] 抽象データ型
  • [X] オブジェクト指向 メッセージングと動的ディスパッチ
  • [X] オブジェクト指向 仮想機械とメッセージング

~/rubys/oo.org にまとめてください。

Todo メタプログラミング Ruby

Ruby オブジェクト指向プログラミング

講義のための環境つくり

Doing 文芸的プログラミング環境
  • emacs org-mode
  • emacs org-mode + babel
Done ruby実行環境

./ruby.html [2/2]

  • [X] ruby情報
  • [X] ruby環境作り [4/4]
    • [X] rbenv とは
    • [X] 自前で rbenv+ruby-build をインストール
    • [X]

      ruby のインストール 先週,

      rbenv install 2.3.0-dev 
      

      ができない人がいましたが,どうも,

      ~/.rbenv/plugins/ruby-build/bin 
      

      にある,ruby-install が認識されていないためのようです。 取り敢えず,~/.rbenv/plugins/ruby-build/bin を PATH に入れてく ださい。

    • [X] gem (rubyのパッケージ管理)
Done ruby プログラミング環境

Emacs

  • [X] emacs-24.5
  • [X] emacsのパッケージと設定

2.3 やらなかったこと

Ruby オブジェクト指向プログラミング

ポーカーゲームのテスト駆動開発

3 講義へのメモ

ここには,((:-s)) の,講義前や講義後に思ったことを,書き留めてあります。

3.1 2016-12-12 へのメモ

  • oo.org, oo-note.org を見せる
  • strategic choice
  • meta-ruby つづき
  • ~suzuki/meta-ruby.git/book@, ~suzuki/meta-ruby.git/codes@,
  • test-unit 始める

3.2 2016-12-05 へのメモ

  • oo.org, oo-note.org を見せる
  • strategic choice
  • meta-ruby 始める
  • ~suzuki/meta-ruby.git/book@, ~suzuki/meta-ruby.git/codes@,
  • test-unit 始める

3.3 2016-11-28 へのメモ

とほほのRuby入門

file://~suzuki/COMM/Lects/meta-ruby/2016/

  • oo-note を見せる
  • strategic choice
  • meta-ruby 始める
  • ~suzuki/meta-ruby.git/book@, ~suzuki/meta-ruby.git/codes@,

3.4 2016-11-21 へのメモ

  • oo.org modular programming

    module としての「まとまり」の評価

    • call graph
    • lexical
  • ruby begin tohoho

    文法とクラスライブラリ

  • ruby practical programming
    • FileとIOと継承
    • Fileと特異メソッド
    • org-mode + babel
      • :tangle
      • execute
    • Directory
    • open-uri, nokogiri
  • emacs org-babel の例

    lects/ruby-begin.org

3.5 tohoho

  • 構文 [/]
    • [ ] Rubyの書き方
    • [ ] 文・式
    • [ ] コメント(#)
  • 数値・文字列・型 [/]
    • [ ] 整数(Integer)
    • [ ] 浮動少数点数(Float)
    • [ ] 論理型(Boolean)
    • [ ] 文字列(String)
    • [ ] エスケープシーケンス(\x)
    • [ ] 式展開(#{…})
    • [ ] コマンド出力(`…`)
    • [ ] ヒアドキュメント(<<)
  • 変数・定数 [/]
    • [ ] 識別子
    • [ ] ローカル変数(var)
    • [ ] インスタンス変数(@var)
    • [ ] クラス変数(@@var)
    • [ ] グローバル変数($var)
    • [ ] 定数(CONST)
    • [ ] 擬似変数(true, false, nil, self)
  • 配列・ハッシュ・範囲 [/]
    • [ ] 配列(Array)
    • [ ] ハッシュ(Hash)
    • [ ] 範囲(Range)
  • [ ] 制御構文 [/]
    • [ ] もし~ならば(if, then, else, elsif)
    • [ ] もし~でなければ(unless, then)
    • [ ] ~のあいだ(while, do)
    • [ ] ~になるまでのあいだ(until, do)
    • [ ] ~のあいだ(for, in, do)
    • [ ] ~の場合(case, when)
    • [ ] ループを抜ける(break)
    • [ ] ループを繰り返す(next)
    • [ ] ループを繰り返す(redo)
    • [ ] 例外処理(raise, begin, rescue, else, ensure)

3.6 ruby program

  • fileの読み書き
  • fileの中身の変換
    • grep
    • 行の配列
  • Directory 操作
    • directory構造のコピー
      • 各ファイルになんらかの変更を加える
    • directory の木構造を印刷する

Dir, File, Io, Array, String

3.7 2016.11.14へのメモ

3.8 2016.10.31~11.07 へのメモ

ruby tutorial

  • irb の使い方
  • run-ruby の使い方

oo.begin

  • ~/xxxx/oo.org

emacs

  • org-mode
  • org-mode babel

3.9 2016.10.24 のメモ

self => ~suzuki/meta-ruby.git/org/lects/note.org

emacsの設定

  • ruby-mode
  • org-mode
Emacs24.5日本語マニュアル登場!!info作成方法

https://emacs.rubikitch.com/emacs245-manual-ja/

suzuki@cis.iwate-u.ac.jp:local/info

#11 Emacs に革命を起こすパッケージ「helm」 (Software Design 2015年3月号掲載記事) Emacs helm インストール 設定 使い方

org-mode の紹介

#10 巨大なオーガナイズシステム「org-mode」の世界 (Software Design 2015年2月号掲載記事) Emacs org-mode インストール 設定 使い方

org-mode babel の紹介

p 1.class
p "abc".class
Fixnum
String

4 サイトの木構造

lstree ~/COMM/Lects/meta-ruby/git
/users/home/masayuki/COMM/Lects/meta-ruby/git@2017年 1月23日 月曜日 09時42分23秒 JST

+-README.md
+-docs-+-Figs-+-class-diagram-+-singleton.png
|      |      +-class_hier.png
|      |      +-object_and_class.png
|      +-emacs.html
|      +-index.html
|      +-lects.html
|      +-links.html
|      +-meta-ruby.html
|      +-note.html
|      +-oo.html
|      +-poker.html
|      +-ruby.html
|      +-styles-+-bigblow-+-css-+-bigblow.css
|               |         |     +-hideshow.css
|               |         |     +-htmlize.css
|               |         +-images-+-checked.png
|               |         |        +-fixme.png
|               |         |        +-halfchecked.png
|               |         |        +-info.png
|               |         |        +-note.png
|               |         |        +-tip.png
|               |         |        +-unchecked.png
|               |         |        +-warning.png
|               |         +-js-+-ZeroClipboard.swf
|               |              +-bigblow.js
|               |              +-hideshow.js
|               |              +-jquery-1.11.0.min.js
|               |              +-jquery-1.9.1.min.js
|               |              +-jquery-ui-1.10.2.min.js
|               |              +-jquery.localscroll-min.js
|               |              +-jquery.scrollTo-1.4.3.1-min.js
|               |              +-jquery.zclip.min.js
|               +-lib-+-js-+-jquery.stickytableheaders.min.js
|               |          +-stickytableheaders-license.txt
|               +-readtheorg-+-css-+-htmlize.css
|               |            |     +-readtheorg.css
|               |            |     +-rtd-full.css
|               |            +-js-+-readtheorg.js
|               |            +-readtheorg.org
|               +-sos-+-css-+-bigblow.css
|                     |     +-hideshow.css
|                     |     +-htmlize.css
|                     |     +-sos.css
|                     +-images-+-checked.png
|                     |        +-fixme.png
|                     |        +-halfchecked.png
|                     |        +-info.png
|                     |        +-note.png
|                     |        +-tip.png
|                     |        +-unchecked.png
|                     |        +-warning.png
|                     +-js-+-ZeroClipboard.swf
|                          +-bigblow.js
|                          +-hideshow.js
|                          +-readtheorg.js
|                          +-sos.js
|                          +-sos.js~
|                          +-sos.org
|                          +-tags
+-org-+-#index.org#
      +-Makefile
      +-Makefile.org
      +-Rakefile
      +-Rakefile.org
      +-Rakefile.setup.rb
      +-docs.org
      +-emacs-+-contents.org
      |       +-emacs-note.org
      |       +-emacs-setup.org
      |       +-org-note.org
      +-emacs.html
      +-emacs.org
      +-index.html
      +-index.html~
      +-index.org
      +-info-+-common-header.html
      |      +-common-header.org
      |      +-index-bigblow-header.setup
      |      +-index-readtheorg-header.setup
      |      +-index-sos-header.setup
      |      +-links.org
      |      +-org-link-make.org
      |      +-site-tree.org
      +-lects-+-01-+-01-GTD.org
      |       |    +-01-todo.org
      |       |    +-1.html
      |       |    +-1.org
      |       |    +-contents.org
      |       |    +-plan.org
      |       +-02-+-contents.org
      |       |    +-index.html
      |       |    +-index.org
      |       |    +-plan.org
      |       +-03-+-03-note.org
      |       |    +-Makefile
      |       |    +-contents.org
      |       |    +-index.html
      |       |    +-index.org
      |       |    +-plan.org
      |       |    +-response.org
      |       |    +-resume.org
      |       +-04-+-Makefile
      |       |    +-contents.org
      |       |    +-index.html
      |       |    +-index.org
      |       |    +-plan.org
      |       +-05-+-Makefile
      |       |    +-contents.org
      |       |    +-index.html
      |       |    +-index.org
      |       |    +-note.org
      |       |    +-plan.html
      |       |    +-plan.org
      |       |    +-resume.org
      |       |    +-working.org
      |       +-06-+-Makefile
      |       |    +-contents.org
      |       |    +-index.html
      |       |    +-index.org
      |       |    +-plan.html
      |       |    +-plan.org
      |       +-07-+-Makefile
      |       |    +-contents.org
      |       |    +-index.html
      |       |    +-index.org
      |       |    +-plan.html
      |       |    +-plan.org
      |       +-08-+-Makefile
      |       |    +-contents.org
      |       |    +-index.html
      |       |    +-index.org
      |       |    +-plan.html
      |       |    +-plan.org
      |       +-09-+-Makefile
      |       |    +-contents.org
      |       |    +-index.html
      |       |    +-index.org
      |       |    +-plan.html
      |       |    +-plan.org
      |       +-10-+-Makefile
      |       |    +-contents.org
      |       |    +-index.html
      |       |    +-index.org
      |       |    +-plan.html
      |       |    +-plan.org
      |       +-11-+-Makefile
      |       |    +-contents.org
      |       |    +-index.html
      |       |    +-index.org
      |       |    +-plan.html
      |       |    +-plan.org
      |       +-12-+-Makefile
      |       |    +-contents.org
      |       |    +-index.html
      |       |    +-index.org
      |       |    +-plan.html
      |       |    +-plan.org
      |       +-13-+-Makefile
      |       |    +-contents.org
      |       |    +-index.html
      |       |    +-index.org
      |       |    +-plan.html
      |       |    +-plan.org
      |       +-14-+-Makefile
      |       |    +-contents.org
      |       |    +-index.html
      |       |    +-index.org
      |       |    +-plan.html
      |       |    +-plan.org
      |       +-15-+-Makefile
      |       |    +-contents.org
      |       |    +-index.html
      |       |    +-index.org
      |       |    +-plan.html
      |       |    +-plan.org
      |       +-Makefile
      |       +-a.org
      |       +-announce.org
      |       +-contents.org
      |       +-index.html
      |       +-index.org
      |       +-meta-programming-ruby.org
      |       +-note.org
      |       +-openning.org
      |       +-org-links.org
      |       +-preface.org
      |       +-ri20min.rb
      |       +-ruby-begin.org
      |       +-ruby-note.org
      |       +-tohoho-ruby-1.org
      +-lects.html
      +-lects.org
      +-links.org
      +-log.org
      +-matz-+-Makefile
      |      +-index.html
      |      +-index.org
      |      +-matz-1-1.org
      |      +-matz-1-2.org
      |      +-matz-1-3.org
      |      +-matz-2.org
      |      +-matz-3.org
      |      +-matz-4.org
      |      +-matz-4.org.txt
      |      +-matz-6.org
      +-meta-ruby-+-Makefile
      |           +-babel-+-mymethod.rb
      |           +-block.org
      |           +-class.org
      |           +-contents.org
      |           +-index.html
      |           +-index.org
      |           +-intro.org
      |           +-methods.org
      |           +-object_model.org
      |           +-resume.org
      |           +-resume_meta_ruby.org
      |           +-resume_object_model.org
      +-meta-ruby.html
      +-meta-ruby.org
      +-note-+-Makefile
      |      +-babel-+-sqlite3-master-test.rb
      |      |       +-sqlite3-master.rb
      |      |       +-test-+-test_sample.rb
      |      +-class_hier.graffle
      |      +-class_hier.png
      |      +-contents.org
      |      +-index.html
      |      +-index.org
      |      +-memo.org
      |      +-org-doc-+-notes-+-readme.html
      |      |         |       +-readme.org
      |      |         +-org-+-run.org
      |      |         +-readme.org
      |      |         +-run-+-0
      |      |         |     +-1
      |      |         +-src-+-Gemfile
      |      |               +-app.rb
      |      |               +-config.ru
      |      +-poker.org
      |      +-ruby-begin-note.org
      |      +-ruby-life.org
      |      +-ruby-note-begin.org
      |      +-ruby-note-meta-block.org
      |      +-ruby-note-refe.org
      |      +-ruby-note-sinatra-org.org
      |      +-ruby-note-sqlite.org
      |      +-ruby-note-string.org
      |      +-ruby-note-test.org
      |      +-ruby-note.html
      |      +-ruby-note.org
      |      +-sinatra-org-+-org-+-original-run.org
      |                    |     +-run.org
      |                    +-readme.org
      |                    +-run-+-0
      |                    |     +-1
      |                    +-src-+-Gemfile
      |                          +-Gemfile.lock
      |                          +-app.rb
      |                          +-config.ru
      |                          +-ruby-note-meta.html
      |                          +-ruby-note.html
      +-note.html
      +-note.html~
      +-note.org
      +-oo-+-contents.org
      |    +-index.html
      |    +-index.org
      |    +-oo-note-oo-sucks.org
      |    +-oo-principle.org
      |    +-strategic-choice.org
      |    +-to_oo.org
      |    +-to_oo_note.org
      +-oo.html
      +-oo.html~
      +-oo.org
      +-org-docs-+-Makefile
      |          +-Makefile.org
      |          +-contents.org
      |          +-index.html
      |          +-index.org
      +-poker-+-Rakefile.org
      |       +-babel-+-Rakefile
      |       |       +-poker.rb
      |       |       +-src-+-card.rb
      |       |       |     +-constant.rb
      |       |       |     +-deck.rb
      |       |       |     +-hand.rb
      |       |       |     +-player.rb
      |       |       +-test-+-test-card.rb
      |       |              +-test-constant.rb
      |       |              +-test-deck.rb
      |       |              +-test-hand.rb
      |       |              +-test-player.rb
      |       +-card.org
      |       +-constant.org
      |       +-deck.org
      |       +-hand.org
      |       +-index.html
      |       +-index.org
      |       +-old_src-+-*shell*
      |       |         +-Rakefile
      |       |         +-Rakefile.org
      |       |         +-card.rb
      |       |         +-card.rb.org
      |       |         +-constant.rb
      |       |         +-constant.rb.org
      |       |         +-deck.rb
      |       |         +-deck.rb.org
      |       |         +-hand.rb
      |       |         +-hand.rb.org
      |       |         +-play.rb
      |       |         +-player.rb
      |       |         +-player.rb.org
      |       |         +-poker.rb
      |       |         +-poker.rb.org
      |       |         +-test-card.rb
      |       |         +-test-card.rb.org
      |       |         +-test-constant.rb
      |       |         +-test-constant.rb.org
      |       |         +-test-deck.rb
      |       |         +-test-deck.rb.org
      |       |         +-test-hand.rb
      |       |         +-test-poker.rb
      |       +-org-test.org
      |       +-player.org
      |       +-poker.html
      |       +-poker.org
      +-poker.html
      +-poker.org
      +-ruby-+-contents.org
      |      +-pry.org
      |      +-ruby.org
      +-ruby.html
      +-ruby.org
      +-touch
      +-work-+-abstract_factory-+-animal.rb
             |                  +-animals-+-duck.rb
             |                  |         +-frog.rb
             |                  +-do_duck_and_waterlily_factory.rb
             |                  +-do_frog_and_algae_factory.rb
             |                  +-duck_and_frog.rb
             |                  +-organism_factories-+-#frog_and_algae.rb#
             |                  |                    +-duck_and_waterlily.rb
             |                  |                    +-frog_and_algae.rb
             |                  +-organism_factory.rb
             |                  +-plant.rb
             |                  +-plants-+-algae.rb
             |                  |        +-waterlily.rb
             |                  +-waterlily_and_algae.rb
             +-babel-+-meta-class-hierarchy.rb
             +-block.org
             +-builder-pattern-+-builder.rb
             |                 +-builders-+-saltwater.rb
             |                 |          +-sugarwater.rb
             |                 +-director.rb
             |                 +-test_builder-pattern.rb
             +-builder-pattern.org
             +-class-diagram-+-material-water-builder.png
             |               +-singleton.png
             |               +-sugar-water-builder.png
             +-design-pattern.org
             +-doc-+-_index.html
             |     +-class_list.html
             |     +-css-+-common.css
             |     |     +-full_list.css
             |     |     +-style.css
             |     +-file_list.html
             |     +-frames.html
             |     +-index.html
             |     +-js-+-app.js
             |     |    +-full_list.js
             |     |    +-jquery.js
             |     +-method_list.html
             |     +-top-level-namespace.html
             +-examples-+-dir_print.rb
             |          +-file_print.rb
             |          +-home_directory.rb
             |          +-shuzo_meigen.rb
             +-examples.org
             +-meta-programming-ruby.org
             +-singleton-+-singleton.rb
             +-uml.org

Author: suzuki@cis.iwate-u.ac.jp

Created: 2017-02-06 月 09:33

Validate