Skip to content

Commit 8ba8897

Browse files
committed
Fix loading for visual app
1 parent b8793d9 commit 8ba8897

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

config.ru

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# frozen_string_literal: true
22

3-
require 'pathname'
4-
5-
here = Pathname.new(__FILE__).dirname
6-
load here.join('spec/visual/app.rb')
3+
require_relative 'spec/visual/app'
74

85
run VisualTestApp

spec/visual/app.rb

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,15 @@
88
# stdlib
99
require 'pathname'
1010

11+
require 'rouge'
12+
1113
class VisualTestApp < Sinatra::Application
1214
BASE = Pathname.new(__FILE__).dirname
1315
SAMPLES = BASE.join('samples')
1416
ROOT = BASE.parent.parent
1517

16-
ROUGE_LIB = ROOT.join('lib/rouge.rb')
17-
1818
DEMOS = ROOT.join('lib/rouge/demos')
1919

20-
def reload_source!
21-
Rouge.reload!
22-
end
23-
2420
def query_string
2521
env['rack.request.query_string']
2622
end
@@ -66,8 +62,6 @@ def as_boolean(value)
6662
end
6763

6864
before do
69-
reload_source!
70-
7165
Rouge::Lexer.enable_debug!
7266
Rouge::Formatter.enable_escape! if params[:escape]
7367

@@ -92,7 +86,6 @@ def as_boolean(value)
9286
erb template
9387
end
9488

95-
9689
get '/' do
9790
@samples = DEMOS.entries.sort.reject { |s| s.basename.to_s =~ /^\.|~$/ }
9891
@samples.map!(&Rouge::Lexer.method(:find))

0 commit comments

Comments
 (0)