JoshCheek / miniature-octo-ironman

It's small. It had 8 legs. It sells weapons of mass comprehension to the most eager learner!
4 stars 4 forks source link

Layout #10

Closed AndyDangerous closed 10 years ago

AndyDangerous commented 10 years ago

Simple layout view (maybe with necessary js?) I've also added two new gems: rdiscount for markdown parsing haml for haml

JoshCheek commented 10 years ago
Feature: Document with code that prints output

  I want rubymonk style lessons

  Scenario:                                                    # features/omg.feature:5
    Given I have a document "lesson1.md":                      # features/support/env.rb:57
      """
      Hey, here's how to use size

      <div class="interactive-code">
        puts ['a', 'b', 'c'].size
      </div>
      """
[2014-08-29 23:47:51] INFO  WEBrick 1.3.1
[2014-08-29 23:47:51] INFO  ruby 2.1.1 (2014-02-24) [x86_64-darwin13.0]
== Sinatra/1.4.5 has taken the stage on 4567 for development with backup from WEBrick
[2014-08-29 23:47:51] INFO  WEBrick::HTTPServer#start: pid=2889 port=4567
WARN: tilt autoloading 'redcarpet' in a non thread-safe way; explicit require 'redcarpet' suggested.
WARN: tilt autoloading 'haml' in a non thread-safe way; explicit require 'haml' suggested.
Errno::ENOENT - No such file or directory @ rb_sysopen - /Users/josh/code/editors_in_lessons_yall/tmp/layout.haml:
    /Users/josh/.gem/ruby/2.1.1/gems/tilt-1.4.1/lib/tilt/template.rb:91:in `initialize'
    /Users/josh/.gem/ruby/2.1.1/gems/tilt-1.4.1/lib/tilt/template.rb:91:in `open'
    /Users/josh/.gem/ruby/2.1.1/gems/tilt-1.4.1/lib/tilt/template.rb:91:in `read_template_file'
    /Users/josh/.gem/ruby/2.1.1/gems/tilt-1.4.1/lib/tilt/template.rb:68:in `block in initialize'
    /Users/josh/.gem/ruby/2.1.1/gems/tilt-1.4.1/lib/tilt/template.rb:69:in `call'
    /Users/josh/.gem/ruby/2.1.1/gems/tilt-1.4.1/lib/tilt/template.rb:69:in `initialize'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:853:in `new'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:853:in `block in compile_template'
    /Users/josh/.gem/ruby/2.1.1/gems/tilt-1.4.1/lib/tilt.rb:127:in `fetch'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:832:in `compile_template'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:813:in `render'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:823:in `block in render'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:823:in `catch'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:823:in `render'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:708:in `markdown'
    /Users/josh/code/editors_in_lessons_yall/lib/app.rb:7:in `block in <class:MiniatureOctoIronman>'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `call'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `block in compile!'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `[]'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (3 levels) in route!'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:985:in `route_eval'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (2 levels) in route!'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1006:in `block in process_route'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `catch'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `process_route'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:964:in `block in route!'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `each'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `route!'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1076:in `block in dispatch!'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1073:in `dispatch!'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `block in call!'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `call!'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:886:in `call'
    /Users/josh/.gem/ruby/2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
    /Users/josh/.gem/ruby/2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
    /Users/josh/.gem/ruby/2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
    /Users/josh/.gem/ruby/2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
    /Users/josh/.gem/ruby/2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
    /Users/josh/.gem/ruby/2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
    /Users/josh/.gem/ruby/2.1.1/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:in `call'
    /Users/josh/.gem/ruby/2.1.1/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/show_exceptions.rb:21:in `call'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:180:in `call'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:2014:in `call'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `block in call'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1788:in `synchronize'
    /Users/josh/.gem/ruby/2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `call'
    /Users/josh/.gem/ruby/2.1.1/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
    /Users/josh/.rubies/ruby-2.1.1/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
    /Users/josh/.rubies/ruby-2.1.1/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
    /Users/josh/.rubies/ruby-2.1.1/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'
localhost - - [29/Aug/2014:23:47:53 MDT] "GET /lesson1 HTTP/1.1" 500 165764
- -> /lesson1
localhost - - [29/Aug/2014:23:47:53 MDT] "GET /__sinatra__/500.png HTTP/1.1" 200 24378
http://localhost:4567/lesson1 -> /__sinatra__/500.png
    When I visit "/lesson1"                                    # features/support/env.rb:63
    Then my page has "how to use size" on it                   # features/support/env.rb:67
    And my page has an editor with "puts ['a', 'b', 'c'].size" # features/support/env.rb:71
      TODO (Cucumber::Pending)
      ./features/support/env.rb:72:in `/^my\ page\ has\ an\ editor\ with\ "(.*)"$/'
      features/omg.feature:16:in `And my page has an editor with "puts ['a', 'b', 'c'].size"'
    When I submit the code in editor 1                         # features/support/env.rb:75
    Then I see an output box with "3" in it                    # features/support/env.rb:79

1 scenario (1 pending)
6 steps (2 skipped, 1 pending, 3 passed)
JoshCheek commented 10 years ago

Yeah, go ahead and merge it, we need it in place. I think our JS is just wrong, we need to host a whole bunch of stuff >.< (all of this)

Can you make another story for that? You don't have to do it, you can assign it to me (unless you're eager to do it or something, which I would appreciate :D b/c I fkn hate js, but, it could also be a fun thing for my friend and I to work on when he gets here, so whatevz).

Also, for the stylesheet, there is a :css tag, like the :javascript tag we're using.

AndyDangerous commented 10 years ago

I'd like to keep up with the next few steps here, but I'm going dark on the internet front for the next few days. I should be back on it on Tuesday or Wednesday. Looks like I can't merge it from here. (GitHub mobile isn't up to it yet)

JoshCheek commented 10 years ago

kk, have fun in the dark, I'll merge it in, thx ^_^