Coder Social home page Coder Social logo

endlessruby's Introduction

#EndlessRuby

If you use EndlessRuby, you can write source code without the use of 'end'. You can just write (correctly indented) ruby minus the 'end's because EndlessRuby adds them in for you.

class EndlessRubyWorld
  def self.hello!
    puts "hello!"

Be careful when using blocks. Use "each do" rather than "each {}". You can not do ellipsis of '}' if you use "each {}"

Syntax of EndlessRuby's "each {}" case:

each {
  statements
}

syntax of EndlessRuby's "each do" case:

each do
  statements

##execute endless ruby source code: $ lib/endlessruby.rb example.er

##require endless ruby source code:

require "path/to/endlessruby"
require "example.er"

##compile endless ruby source code to pure ruby. $ lib/endlessruby.rb -c example.er $ lib/endlessruby.rb -c src/example.er -o lib -c option is compile and output to current directory from each arguments. arguments is filenames. -o option appoint output directory.

#EndlessRuby Japanese README

EndlessRuby は Ruby のコードを end を使わずにインデントで表現できます

単に省略された end を補完することしかしないので、 end とインデント以外はピュアなRubyと同じように書けます。 endを省略しないこともできます。

class EndlessRubyWorld
  def self.hello!
    puts "hello!"

ただ、複数行にまたがるブロックを渡す場合は

each {
  statements
}

ではなく

each do
  statements

を使ってください。もし each {} で渡すのなら、閉じカッコは省略できません

##メソッドチェイン

reject do |ary|
  ary.empty?
end.each do |ary|
  # statements

##endlessruby で書かれたソースを実行: $ lib/endlessruby.rb example.er

##endlessruby で書かれたソースをrequire

require "path/to/endlessruby"
require "example.er"

##明示的にコンパイルしてピュアなRubyのソースに $ lib/endlessruby.rb -c example.er $ lib/endlessruby.rb -c src/example.er -o lib -c オプションはその後渡されたすべての引数を、endlessrubyからpure rubyにコンパイルして、同じ名前.rbファイルをカレントディレクトリ以下の-oオプションのディレクトリに書き出します。もし-oが省略されたら、カレントディレクトリに書き出します。

endlessruby's People

Contributors

pasberth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

endlessruby's Issues

Any details about installation?

Love this idea. I was searching for this for a long time until someone gave me this link on StackOverflow.
I'd like to try it. But can I install it with gem? It there more detailed materials about installation please?

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.