Project

babascript

0.01
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
BabaScript is a script launguage which runs on @takumibaba
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

 Project Readme

BabaScript

BabaScript is a script language which runs on @takumibaba

Installation

% gem install babascript

Usage

BabaScript interpreter

% baba --help

oneline

% baba -e "月曜にかず助に行くので、出欠をとってください"

sample.bb

if 0 < Time.now.hour and Time.now.hour < 5
  もう寝よう!!
else
  意識を高めろ!!
end
% baba sample.bb

embed BabaScript into Ruby

require 'rubygems'
require 'babascript'

BabaScript.baba do
  起きてください
end
BabaScript.baba do
  アイス買ってきてよ("#{rand(10)}本")
end

switch BABA

BabaScriptはジョブ通知にLindaを使っています。

クエリーを書き込むタプルスペースのデフォルト値は"takumibaba"で、彼のジョブは http://linda.masuilab.org/takumibaba/notifications で確認できます。

% baba --base http://example.com --space shokai

タプルスペース名を"shokai"に、Lindaサーバーをexample.comに切り替えると、以後のジョブの通知先が http://example.com/shokai/notifications になります。

ruby上での書き込み先の変更方法

BabaScript.baba :base => "http://example.com", :space => "shokai" do
  puts そろそろ起きたほうがいいのでは?
end

Test

Install Dependencies

% gem install bundler
% bundle install

Manual Test

Start VM

% bundle exec bin/baba-vm --space test

Run samples

% bundle exec ruby samples/sample.rb

Unit Test

% bundle exec rake test

or

% LINDA_BASE=http://localhost:5000 LINDA_SPACE=test bundle exec rake test

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request