snackpack 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/snackpack/snack_log.rb +7 -3
  2. metadata +1 -1
@@ -8,7 +8,7 @@ class SnackLog
8
8
  def build
9
9
  Dir[@stomach+'*'].each do |folder|
10
10
  menu = fetch_menu(folder)
11
- write_log(menu)
11
+ write_log(menu) if menu.first
12
12
  end
13
13
  FileUtils.mv(@temp_menu.path, @snack_log)
14
14
  end
@@ -20,11 +20,15 @@ class SnackLog
20
20
 
21
21
  def write_log(menu)
22
22
  File.open(@temp_menu, 'a') do |f|
23
- menu_title = get_title(menu.first) if menu.first
24
- f.puts "<p><a href='#{menu.first}'>#{menu_title}</a></p>"
23
+ menu_title = get_title(menu.first)
24
+ f.puts "<p><a href='#{relative_path(menu.first)}'>#{menu_title}</a></p>"
25
25
  end
26
26
  end
27
27
 
28
+ def relative_path(menu)
29
+ menu.gsub!(/#{@stomach}/, './')
30
+ end
31
+
28
32
  def get_title(menu)
29
33
  title = menu.match(/[-]\d+.+[html]$/).to_s
30
34
  title.gsub!(/\d/, '')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snackpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: