Skip to content
Ukagaka SHIORI subsystem 'Sana'
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
spec
.gitignore
.rspec
.travis.yml
Gemfile
README.md
Rakefile
appveyor.yml
sana.gemspec

README.md

Sana

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.

You can’t perform that action at this time.