Class Webgen::CLI::WebguiCommand
In: lib/webgen/cli/webgui_command.rb
Parent: CmdParse::Command
Error RenderError CommandNotFoundError LoadError NodeCreationError ::Rake::TaskLib WebgenTask Context\n[lib/webgen/context.rb\nlib/webgen/context/nodes.rb\nlib/webgen/context/render.rb\nlib/webgen/context/tags.rb] Node Tree FileSystem Sitemap Coderay Sitemap IncludeFile Langbar BreadcrumbTrail TikZ Menu Feed Copy Virtual Sitemap Directory Page Fragment Template Metainfo Memory Resource Tags Fragments Website Tidy Head Kramdown Less Xmllint Blocks Helpers Configuration Comparable Language Path StandardError CmdParse::CommandParser CommandParser CmdParse::Command RunCommand WebguiCommand CreateCommand ApplyCommand ExecuteCommand Link Date Relocatable Metainfo WebsiteAccess Main Loggable OutputPathHelpers ::Kramdown::Converter::Html KramdownHtmlConverter Cache Blackboard WebsiteManager Logger Page ProxyNode Utils TarArchive Stacked FileSystem RDoc Sass Erb RDiscount Erubis Haml Maruku Builder RedCloth AccessHash lib/webgen/cache.rb lib/webgen/error.rb lib/webgen/languages.rb lib/webgen/blackboard.rb lib/webgen/website.rb lib/webgen/tree.rb lib/webgen/websitemanager.rb lib/webgen/logger.rb lib/webgen/configuration.rb lib/webgen/context/tags.rb lib/webgen/path.rb lib/webgen/webgentask.rb lib/webgen/page.rb lib/webgen/node.rb lib/webgen/cli/run_command.rb lib/webgen/cli/utils.rb lib/webgen/cli/apply_command.rb lib/webgen/cli/webgui_command.rb lib/webgen/cli.rb lib/webgen/cli/create_command.rb Color CLI ClassMethods WebsiteAccess LanguageManager lib/webgen/output/filesystem.rb Output lib/webgen/common/sitemap.rb Common lib/webgen/tag/coderay.rb lib/webgen/tag/relocatable.rb lib/webgen/tag/menu.rb lib/webgen/tag/langbar.rb lib/webgen/tag/executecommand.rb lib/webgen/tag/breadcrumbtrail.rb lib/webgen/tag/metainfo.rb lib/webgen/tag/includefile.rb lib/webgen/tag/link.rb lib/webgen/tag/date.rb lib/webgen/tag/tikz.rb lib/webgen/tag/sitemap.rb Base Tag lib/webgen/sourcehandler/memory.rb lib/webgen/sourcehandler/metainfo.rb lib/webgen/sourcehandler/copy.rb lib/webgen/sourcehandler/directory.rb lib/webgen/sourcehandler.rb lib/webgen/sourcehandler/page.rb lib/webgen/sourcehandler/template.rb lib/webgen/sourcehandler/fragment.rb lib/webgen/sourcehandler/sitemap.rb lib/webgen/sourcehandler/virtual.rb lib/webgen/sourcehandler/feed.rb OutputPathHelpers Base SourceHandler lib/webgen/source/tararchive.rb lib/webgen/source/stacked.rb lib/webgen/source/resource.rb lib/webgen/source/filesystem.rb Source lib/webgen/contentprocessor/less.rb lib/webgen/contentprocessor/blocks.rb lib/webgen/contentprocessor/rdoc.rb lib/webgen/contentprocessor/sass.rb lib/webgen/contentprocessor/erb.rb lib/webgen/contentprocessor/rdiscount.rb lib/webgen/contentprocessor/tags.rb lib/webgen/contentprocessor/erubis.rb lib/webgen/contentprocessor/kramdown/html.rb lib/webgen/contentprocessor/haml.rb lib/webgen/contentprocessor/maruku.rb lib/webgen/contentprocessor/xmllint.rb lib/webgen/contentprocessor/kramdown.rb lib/webgen/contentprocessor/head.rb lib/webgen/contentprocessor/builder.rb lib/webgen/contentprocessor/tidy.rb lib/webgen/contentprocessor/redcloth.rb lib/webgen/contentprocessor/fragments.rb lib/webgen/contentprocessor.rb ContentProcessor Loggable Webgen dot/m_81_0.png

The CLI command for starting the webgen webgui.

Methods

execute  

Public Instance methods

Render the website.

[Source]

    # File lib/webgen/cli/webgui_command.rb, line 16
16:     def execute(args)
17:       # some fixes for ramaze-2009.04
18:       # - fix for Windows when win32console is not installed
19:       # - fix for message displayed on shutdown
20:       # - fix for warning message
21:       $:.unshift File.join(Webgen.data_dir, 'webgui', 'overrides')
22:       require 'win32console'
23:       $:.shift
24:       begin
25:         oldv, $VERBOSE = $VERBOSE, nil
26:         begin
27:           require 'ramaze/snippets/object/__dir__'
28:           Object.__send__(:include, Ramaze::CoreExtensions::Object)
29:           require 'ramaze'
30:         rescue LoadError
31:           puts "The Ramaze web framework which is needed for the webgui was not found."
32:           puts "You can install it via 'gem install ramaze --version 2009.04'"
33:           return
34:         end
35:       ensure
36:         $VERBOSE = oldv
37:       end
38:       def Ramaze.shutdown; # :nodoc:
39:       end
40: 
41:       require File.join(Webgen.data_dir, 'webgui', 'app.rb')
42:       Ramaze::Log.loggers = []
43:       Ramaze.options[:middleware_compiler]::COMPILED[:dev].middlewares.delete_if do |app, args, block|
44:         app == Rack::CommonLogger
45:       end
46: 
47:       puts 'Starting webgui on http://localhost:7000, press Control-C to stop'
48: 
49:       Thread.new do
50:         begin
51:           require 'launchy'
52:           sleep 1
53:           puts 'Launching web browser'
54:           Launchy.open('http://localhost:7000')
55:         rescue LoadError
56:           puts "Can't open browser because the launchy library was not found."
57:           puts "You can install it via 'gem install launchy'"
58:           puts "Please open a browser window and enter 'http://localhost:7000' into the address bar!"
59:         end
60:       end
61: 
62:       Ramaze.start(:adapter => :webrick, :port => 7000, :file => File.join(Webgen.data_dir, 'webgui', 'app.rb'))
63:       puts 'webgui finished'
64:     end

[Validate]