Sha256: 011fded386a6fa98011468e7047e7ec784d7758d9a50445b989e270acb8dedab

Contents?: true

Size: 1.93 KB

Versions: 18

Compression:

Stored size: 1.93 KB

Contents

    ########################################################################
    #                            Jinda Rake Task                           #
    ########################################################################

    def gen_views
      t = ["*** generate ui ***"]

      # create array of files to be tested
      $afile = Array.new

      Jinda::Module.all.each do |m|
        m.services.each do |s|
          dir ="app/views/#{s.module.code}"
          unless gen_view_file_exist?(dir)
            gen_view_mkdir(dir,t) 
          end

          if s.code=='link'
            f= "app/views/#{s.module.code}/index.haml"
            $afile << f
            unless gen_view_file_exist?(f)
              sv = "app/jinda/template/linkview.haml"
              f= "app/views/#{s.module.code}/index.haml"
              gen_view_createfile(sv,f,t)
            end
            next   
          end

          dir ="app/views/#{s.module.code}/#{s.code}"
          unless gen_view_file_exist?(dir)
            gen_view_mkdir(dir,t) 
          end

          xml= REXML::Document.new(s.xml)
          xml.elements.each('*/node') do |activity|
            icon = activity.elements['icon']
            next unless icon
            action= freemind2action(icon.attributes['BUILTIN'])
            next unless ui_action?(action)
            code_name = activity.attributes["TEXT"].to_s
            next if code_name.comment?
            code= name2code(code_name)
            if action=="pdf"
              f= "app/views/#{s.module.code}/#{s.code}/#{code}.pdf.prawn"
            else
              f= "app/views/#{s.module.code}/#{s.code}/#{code}.html.erb"
            end
            $afile << f
            unless gen_view_file_exist?(f)
              sv = "app/jinda/template/view.html.erb"
              gen_view_createfile(sv,f,t)
            end
          end
        end
      end
      puts $afile.join("\n")
      puts t.join("\n")
      return $afile  
    end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
jinda-0.7.7 lib/jinda/rake_views.rb
jinda-0.7.6 lib/jinda/rake_views.rb
jinda-0.7.5.5 lib/jinda/rake_views.rb
jinda-0.7.5.4 lib/jinda/rake_views.rb
jinda-0.7.5.3 lib/jinda/rake_views.rb
jinda-0.7.5.2 lib/jinda/rake_views.rb
jinda-0.7.5.0 lib/jinda/rake_views.rb
jinda-0.7.3 lib/jinda/rake_views.rb
jinda-0.7.2 lib/jinda/rake_views.rb
jinda-0.7.1 lib/jinda/rake_views.rb
jinda-0.7.0.4 lib/jinda/rake_views.rb
jinda-0.7.0.3 lib/jinda/rake_views.rb
jinda-0.7.0.2 lib/jinda/rake_views.rb
jinda-0.7.0.1 lib/jinda/rake_views.rb
jinda-0.7.0 lib/jinda/rake_views.rb
jinda-0.6.9 lib/jinda/rake_views.rb
jinda-0.6.8 lib/jinda/rake_views.rb
jinda-0.6.7 lib/jinda/rake_views.rb