Sha256: 2a904dd664f9e795974edc6e89f822a7ebdcb55346a3c5d74c534897ee7a79d8

Contents?: true

Size: 699 Bytes

Versions: 6

Compression:

Stored size: 699 Bytes

Contents

# Add the necessary route to routes.rb

puts "Adding taskr4rails route to your routes.rb file..."

routes_file = File.expand_path("#{RAILS_ROOT}/config/routes.rb")

routes = IO.read(routes_file)
find = "ActionController::Routing::Routes.draw do |map|"
idx = routes.index(find)

unless idx
  $stderr.puts "Couldn't add taskr4rails route. You will have to do this manually."
  exit
end

File.open(routes_file, "w") do |io|
  loc = idx + find.length
  
  ins = %{  }+$/+$/+
        %{  # route automatically added by taskr4rails plugin}+$/+
        %{  map.taskr4rails "taskr4rails", :controller => 'taskr4rails', :action => 'execute'}+$/+$/
        
  routes.insert(loc, ins)
  
  io.write(routes)
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
dvdplm-taskr-0.3.1 taskr4rails/install.rb
dvdplm-taskr-0.3.2 taskr4rails/install.rb
taskr-0.2.0 taskr4rails/install.rb
taskr-0.2.1 taskr4rails/install.rb
taskr-0.3.0 taskr4rails/install.rb
taskr-0.4.0 taskr4rails/install.rb