awestruct / web-editor

A web based editor for awestruct projects
8 stars 6 forks source link

Awestruct fails rendering a file #70

Open pmuir opened 11 years ago

pmuir commented 11 years ago

I'm trying to render the current jboss-developer-site. I save, and open the preview for developer-materials/README.md. It looks like nothing happens, but I do get this error in the console log:

I, [2013-10-17T16:00:36.507467 #13873]  INFO -- : executing external script to render file
E, [2013-10-17T16:00:40.531400 #13873] ERROR -- : Error during rendering: a+

JSON::GeneratorError - only generation of JSON objects or arrays allowed:
  /Users/pmuir/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/json/common.rb:216:in `generate'
    /Users/pmuir/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/json/common.rb:216:in `generate'
    /Users/pmuir/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/json/common.rb:352:in `dump'
    /Users/pmuir/tmp/web-editor/public_app.rb:352:in `block (2 levels) in retrieve_rendered_file'
    /Users/pmuir/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/open3.rb:208:in `popen_run'
    /Users/pmuir/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/open3.rb:90:in `popen3'
    /Users/pmuir/tmp/web-editor/public_app.rb:339:in `block in retrieve_rendered_file'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler.rb:218:in `block in with_clean_env'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler.rb:205:in `with_original_env'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler.rb:211:in `with_clean_env'
    /Users/pmuir/tmp/web-editor/public_app.rb:338:in `retrieve_rendered_file'
    /Users/pmuir/tmp/web-editor/public_app.rb:333:in `save_or_create'
    /Users/pmuir/tmp/web-editor/public_app.rb:220:in `block in <class:PublicApp>'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:1540:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:1540:in `block in compile!'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:950:in `[]'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:950:in `block (3 levels) in route!'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:966:in `route_eval'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:950:in `block (2 levels) in route!'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:987:in `block in process_route'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:985:in `catch'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:985:in `process_route'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:948:in `block in route!'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:947:in `each'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:947:in `route!'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:1059:in `block in dispatch!'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:1041:in `block in invoke'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:1041:in `catch'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:1041:in `invoke'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:1056:in `dispatch!'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:882:in `block in call!'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:1041:in `block in invoke'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:1041:in `catch'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:1041:in `invoke'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:882:in `call!'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:870:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-1.5.2/lib/rack/commonlogger.rb:33:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:212:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-protection-1.5.0/lib/rack/protection/xss_header.rb:18:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-protection-1.5.0/lib/rack/protection/path_traversal.rb:16:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-protection-1.5.0/lib/rack/protection/json_csrf.rb:18:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-protection-1.5.0/lib/rack/protection/base.rb:49:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-protection-1.5.0/lib/rack/protection/base.rb:49:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-protection-1.5.0/lib/rack/protection/frame_options.rb:31:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-1.5.2/lib/rack/logger.rb:15:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:205:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/showexceptions.rb:21:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:175:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:1949:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:1449:in `block in call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:1726:in `synchronize'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:1449:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-1.5.2/lib/rack/urlmap.rb:65:in `block in call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `each'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-1.5.2/lib/rack/lint.rb:49:in `_call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-1.5.2/lib/rack/lint.rb:37:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-1.5.2/lib/rack/showexceptions.rb:24:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-1.5.2/lib/rack/commonlogger.rb:33:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/sinatra-1.4.3/lib/sinatra/base.rb:212:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-1.5.2/lib/rack/chunked.rb:43:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
    /Users/pmuir/.rvm/gems/ruby-1.9.3-p429@sinatra/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
    /Users/pmuir/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
    /Users/pmuir/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
    /Users/pmuir/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
127.0.0.1 - - [17/Oct/2013 16:00:40] "POST /repo/jboss-developer-site/_developer-materials/README.adoc HTTP/1.1" 500 199568 4.1574
LightGuard commented 11 years ago

Pete, try a file that isn't under a "" directory. Awestruct ignores all files under directories preceded with a ""

pmuir commented 11 years ago

Aha. We should definitely improve the options to point that out :-)

LightGuard commented 11 years ago

I'm thinking of a time when we'd want people to edit anything in one of those directories. Maybe we should simply filter them out.

Sent from my iPhone

On Oct 18, 2013, at 6:29, Pete Muir notifications@github.com wrote:

Aha. We should definitely improve the options to point that out :-)

\ Reply to this email directly or view it on GitHub.

pmuir commented 11 years ago

Or just call it out on the editor page.

On 18 Oct 2013, at 14:03, Jason Porter notifications@github.com wrote:

I'm thinking of a time when we'd want people to edit anything in one of those directories. Maybe we should simply filter them out.

Sent from my iPhone

On Oct 18, 2013, at 6:29, Pete Muir notifications@github.com wrote:

Aha. We should definitely improve the options to point that out :-)

\ Reply to this email directly or view it on GitHub. — Reply to this email directly or view it on GitHub.

wesbos commented 11 years ago

@LightGuard Are we / are we able to send a message along with the 500 error? Then we can display a message saying that it didn't work

LightGuard commented 11 years ago

It's so much of a hack right now, trying to pull in error messages would be difficult with the current version of awestruct. In 1.0.0 (whenever that happens. Meaning when I have time to cut two more releases and do a fairly major rework of the code) It'll be easier, but right now now I have another ruby script that goes through and generates the site and tells me how pages are mapped from their base to the final output.