kontrol 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/kontrol/template.rb +6 -4
  2. metadata +1 -1
@@ -2,7 +2,9 @@ module Kontrol
2
2
 
3
3
  class View
4
4
 
5
- def initialize(variables)
5
+ def initialize(app, variables)
6
+ @__app__ = app
7
+
6
8
  variables.each do |k, v|
7
9
  instance_variable_set "@#{k}", v
8
10
  end
@@ -34,8 +36,8 @@ module Kontrol
34
36
  end
35
37
 
36
38
  def load
37
- @mtime = File.mtime(file)
38
- @erb = ERB.new(File.read(file))
39
+ @mtime = File.mtime(@file)
40
+ @erb = ERB.new(File.read(@file))
39
41
  end
40
42
 
41
43
  def changed?
@@ -49,7 +51,7 @@ module Kontrol
49
51
 
50
52
  rescue => e
51
53
  e.backtrace.each do |s|
52
- s.gsub!('(erb)', file)
54
+ s.gsub!('(erb)', @file)
53
55
  end
54
56
  raise e
55
57
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kontrol
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthias Georgi