LoginSignup
1
2

More than 5 years have passed since last update.

Active Emoji で Hello, world! #active_emoji #ruby

Posted at

Active Emoji で Hello, world! #active_emoji #ruby

:musical_score: 概要

Active Emoji で絵文字コーディングを可能にし、 Hello, world! を出力します。

ActiveEmoji とは?

ActiveEmoji GitHub
:gem: ActiveEmoji RubyGems

Ruby のコアライブラリに Emoji のエイリアスを追加することで、
特に英語を知らない子供のために、Ruby のコードを より簡単に読みやすく・書きやすく します。
(と、README.md に書いてある。私が言ったわけではない)

:closed_book: Contribution Rule

Pull Request を作成する場合のたった一つのルール。
コミットメッセージは絵文字で書かなければならない。

ActiveEmoji GitHub Commits

リンク先を見れば分かるように厳しい鉄則のようです

よく見たら、 did_you_mean gem の作者さんが Contribute してました 1

サンプル

:raised_hand: 前提

以下の環境で動作確認しました。

  • Ruby 2.1
    • date を require しないとエラーになる模様
    • 2.0 系の場合は date の require は不要
  • OS
    • Windows 7
    • 本当は MacOS の方が Emoji を使いやすいらしいが、個人の都合により Win を使用します
  • エディタ
    • Sublime Text2 を利用する
    • Emoji を表示するために Settings-User で以下を追加
      • "font_options": ["directwrite"],
      • この設定をしたから、全ての Emoji を正しく表示できるわけではない

:scroll: 仕様

Hello, Active Emoji! をカウンタ付きで 10 回標準出力します

サンプルコード

hello_active_emoji.png

サンプルコード ( Emoji なしのオリジナルコード )

10.times { |e|puts "Hello, Active Emoji! #{e}" }

出力

Hello, Active Emoji! 0
Hello, Active Emoji! 1
Hello, Active Emoji! 2
Hello, Active Emoji! 3
Hello, Active Emoji! 4
Hello, Active Emoji! 5
Hello, Active Emoji! 6
Hello, Active Emoji! 7
Hello, Active Emoji! 8
Hello, Active Emoji! 9

:books: 外部資料

:books: 脚注

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2