jinda 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/generators/jinda/install_generator.rb +1 -1
- data/lib/generators/jinda/templates/README.md +1 -1
- data/lib/generators/jinda/templates/app/controllers/jinda_org/jinda_controller.rb +21 -10
- data/lib/generators/jinda/templates/app/views/jinda/index.html.haml +1 -1
- data/lib/jinda/helpers.rb +4 -6
- data/lib/jinda/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86e26953c4782d41554c6d2d906ce58d2a2320ddfa49446d14920819fbd19990
|
4
|
+
data.tar.gz: 6e4752ee8dcab6758bcb5d3640fcb5af993800bfa965c6a937ab794f0066d5d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0ade9552fde2d3b14032f796845465cf591e70d8d906821301ada8f3e2e30456d9b2632cf7642663d1601e54d463d0ef848c78c8ed6a7eb94a48845d1605b56
|
7
|
+
data.tar.gz: 59b9411947dbc7290dc94fb7b4f37700554507a8b910c01324b29012e359428999a911118212e0490e0fbf5e2dc10e79af8b9e89d64b56b796c118f2d5c4c07d
|
data/README.md
CHANGED
@@ -170,6 +170,7 @@ class JindaController < ApplicationController
|
|
170
170
|
$user_id= current_ma_user.try(:id)
|
171
171
|
set_global
|
172
172
|
controller = Kernel.const_get(@xvars['custom_controller']).new
|
173
|
+
# call controller to do the freemind task using Star symbol eg: Update
|
173
174
|
result = controller.send(@runseq.code)
|
174
175
|
init_vars_by_runseq($runseq_id)
|
175
176
|
@xvars = $xvars
|
@@ -192,10 +193,13 @@ class JindaController < ApplicationController
|
|
192
193
|
def run_output
|
193
194
|
init_vars(params[:id])
|
194
195
|
service= @xmain.service
|
195
|
-
# disp= get_option("
|
196
|
-
disp=
|
196
|
+
# disp= get_option("display")
|
197
|
+
# disp = Nil or :"??????"
|
198
|
+
disp= get_option("display")
|
197
199
|
ma_display = (disp && !affirm(disp)) ? false : true
|
198
|
-
if
|
200
|
+
# Todo check if file is available
|
201
|
+
# if service and file exist
|
202
|
+
if service && !@runseq.code.blank?
|
199
203
|
f= "app/views/#{service.module.code}/#{service.code}/#{@runseq.code}.html.erb"
|
200
204
|
@ui= File.read(f)
|
201
205
|
if Jinda::Doc.where(:runseq_id=>@runseq.id).exists?
|
@@ -203,27 +207,34 @@ class JindaController < ApplicationController
|
|
203
207
|
@doc.update_attributes :data_text=> render_to_string(:inline=>@ui, :layout=>"utf8"),
|
204
208
|
:xmain=>@xmain, :runseq=>@runseq, :user=>current_ma_user,
|
205
209
|
:ip=> get_ip, :service=>service, :ma_display=>ma_display,
|
206
|
-
:ma_secured => @xmain.service.ma_secured
|
210
|
+
:ma_secured => @xmain.service.ma_secured,
|
211
|
+
:filename => "#{@runseq.code}.html.erb"
|
207
212
|
else
|
208
213
|
@doc= Jinda::Doc.create :name=> @runseq.name,
|
209
214
|
:content_type=>"output", :data_text=> render_to_string(:inline=>@ui, :layout=>"utf8"),
|
210
215
|
:xmain=>@xmain, :runseq=>@runseq, :user=>current_ma_user,
|
211
216
|
:ip=> get_ip, :service=>service, :ma_display=>ma_display,
|
212
|
-
:ma_secured => @xmain.service.ma_secured
|
217
|
+
:ma_secured => @xmain.service.ma_secured,
|
218
|
+
:filename => "#{@runseq.code}.html.erb"
|
213
219
|
end
|
214
|
-
@message = defined?(MSG_NEXT) ? MSG_NEXT : "Next >"
|
220
|
+
# @message = defined?(MSG_NEXT) ? MSG_NEXT : "Next >"
|
221
|
+
@message = defined?(MSG_NEXT) ? MSG_NEXT : "Next >>"
|
215
222
|
@message = "Finish" if @runseq.end
|
216
223
|
ma_log("Todo defined?(NSG_NEXT : Next >>)")
|
217
224
|
eval "@xvars[@runseq.code] = url_for(:controller=>'jinda', :action=>'document', :id=>@doc.id)"
|
218
225
|
else
|
219
|
-
|
226
|
+
flash[:notice]= "Error: Can not find the view file for this controller"
|
220
227
|
ma_log "Error: Can not find the view file for this controller"
|
221
228
|
redirect_to_root
|
222
229
|
end
|
223
|
-
#
|
230
|
+
#
|
231
|
+
# Check if ma_display available
|
232
|
+
#
|
233
|
+
# ma_display= get_option("ma_display")
|
224
234
|
unless ma_display
|
225
235
|
end_action
|
226
236
|
end
|
237
|
+
# display from @ui
|
227
238
|
end
|
228
239
|
def run_mail
|
229
240
|
init_vars(params[:id])
|
@@ -511,7 +522,7 @@ class JindaController < ApplicationController
|
|
511
522
|
i= i + 1
|
512
523
|
output_ma_display= false
|
513
524
|
if action=='output'
|
514
|
-
ma_display= get_option_xml("
|
525
|
+
ma_display= get_option_xml("display", activity)
|
515
526
|
if ma_display && !affirm(ma_display)
|
516
527
|
output_ma_display= false
|
517
528
|
else
|
@@ -520,7 +531,7 @@ class JindaController < ApplicationController
|
|
520
531
|
end
|
521
532
|
j= j + 1 if (action=='form' || output_ma_display)
|
522
533
|
@xvars['referer'] = activity.attributes['TEXT'] if action=='redirect'
|
523
|
-
if action!= 'if'
|
534
|
+
if action!= 'if' && !text.blank?
|
524
535
|
scode, name= text.split(':', 2)
|
525
536
|
name ||= scode; name.strip!
|
526
537
|
code= name2code(scode)
|
data/lib/jinda/helpers.rb
CHANGED
@@ -65,17 +65,13 @@ module Jinda
|
|
65
65
|
end
|
66
66
|
# Todo refactor code
|
67
67
|
def get_option(opt, runseq=@runseq)
|
68
|
-
ma_log("Todo in def get_option(opt, runseq=@runseq)")
|
69
68
|
xml= REXML::Document.new(runseq.xml).root
|
70
69
|
url=''
|
71
|
-
#
|
72
|
-
xml.each_element('
|
70
|
+
# get option from second element of node using '//node'
|
71
|
+
xml.each_element('//node') do |n|
|
73
72
|
if n.attributes['TEXT']
|
74
73
|
text = n.attributes['TEXT']
|
75
|
-
puts "text = " + text
|
76
74
|
url= text if text =~ /^#{opt}:\s*/
|
77
|
-
puts "url = " + url
|
78
|
-
ma_log("Todo in def get_option(opt, runseq=@runseq)")
|
79
75
|
end
|
80
76
|
end
|
81
77
|
return nil if url.blank?
|
@@ -642,11 +638,13 @@ module Jinda
|
|
642
638
|
return true
|
643
639
|
end
|
644
640
|
end
|
641
|
+
# return nil or value of opt: if provided
|
645
642
|
def get_option_xml(opt, xml)
|
646
643
|
if xml
|
647
644
|
url=''
|
648
645
|
xml.each_element('node') do |n|
|
649
646
|
text= n.attributes['TEXT']
|
647
|
+
# check if opt match from beginning of text
|
650
648
|
url= text if text =~/^#{opt}/
|
651
649
|
end
|
652
650
|
return nil if url.blank?
|
data/lib/jinda/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jinda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Prateep Kul
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-05-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|