jinda 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ecac4f20399ba16041c265028b66ed5121fc564fcd1d03232bc63c49bae06d59
4
- data.tar.gz: 040c63dd43667737d2388b89eb4c682ae77c27b859308730f957b4505cc0cf1d
3
+ metadata.gz: 86e26953c4782d41554c6d2d906ce58d2a2320ddfa49446d14920819fbd19990
4
+ data.tar.gz: 6e4752ee8dcab6758bcb5d3640fcb5af993800bfa965c6a937ab794f0066d5d8
5
5
  SHA512:
6
- metadata.gz: ca4d56c87c21ee29adea2d9068ff6bbd7f272dc3da85dfef033e05895ea9d905e7fdeeda28acb4184c4271aca81028240e7e6cd48f078539d86484f6c6532a6e
7
- data.tar.gz: a30945796a4c41f85fbc859260e54867a0db663247c5ef5318da374d4d0ec6c5cdc386371f62f895076eccd8de2420b77156d8ec27fcbd31545895f89577b45c
6
+ metadata.gz: c0ade9552fde2d3b14032f796845465cf591e70d8d906821301ada8f3e2e30456d9b2632cf7642663d1601e54d463d0ef848c78c8ed6a7eb94a48845d1605b56
7
+ data.tar.gz: 59b9411947dbc7290dc94fb7b4f37700554507a8b910c01324b29012e359428999a911118212e0490e0fbf5e2dc10e79af8b9e89d64b56b796c118f2d5c4c07d
data/README.md CHANGED
@@ -40,7 +40,7 @@ app without ActiveRecord
40
40
 
41
41
  ## Add jinda to your Gemfile:
42
42
 
43
- gem 'jinda', '~> 0.4.9'
43
+ gem 'jinda', '~> 0.5.1'
44
44
 
45
45
  For Development (most updated)
46
46
 
@@ -150,7 +150,7 @@ module Jinda
150
150
  end
151
151
 
152
152
  # config time zone
153
- # config.time_zone = "Central Time (US & Canada)"
153
+ config.time_zone = "Central Time (US & Canada)"
154
154
 
155
155
  # gmail config
156
156
  # config.action_mailer.delivery_method = :smtp
@@ -36,7 +36,7 @@ app without ActiveRecord
36
36
 
37
37
  ## Add jinda to your Gemfile:
38
38
 
39
- gem 'jinda', '~> 0.5.0'
39
+ gem 'jinda', '~> 0.5.1'
40
40
 
41
41
  For Development (most updated)
42
42
 
@@ -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("ma_display")
196
- disp= get_option("ma_display")
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 service
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 &gt;"
220
+ # @message = defined?(MSG_NEXT) ? MSG_NEXT : "Next &gt;"
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
- # flash[:notice]= "Error: Can not find the view file for this controller"
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
- #ma_display= get_option("ma_display")
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("ma_display", activity)
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)
@@ -21,7 +21,7 @@
21
21
 
22
22
  %h2 Installation
23
23
  %ul
24
- %li add gem 'jinda', '0.5.0'
24
+ %li add gem 'jinda', '0.5.1'
25
25
  %li bundle
26
26
  %li rails generate jinda:install
27
27
  %li (run all with "sh install.sh" )
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
- # xml.each_element('///node') do |n|
72
- xml.each_element('/node') do |n|
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
@@ -1,3 +1,3 @@
1
1
  module Jinda
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
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.0
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-04-28 00:00:00.000000000 Z
12
+ date: 2020-05-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler