Sha256: ebf1a8098c17242bd1688dd90169d9f37beea4463abec32b618353046e5b2e8a
Contents?: true
Size: 889 Bytes
Versions: 17
Compression:
Stored size: 889 Bytes
Contents
#coding=utf-8 require "aio/core" class Aio::Module::Cmd::Maipu::ShowClock < Aio::Module::Cmd::Maipu include Aio::Module def initialize super({ :cmd_full => "show clock", :cmd_short => "sh clo", :author => "Elin", :description => "This is Maipu Command# show clock", :ranking => Ranking_1, :platform => "all" }) end def parse context = self.context.dup clock = {} useful[:clock] = clock context.readline_match_block(/(?<zone>.*)\.\d+ (?<week>[^\s]+) (?<month>[^\s]+) (?<day>[^\s]+) (?<time>[^\s]+) (?<year>[^\s]+)/) do |block| block.update(clock, :time) block.update(clock, :zone) block.update(clock, :week) block.update(clock, :year) block.update(clock, :month, Aio::Base::Toolkit::Date.month_to_i(block[:month])) block.update(clock, :day) end end end
Version data entries
17 entries across 17 versions & 1 rubygems