Module: Sinatra::EngineTracking

Included in:
Capture
Defined in:
lib/sinatra/engine_tracking.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_engineObject (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

Returns:

  • (Boolean)


32
33
34
# File 'lib/sinatra/engine_tracking.rb', line 32

def builder?
  @current_engine == :builder
end

#coffee?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/sinatra/engine_tracking.rb', line 60

def coffee?
  @current_engine == :coffee
end

#creole?Boolean

Returns:

  • (Boolean)


72
73
74
# File 'lib/sinatra/engine_tracking.rb', line 72

def creole?
  @current_engine == :creole
end

#erb?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/sinatra/engine_tracking.rb', line 7

def erb?
  @current_engine == :erb
end

#erubis?Boolean

Returns:

  • (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

Returns:

  • (Boolean)


16
17
18
# File 'lib/sinatra/engine_tracking.rb', line 16

def haml?
  @current_engine == :haml
end

#initializeObject



76
77
78
79
# File 'lib/sinatra/engine_tracking.rb', line 76

def initialize(*)
  @current_engine = :ruby
  super
end

#less?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/sinatra/engine_tracking.rb', line 28

def less?
  @current_engine == :less
end

#liquid?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/sinatra/engine_tracking.rb', line 36

def liquid?
  @current_engine == :liquid
end

#markaby?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/sinatra/engine_tracking.rb', line 56

def markaby?
  @current_engine == :markaby
end

#markdown?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/sinatra/engine_tracking.rb', line 40

def markdown?
  @current_engine == :markdown
end

#nokogiri?Boolean

Returns:

  • (Boolean)


64
65
66
# File 'lib/sinatra/engine_tracking.rb', line 64

def nokogiri?
  @current_engine == :nokogiri
end

#radius?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/sinatra/engine_tracking.rb', line 52

def radius?
  @current_engine == :radius
end

#rdoc?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/sinatra/engine_tracking.rb', line 48

def rdoc?
  @current_engine == :rdoc
end

#sass?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/sinatra/engine_tracking.rb', line 20

def sass?
  @current_engine == :sass
end

#scss?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/sinatra/engine_tracking.rb', line 24

def scss?
  @current_engine == :scss
end

#slim?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/sinatra/engine_tracking.rb', line 68

def slim?
  @current_engine == :slim
end

#textile?Boolean

Returns:

  • (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