Project

sana

0.0
No commit activity in last 3 years
No release in over 3 years
Ukagaka SHIORI subsystem 'Sana'
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.7.9
~> 0.1
~> 10.0
~> 3.4
~> 0.11
~> 0.8.7

Runtime

>= 0.0.1
 Project Readme

Gem Gem Gemnasium Inch CI Travis Build Status AppVeyor Build Status codecov.io Code Climate

Ukagaka SHIORI subsystem 'Sana'

Installation

Add this line to your application's Gemfile:

gem 'sana'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sana

Usage

Example of basic SHIORI subsystem with SHIOLINK.DLL protocol.

make main.rb like below...

require 'sana'
require 'shiolink'
require 'json'

def _load(dirpath)
  if File.exist?("save.json")
    $save = JSON.parse(File.read("save.json"))
  else
    $save = {}
  end
end

def _unload
  File.write("save.json", JSON.dump($save))
  exit
end

def version r; '0.0.1'; end
def name r; 'Sana'; end
def craftman r; 'Narazaka'; end
def craftmanw r; '奈良阪'; end

def OnBoot r
  unless $save['boot_count']
    $save['boot_count'] = 1
  else
    $save['boot_count'] += 1
  end
  '\h\s[0]おはよう。\w9\u\s[10]こんばんは。\e'
end

def OnClose r
  if r.Reference0 == 'user'
    '\h\s[0]またね。\w9\-'
  else
    '\h\s[0]おわー!?\w9\-'
  end
end

include Sana::ResponseHelper

sana = Sana.new
shiolink = Shiolink.new(sana.method(:load), sana.method(:unload), sana.method(:request))
shiolink.start

then...

ruby main.rb

or make SHIOLINK.INI and run with any basewares...

[SHIOLINK]
commandline = ruby ./main.rb

charmode  = UTF-8

API

API Document

License

This is released under MIT License.