Module: Sinatra::EngineTracking
- Included in:
- Capture
- Defined in:
- lib/sinatra/engine_tracking.rb
Instance Attribute Summary collapse
-
#current_engine ⇒ Object
readonly
Returns the value of attribute current_engine.
Instance Method Summary collapse
- #builder? ⇒ Boolean
- #coffee? ⇒ Boolean
- #creole? ⇒ Boolean
- #erb? ⇒ Boolean
- #erubis? ⇒ Boolean
- #haml? ⇒ Boolean
- #initialize ⇒ Object
- #less? ⇒ Boolean
- #liquid? ⇒ Boolean
- #markaby? ⇒ Boolean
- #markdown? ⇒ Boolean
- #nokogiri? ⇒ Boolean
- #radius? ⇒ Boolean
- #rdoc? ⇒ Boolean
- #sass? ⇒ Boolean
- #scss? ⇒ Boolean
- #slim? ⇒ Boolean
- #textile? ⇒ Boolean
- #with_engine(engine) ⇒ Object
Instance Attribute Details
#current_engine ⇒ Object (readonly)
Returns the value of attribute current_engine.
5 6 7 |
# File 'lib/sinatra/engine_tracking.rb', line 5 def current_engine @current_engine end |
Instance Method Details
#builder? ⇒ Boolean
32 33 34 |
# File 'lib/sinatra/engine_tracking.rb', line 32 def builder? @current_engine == :builder end |
#coffee? ⇒ Boolean
60 61 62 |
# File 'lib/sinatra/engine_tracking.rb', line 60 def coffee? @current_engine == :coffee end |
#creole? ⇒ Boolean
72 73 74 |
# File 'lib/sinatra/engine_tracking.rb', line 72 def creole? @current_engine == :creole end |
#erb? ⇒ Boolean
7 8 9 |
# File 'lib/sinatra/engine_tracking.rb', line 7 def erb? @current_engine == :erb end |
#erubis? ⇒ Boolean
11 12 13 14 |
# File 'lib/sinatra/engine_tracking.rb', line 11 def erubis? @current_engine == :erubis or erb? && Tilt[:erb] == Tilt::ErubisTemplate end |
#haml? ⇒ Boolean
16 17 18 |
# File 'lib/sinatra/engine_tracking.rb', line 16 def haml? @current_engine == :haml end |
#initialize ⇒ Object
76 77 78 79 |
# File 'lib/sinatra/engine_tracking.rb', line 76 def initialize(*) @current_engine = :ruby super end |
#less? ⇒ Boolean
28 29 30 |
# File 'lib/sinatra/engine_tracking.rb', line 28 def less? @current_engine == :less end |
#liquid? ⇒ Boolean
36 37 38 |
# File 'lib/sinatra/engine_tracking.rb', line 36 def liquid? @current_engine == :liquid end |
#markaby? ⇒ Boolean
56 57 58 |
# File 'lib/sinatra/engine_tracking.rb', line 56 def markaby? @current_engine == :markaby end |
#markdown? ⇒ Boolean
40 41 42 |
# File 'lib/sinatra/engine_tracking.rb', line 40 def markdown? @current_engine == :markdown end |
#nokogiri? ⇒ Boolean
64 65 66 |
# File 'lib/sinatra/engine_tracking.rb', line 64 def nokogiri? @current_engine == :nokogiri end |
#radius? ⇒ Boolean
52 53 54 |
# File 'lib/sinatra/engine_tracking.rb', line 52 def radius? @current_engine == :radius end |
#rdoc? ⇒ Boolean
48 49 50 |
# File 'lib/sinatra/engine_tracking.rb', line 48 def rdoc? @current_engine == :rdoc end |
#sass? ⇒ Boolean
20 21 22 |
# File 'lib/sinatra/engine_tracking.rb', line 20 def sass? @current_engine == :sass end |
#scss? ⇒ Boolean
24 25 26 |
# File 'lib/sinatra/engine_tracking.rb', line 24 def scss? @current_engine == :scss end |
#slim? ⇒ Boolean
68 69 70 |
# File 'lib/sinatra/engine_tracking.rb', line 68 def slim? @current_engine == :slim end |
#textile? ⇒ Boolean
44 45 46 |
# File 'lib/sinatra/engine_tracking.rb', line 44 def textile? @current_engine == :textile end |
#with_engine(engine) ⇒ Object
81 82 83 84 85 86 |
# File 'lib/sinatra/engine_tracking.rb', line 81 def with_engine(engine) @current_engine, engine_was = engine.to_sym, @current_engine yield ensure @current_engine = engine_was end |