Skip to content

Commit

Permalink
Construct path to the data directory using __FILE__ instead of __dir_…
Browse files Browse the repository at this point in the history
…_ for Opal compatbility per Mogztter's suggestion
  • Loading branch information
jxxcarlson committed Jul 21, 2016
1 parent caaa320 commit b5c9de1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/asciidoctor/latex.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
module Asciidoctor
module LaTeX
DATA_DIR = File.expand_path '../../data', __dir__
# Old -- to remove:
#DATA_DIR = File.expand_path '../../data', __dir__

# -- per @Mogztter's suggestion, needed for compatibility with Opal:
DATA_DIR = (::File.dirname ::File.dirname ::File.dirname ::File.expand_path __FILE__) + '/data'
end
end

Expand Down

1 comment on commit b5c9de1

@ggrossetie
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is working great, you just need to create a new tag 👍

Please sign in to comment.