module Tubuyaki

Constants

VERSION

Public Class Methods

soft() click to toggle source
# File lib/tubuyaki.rb, line 37
def soft
require 'tk'

window = TkRoot.new{
title 'tubuyaki'
resizable [0,0]
}

window1 = TkToplevel.new{
title 'boyaki is shout!'
}
    
TkLabel.new(nil,
:text => "ひとりごと、ぼやいったー!ポチっとな!",
:fg => "blue").pack

entry = TkEntry.new.pack('side'=>'left')

c = TkButton.new(:text => "(´・ω・`)").pack('fill'=>'x',"padx"=>2.5,"pady"=>2.5)

c.command proc {

 saikoro = Random.rand(6)

 case saikoro

 when 4 then
 TkLabel.new(window1,
        :text => ("#{entry.value}"),
        :fg => "black",
        :bg => "yellow").pack('fill'=>'x',"padx" => 2.5,"pady" => 2.5)
 when 3 then
 TkLabel.new(window1,
        :text => ("#{entry.value}"),
        :fg => "black",
        :bg => "white").pack('fill'=>'x',"padx" => 2.5,"pady" => 2.5)
 when 2 then
 TkLabel.new(window1,
        :text => ("#{entry.value}"),
        :fg => "white",
        :bg => "black").pack('fill'=>'x',"padx" => 2.5,"pady" => 2.5)

 when 1 then
 TkLabel.new(window1,
        :text => ("#{entry.value}"),
        :fg => "black",
        :bg => "green").pack('fill'=>'x',"padx" => 2.5,"pady" => 2.5)

 when 0 then
 TkLabel.new(window1,
        :text => ("#{entry.value}"),
        :fg => "white",
        :bg => "red").pack('fill'=>'x',"padx" => 2.5,"pady" => 2.5)

 else
   TkLabel.new(window1,
        :text => ("#{entry.value}"),
        :fg => "white",
        :bg => "blue").pack('fill'=>'x',"padx" => 2.5,"pady" => 2.5)

end
}

Tk.mainloop
end
start() click to toggle source
# File lib/tubuyaki.rb, line 16
def start
puts "取扱説明書".center(60,'-')
puts ""
puts "

>tubuyaki
 ∟tubuyakiを起動します

>tubuyaki -v
 ∟tubuyakiのバージョンを表示します

>tubuyaki -h
 ∟tubuyakiのヘルプを表示します

tubuyakiはMITライセンスです

"
puts""
puts "取扱説明書".center(60,'-')
end
version() click to toggle source
# File lib/tubuyaki.rb, line 10
def version
require 'tubuyaki/version'
print "Tubuyaki_Version : "
puts Tubuyaki::VERSION
end

Private Instance Methods

soft() click to toggle source
# File lib/tubuyaki.rb, line 37
def soft
require 'tk'

window = TkRoot.new{
title 'tubuyaki'
resizable [0,0]
}

window1 = TkToplevel.new{
title 'boyaki is shout!'
}
    
TkLabel.new(nil,
:text => "ひとりごと、ぼやいったー!ポチっとな!",
:fg => "blue").pack

entry = TkEntry.new.pack('side'=>'left')

c = TkButton.new(:text => "(´・ω・`)").pack('fill'=>'x',"padx"=>2.5,"pady"=>2.5)

c.command proc {

 saikoro = Random.rand(6)

 case saikoro

 when 4 then
 TkLabel.new(window1,
        :text => ("#{entry.value}"),
        :fg => "black",
        :bg => "yellow").pack('fill'=>'x',"padx" => 2.5,"pady" => 2.5)
 when 3 then
 TkLabel.new(window1,
        :text => ("#{entry.value}"),
        :fg => "black",
        :bg => "white").pack('fill'=>'x',"padx" => 2.5,"pady" => 2.5)
 when 2 then
 TkLabel.new(window1,
        :text => ("#{entry.value}"),
        :fg => "white",
        :bg => "black").pack('fill'=>'x',"padx" => 2.5,"pady" => 2.5)

 when 1 then
 TkLabel.new(window1,
        :text => ("#{entry.value}"),
        :fg => "black",
        :bg => "green").pack('fill'=>'x',"padx" => 2.5,"pady" => 2.5)

 when 0 then
 TkLabel.new(window1,
        :text => ("#{entry.value}"),
        :fg => "white",
        :bg => "red").pack('fill'=>'x',"padx" => 2.5,"pady" => 2.5)

 else
   TkLabel.new(window1,
        :text => ("#{entry.value}"),
        :fg => "white",
        :bg => "blue").pack('fill'=>'x',"padx" => 2.5,"pady" => 2.5)

end
}

Tk.mainloop
end
start() click to toggle source
# File lib/tubuyaki.rb, line 16
def start
puts "取扱説明書".center(60,'-')
puts ""
puts "

>tubuyaki
 ∟tubuyakiを起動します

>tubuyaki -v
 ∟tubuyakiのバージョンを表示します

>tubuyaki -h
 ∟tubuyakiのヘルプを表示します

tubuyakiはMITライセンスです

"
puts""
puts "取扱説明書".center(60,'-')
end
version() click to toggle source
# File lib/tubuyaki.rb, line 10
def version
require 'tubuyaki/version'
print "Tubuyaki_Version : "
puts Tubuyaki::VERSION
end