Module: Jinda::GemHelpers
- Includes:
- Helpers
- Defined in:
- lib/jinda/gemhelpers.rb
Instance Method Summary
collapse
Methods included from Helpers
#add_jinda, #add_utf8, #affirm, #ajax?, #align_text, #authorize?, #authorize_init?, #b, #code_div, #code_text, #current_ma_user, #dup_hash, #freemind2action, #gen_views, #get_app, #get_default_role, #get_ip, #get_login_user_info, #get_option, #get_option_xml, #link_to_blank, #listed, #login?, #m_icon, #ma_comment?, #ma_log, #ma_menu?, #ma_secured?, #make_fields, #make_folders_absolute, #markdown, #model_exists?, #name2camel, #name2code, #negate, #own_xmain?, #process_models, #process_services, #read_binary, #redirect_to_root, #refresh_to, #role_name, #set_global, #sign_in?, #status_icon, #step, #true_action?, #ui_action?, #uncomment
Instance Method Details
#controller_exists?(modul) ⇒ Boolean
11
12
13
|
# File 'lib/jinda/gemhelpers.rb', line 11
def controller_exists?(modul)
File.exists? $gem_root + "/lib/generators/jinda/templates/app/controllers/#{modul}_controller.rb"
end
|
#gen_view_createfile(sv, f, t) ⇒ Object
39
40
41
42
43
44
45
|
# File 'lib/jinda/gemhelpers.rb', line 39
def gen_view_createfile(sv,f,t)
gsv = $gem_root + "/lib/generators/jinda/templates/" + sv
gf = $gem_root + "/spec/temp/" + f
FileUtils.cp gsv,gf
t << "create file #{gf}"
end
|
#gen_view_file_exist?(dir) ⇒ Boolean
28
29
30
31
|
# File 'lib/jinda/gemhelpers.rb', line 28
def gen_view_file_exist?(dir)
gdir = $gem_root + "/spec/temp/" + dir
File.exists?(gdir)
end
|
#gen_view_mkdir(dir, t) ⇒ Object
33
34
35
36
37
|
# File 'lib/jinda/gemhelpers.rb', line 33
def gen_view_mkdir(dir,t)
gdir = $gem_root + "/spec/temp/" + dir
Dir.mkdir(gdir)
t << "create directory #{gdir}"
end
|
#process_controllers ⇒ Object
Mock generate controller for test Otherwise test will call rails g controller
19
20
21
22
23
24
25
26
|
# File 'lib/jinda/gemhelpers.rb', line 19
def process_controllers
process_services
modules= Jinda::Module.all
modules.each do |m|
next if controller_exists?(m.code)
puts " Rails generate controller #{m.code}"
end
end
|