aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/hub_actions.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2016-02-24 23:21:06 -0500
committerRalph Amissah <ralph@amissah.com>2016-02-24 23:54:58 -0500
commitee91e6282464321d5f1e8694c048c24abf8d15d7 (patch)
treef625748df5ac43de3b19ad96863b098eb1231af6 /lib/sisu/hub_actions.rb
parenttxt_orgmode, update (dp add email header field) (diff)
json, an output representation, first pass
Diffstat (limited to 'lib/sisu/hub_actions.rb')
-rw-r--r--lib/sisu/hub_actions.rb16
1 files changed, 16 insertions, 0 deletions
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