Sha256: fc28834cefee2b169fdc58c12ec39a485aeb95d8f8f0413a130c77769c706421

Contents?: true

Size: 793 Bytes

Versions: 20

Compression:

Stored size: 793 Bytes

Contents

namespace :rename do

  desc 'Rename Rails App'
  task :app, [:new_name] do |t, args|
    filenames = [
      'Rakefile',
      'app/views/layouts/admin.html.erb',
      'app/views/layouts/application.html.erb',
      'app/views/layouts/devise.html.erb',
      'config/application.rb',
      'config/environment.rb',
      'config/routes.rb',
      'config/environments/development.rb',
      'config/environments/test.rb',
      'config/environments/production.rb',
      'config/initializers/secret_token.rb',
      'config/initializers/session_store.rb',
    ]
    filenames.each do |filename|
      text = File.read(filename)
      File.open(filename, "w") do |file|
        file << text.gsub(/Roots/, args[:new_name])
      end
      puts "CHECKED FILE >> #{filename}"
    end
  end

end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
heartwood-0.0.1 lib/tasks/rename.rake
cambium-1.3.2 lib/tasks/rename.rake
cambium-1.3.1 lib/tasks/rename.rake
cambium-1.3.0 lib/tasks/rename.rake
cambium-1.2.3 lib/tasks/rename.rake
cambium-1.2.2 lib/tasks/rename.rake
cambium-1.2.1 lib/tasks/rename.rake
cambium-1.2.0 lib/tasks/rename.rake
cambium-1.1.6 lib/tasks/rename.rake
cambium-1.1.5 lib/tasks/rename.rake
cambium-1.1.4 lib/tasks/rename.rake
cambium-1.1.3 lib/tasks/rename.rake
cambium-1.1.2 lib/tasks/rename.rake
cambium-1.1.1 lib/tasks/rename.rake
cambium-1.1.0 lib/tasks/rename.rake
cambium-1.0.4 lib/tasks/rename.rake
cambium-1.0.3 lib/tasks/rename.rake
cambium-1.0.2 lib/tasks/rename.rake
cambium-1.0.1 lib/tasks/rename.rake
cambium-1.0.0 lib/tasks/rename.rake