From ee91e6282464321d5f1e8694c048c24abf8d15d7 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 24 Feb 2016 23:21:06 -0500 Subject: json, an output representation, first pass --- lib/sisu/hub_actions.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/sisu/hub_actions.rb') diff --git a/lib/sisu/hub_actions.rb b/lib/sisu/hub_actions.rb index 52ad9da6..a946591d 100644 --- a/lib/sisu/hub_actions.rb +++ b/lib/sisu/hub_actions.rb @@ -382,6 +382,22 @@ module SiSU_Hub_Actions end end end + def json? + if @opt.act[:json][:set]==:on #% --js, -J + if @opt.f_pths.length > 0 + require_relative 'json' # json.rb + SiSU_JSON::Source.new(@opt).read + else + msg='json request requires sisu markup files' + if (@opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow). + mark(msg) + else puts msg + end + end + end + end def xhtml? if @opt.act[:xhtml][:set]==:on #% --xhtml, -b if @opt.f_pths.length > 0 -- cgit v1.2.3