Merge pull request #3125 from gschlager/bugfix_01

FIX: Loading of Emoji files depended on working directory
This commit is contained in:
Régis Hanol 2015-01-25 17:42:16 +01:00
commit 78a7fb4b07
2 changed files with 3 additions and 3 deletions

View File

@ -65,7 +65,7 @@ class Emoji
end
def self.db_file
"lib/emoji/db.json"
"#{Rails.root}/lib/emoji/db.json"
end
def self.load_standard

View File

@ -75,14 +75,14 @@ module PrettyText
"app/assets/javascripts/discourse/lib/markdown.js"
)
Dir["#{Rails.root}/app/assets/javascripts/discourse/dialects/**.js"].sort.each do |dialect|
Dir["#{app_root}/app/assets/javascripts/discourse/dialects/**.js"].sort.each do |dialect|
unless dialect =~ /\/dialect\.js$/
ctx.load(dialect)
end
end
# custom emojis
emoji = ERB.new(File.read("app/assets/javascripts/discourse/lib/emoji/emoji.js.erb"))
emoji = ERB.new(File.read("#{app_root}/app/assets/javascripts/discourse/lib/emoji/emoji.js.erb"))
ctx.eval(emoji.result)
Emoji.custom.each do |emoji|