GithubHelp home page GithubHelp logo

hibi6toshi / reading-metaprogramming-ruby Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kinoppyd/reading-metaprogramming-ruby

0.0 0.0 0.0 186 KB

License: Do What The F*ck You Want To Public License

Ruby 100.00%

reading-metaprogramming-ruby's Introduction

reading-metaprogramming-ruby

これはなに

このリポジトリは、メタプログラミングRuby 第2版を読んだ人向けの練習問題集です。本を読んだだけだとなかなか身につかないRubyのメタプログラミングの知識を、手を動かして理解することを目的にしています。

始め方

まずこのリポジトリをcloneしてbundle installまでしておきます。対象としているRubyのバージョンは3.2です。

02_object_modelのように、頭に章番号がふってあるディレクトリが、その章で学んだ内容を問う問題にあたります。00_setupは練習問題の解き方を練習するための問題です。

各章のディレクトリ中には練習問題があります。各ファイルには01_method_first_step.rbのように先頭に番号が振ってあるので、番号順で解くのをオススメしています。ファイルの中には日本語で満たすべき仕様と、いくらかのコードが記述されています。

各ディレクトリには問題だけでなく、テストも付属しています。各章のディレクトリに移動してbundle exec rakeとするとテストを実行できます。プロジェクトのルートディレクトリでbundle exec rakeをすると、すべての問題のテストを実行します。

問題文に示された仕様が満たされるとテストがパスするようになっています。頑張ってテストをパスするコードを書いてみましょう。もしテストと仕様の文章が違うなどの不備を見つけたらプルリクエストを送ってもらえると嬉しいです。

単体でテストを実行したい場合はbundle exec ruby -I../test test/test_method_first_step.rbのようにするとできます。

解答例

問題を解こうとしたけれどよくわからなかった、とかテストはパスしたけれどこれが良いコードなのかわからない、という人のために解答例と解説をanswersディレクトリ配下に置いています。適宜参考にしつつメタプログラミングの理解を深めてください。

もっと良い解答例がある場合はプルリクエストを送ってもらえると嬉しいです。

reading-metaprogramming-ruby's People

Contributors

kinoppyd avatar willnet avatar shunhikita avatar moonstruckdrops avatar meganemura avatar hibi6toshi avatar aanzai2017 avatar expajp avatar toshimaru avatar masafumikabe avatar yokoto avatar wakasa51 avatar aomoriringo avatar madogiwa0124 avatar nbw avatar okuramasafumi avatar lk-s-ogawara avatar t-mori23 avatar dora926 avatar kouryou avatar mserizawa avatar nagata03 avatar ykarakita avatar yoshinarl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.