octopress-ink 1.0.0.alpha.41 → 1.0.0.alpha.42

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7cafd4614b86a0c2ee67bd091d9603518488deb2
4
- data.tar.gz: 89ed549eaa1b6fd06225f005229ac923ac6cc73e
3
+ metadata.gz: 9ea8a006600a51e0bfc3c4816f20da55e849d52a
4
+ data.tar.gz: 5a4e760a5f58d4225bced80fd31d57f80c904683
5
5
  SHA512:
6
- metadata.gz: c89bec5e91f8579d7a0daf2f218cc920dc4f0f0c3ce416207c00635c3b94bb833d0f39ec7ae65c2a79189c5609a72028cbdfc8b4b8da658fdcf7736be3d0c1cb
7
- data.tar.gz: 917bcefdc14014139f9eb56125f38bf64b94d5c18cf8524c46aae20d10898858b3572c1954ff2770ae59ea5789164a92ecf27415c9624bc37978f5746c1676dd
6
+ metadata.gz: 188cec7106b750e62cd193bb5c54fea9965c3733b5854ab02a30562ea00ae3cb1867eccaf78ba9814f4f8156ef4e7d1c273adbb21b130cefa3152a77c1b9aadc
7
+ data.tar.gz: 84967eb34ce31062e3699c6f9a4009cbbc8146db0da74d9be6d1372773a0fe7b371017eddbe7b0f19e4b060e10358c764da078b1ddf11d4552f75496719d431e
@@ -41,8 +41,9 @@ module Octopress
41
41
  @page.data['plugin'] = {
42
42
  'name' => @plugin.name,
43
43
  'slug' => @plugin.slug,
44
- 'docs_base_path' => plugin.docs_base_path
44
+ 'docs_base_path' => plugin.docs_base_path,
45
45
  }
46
+ @page.data['dir'] = File.dirname(plugin_path)
46
47
  @page.data['doc_pages'] = @plugin.doc_pages
47
48
  @page
48
49
  end
@@ -23,10 +23,15 @@ module Octopress
23
23
  def self.expand(file, context)
24
24
  root = context.registers[:site].source
25
25
 
26
- # If local file, e.g. ./somefile
27
- if file =~ /^\.\/(.+)/
28
- local_dir = File.dirname context.registers[:page]['path']
29
- File.join root, local_dir, $1
26
+ # If relative path, e.g. ./somefile, ../somefile
27
+ if file =~ /^\.+\//
28
+ page = context['page']
29
+ if local_dir = page['dir']
30
+ File.expand_path(File.join(local_dir, file))
31
+ else
32
+ local_dir = File.dirname page['path']
33
+ File.expand_path(File.join(root, local_dir, file))
34
+ end
30
35
 
31
36
  # If absolute or relative to a user directory, e.g. /Users/Bob/somefile or ~/somefile
32
37
  elsif file =~ /^[\/~]/
@@ -274,7 +274,11 @@ module Octopress
274
274
  end
275
275
 
276
276
  def add_docs
277
- @docs = add_new_assets(@docs_dir, Assets::DocPageAsset)
277
+ find_assets(@docs_dir).each do |asset|
278
+ unless asset =~ /^_/
279
+ @docs << Assets::DocPageAsset.new(self, @docs_dir, asset)
280
+ end
281
+ end
278
282
  end
279
283
 
280
284
  def add_files
@@ -53,7 +53,7 @@ module Octopress
53
53
  path = markup.match(SYNTAX)[1]
54
54
  @path = Helpers::Path.expand(path, context)
55
55
  begin
56
- Pathname.new(@path).read
56
+ File.open(@path).read
57
57
  rescue
58
58
  raise IOError.new "Render failed: {% #{@tag_name} #{@og_markup}%}. The file '#{path}' could not be found at #{@path}."
59
59
  end
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Ink
3
- VERSION = "1.0.0.alpha.41"
3
+ VERSION = "1.0.0.alpha.42"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-ink
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha.41
4
+ version: 1.0.0.alpha.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis