Skip to content

Commit

Permalink
Merge pull request #1 from mohits/mohits-patch-1
Browse files Browse the repository at this point in the history
Fix loading problems when Gem is built on Windows
  • Loading branch information
mohits authored Mar 2, 2020
2 parents dd7ee6c + 34b3de2 commit 941914f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/redcloth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
conf = Object.const_get(defined?(RbConfig) ? :RbConfig : :Config)::CONFIG
prefix = conf['arch'] =~ /mswin|mingw/ ? "#{conf['MAJOR']}.#{conf['MINOR']}/" : ''
lib = "#{prefix}redcloth_scan"
begin
require lib
rescue LoadError => e
lib = "redcloth_scan"
end
require lib
rescue LoadError => e
e.message << %{\nCouldn't load #{lib}\nThe $LOAD_PATH was:\n#{$LOAD_PATH.join("\n")}}
Expand Down

0 comments on commit 941914f

Please sign in to comment.