public
Description: A Ruby on Rails plugin that adds the 'comic_curse' method to any String object which replaces curse words with %$#@! or whatever is defined
Homepage: http://www.erbmicha.com/comic-curse
Clone URL: git://github.com/erbmicha/comic-curse.git
comic-curse / install.rb
100644 19 lines (15 sloc) 0.826 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'fileutils'
 
def install(file)
  puts "Installing: #{file}"
  target = File.join(File.dirname(__FILE__), '..', '..', '..', file)
  FileUtils.cp File.join(File.dirname(__FILE__), file), target
  dir_to_rename = File.dirname(__FILE__) + '/../trunk'
  FileUtils.mv(dir_to_rename, File.dirname(__FILE__) + '/../comic_curse') if File.exists? dir_to_rename
end
 
install File.join( 'config', 'curse_words.yml' )
 
# Display to the console the contents of the README file.
puts IO.read(File.join(File.dirname(__FILE__), 'README'))
 
# Append the language settings to the application's environment.rb file
environment_rb = File.open(File.expand_path(File.join(File.dirname(__FILE__), '../../../config/environment.rb')), "a")
environment_rb.puts IO.read(File.join(File.dirname(__FILE__), '/assets/languages'))
environment_rb.close