Skip to content

Commit

Permalink
Removed Rails3 deprication warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
bansalakhil committed Mar 29, 2010
1 parent 17972b0 commit 9daf2fd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tasks/tiny_mce.rake → lib/tasks/tiny_mce.rake
@@ -1,6 +1,6 @@
namespace :tiny_mce do

desc 'Install (or updated if they alread exist) the TinyMCE sources'
desc 'Install or update the TinyMCE sources'
task :install => :environment do
TinyMCE.install_or_update_tinymce
end
Expand Down
4 changes: 2 additions & 2 deletions lib/tiny_mce.rb
Expand Up @@ -9,7 +9,7 @@ module TinyMCE
def self.install_or_update_tinymce
require 'fileutils'
orig = File.join(File.dirname(__FILE__), 'tiny_mce', 'assets', 'tiny_mce')
dest = File.join(RAILS_ROOT, 'public', 'javascripts', 'tiny_mce')
dest = File.join(Rails.root, 'public', 'javascripts', 'tiny_mce')
tiny_mce_js = File.join(dest, 'tiny_mce.js')

unless File.exists?(tiny_mce_js) && FileUtils.identical?(File.join(orig, 'tiny_mce.js'), tiny_mce_js)
Expand Down Expand Up @@ -46,7 +46,7 @@ def self.install_or_update_tinymce
end
end

tiny_mce_yaml_filepath = File.join(RAILS_ROOT, 'config', 'tiny_mce.yml')
tiny_mce_yaml_filepath = File.join(Rails.root, 'config', 'tiny_mce.yml')
unless File.exists?(tiny_mce_yaml_filepath)
File.open(tiny_mce_yaml_filepath, 'w') do |f|
f.puts '# Here you can specify default options for TinyMCE across all controllers'
Expand Down
2 changes: 1 addition & 1 deletion lib/tiny_mce/configuration.rb
Expand Up @@ -18,7 +18,7 @@ def self.default_options
# might be valid. Catch all cases and make sure we always return a Hash
def self.config_file_options
@@config_file_options ||= begin
tiny_mce_yaml_filepath = File.join(RAILS_ROOT, 'config', 'tiny_mce.yml')
tiny_mce_yaml_filepath = File.join(Rails.root, 'config', 'tiny_mce.yml')
(YAML::load(IO.read(tiny_mce_yaml_filepath)) rescue nil) || Hash.new
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/tiny_mce/helpers.rb
Expand Up @@ -35,7 +35,7 @@ def tiny_mce_init_if_needed(options = {}, raw_options = nil)

# Form a JS include tag for the TinyMCE JS src for inclusion in the <head>
def include_tiny_mce_js
javascript_include_tag (RAILS_ENV == 'development' ? "tiny_mce/tiny_mce_src" : "tiny_mce/tiny_mce")
javascript_include_tag (Rails.env == 'development' ? "tiny_mce/tiny_mce_src" : "tiny_mce/tiny_mce")
end
# Form a JS include tag for the TinyMCE JS src for inclusion in the <head>
# (only if tiny mce is actually being used)
Expand Down

0 comments on commit 9daf2fd

Please sign in to comment.