maglove 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b22a9419f0ff8e87a3212443cfe557ede2e9624
4
- data.tar.gz: bbb9b6bf7c974fdea54e7ea65bbb2e9426732155
3
+ metadata.gz: ff5d1ae99cc8d4b474c2ba740bf92e44fe3dec08
4
+ data.tar.gz: 4247ba7aa9b33c14e38dabef3bb2473cf72b3e51
5
5
  SHA512:
6
- metadata.gz: 6a9d79dca313ebef3fe1b33de0ab1691d2e680830c3c582dc579f3dcb3f99fc54c9711abf5750205177d7a182b383929743daca98f55c558803f5da39c94a9dd
7
- data.tar.gz: 51295fe8128f91012d6345f25fd99316d3da13565ab600e799e7887dbc35c080908ea7ea9c25d62875178ae8d460e7b51e9778f2b5ba7b3005d23ae6eb627a84
6
+ metadata.gz: 80c3a41b527d7e9c3ec05f7fdf7dc1ea8e1f84719a317dc073934591206ab9f29f0f3ed451e21357857ce4e83dcd691da90939ec75b2a4e42458d711254d6c77
7
+ data.tar.gz: 5d85bed1d547b9636a9e0a885e196ff055b48d9a46a32c5fbffe692c265878c3ca1fdbab3674d51f78efa62fcea6284d883a0df3e888287f8046787ce0ee4a9f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maglove (0.6.2)
4
+ maglove (0.6.3)
5
5
  activesupport (~> 4.2)
6
6
  bundler (~> 1.10)
7
7
  coffee-script (~> 2.4)
@@ -7,6 +7,7 @@ module MagLove
7
7
  self.theme = theme
8
8
  self.port = port
9
9
  self.root = "dist/"
10
+ @widget_stamps = {}
10
11
 
11
12
  # create server
12
13
  self.webrick = WEBrick::HTTPServer.new(
@@ -16,10 +17,25 @@ module MagLove
16
17
  AccessLog: []
17
18
  )
18
19
 
20
+ # create widget hash maps
21
+ Dir["widgets/*.rb"].each do |file|
22
+ @widget_stamps[file] = File.mtime(file).to_i
23
+ end
24
+
19
25
  # template view actions
20
26
  templates = theme_config(:templates, self.theme)
21
27
  templates.each do |template|
22
28
  mount("/#{template}") do |req, res|
29
+
30
+ Dir["widgets/*.rb"].each do |file|
31
+ stamp = File.mtime(file).to_i
32
+ if @widget_stamps[file] and @widget_stamps[file] < stamp
33
+ @widget_stamps[file] = stamp
34
+ debug("▸ reloading widget: #{file}")
35
+ load(file)
36
+ end
37
+ end
38
+
23
39
  debug("▸ rendering template: #{template}")
24
40
 
25
41
  # Prepare variables
@@ -1,3 +1,3 @@
1
1
  module MagLove
2
- VERSION = "0.6.2"
2
+ VERSION = "0.6.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maglove
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Strebitzer