From 971bcd6236b158e9d3c01ca3bce56c7747d12e4d Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Tue, 2 Oct 2012 16:15:21 -0500 Subject: [PATCH] Separate railtie file --- lib/emoji.rb | 8 -------- lib/emoji/railtie.rb | 10 ++++++++++ 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 lib/emoji/railtie.rb diff --git a/lib/emoji.rb b/lib/emoji.rb index 2d3c0b7..7f0ace1 100644 --- a/lib/emoji.rb +++ b/lib/emoji.rb @@ -12,12 +12,4 @@ module Emoji def self.names @names ||= Dir["#{PATH}/../images/*.png"].sort.map { |fn| File.basename(fn, '.png') } end - - if defined? Rails::Engine - class Engine < Rails::Engine - rake_tasks do - load "tasks/emoji.rake" - end - end - end end diff --git a/lib/emoji/railtie.rb b/lib/emoji/railtie.rb new file mode 100644 index 0000000..188a8e5 --- /dev/null +++ b/lib/emoji/railtie.rb @@ -0,0 +1,10 @@ +require 'emoji' +require 'rails' + +module Emoji + class Engine < Rails::Engine + rake_tasks do + load "tasks/emoji.rake" + end + end +end