Sha256: 3dd44baf0e9c33c99773867dca173a0c09bcefcf284f3d46bf21442271702968

Contents?: true

Size: 494 Bytes

Versions: 26

Compression:

Stored size: 494 Bytes

Contents

# coding: UTF-8

require 'rake'
require 'erb'

namespace :dad do
  namespace :generate do

    task :routes do
      ARGV[1..-1].each do |arg|
        unless arg.index('=')
          task arg.to_sym do ; end
          
          @app_name ||= arg
        end
      end

      template = File.join(File.dirname(__FILE__), 'templates', 'routes.rb.erb')
      routes_file = "#{Rails.root}/config/routes.rb"
      File.write(routes_file, ERB.new(File.read(template)).result)
    end
    
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
daddy-0.2.23 lib/tasks/generate/routes.rake
daddy-0.2.22 lib/tasks/generate/routes.rake
daddy-0.2.21 lib/tasks/generate/routes.rake
daddy-0.2.20 lib/tasks/generate/routes.rake
daddy-0.2.19 lib/tasks/generate/routes.rake
daddy-0.2.18 lib/tasks/generate/routes.rake
daddy-0.2.17 lib/tasks/generate/routes.rake
daddy-0.2.16 lib/tasks/generate/routes.rake
daddy-0.2.15 lib/tasks/generate/routes.rake
daddy-0.2.14 lib/tasks/generate/routes.rake
daddy-0.2.13 lib/tasks/generate/routes.rake
daddy-0.2.12 lib/tasks/generate/routes.rake
daddy-0.2.11 lib/tasks/generate/routes.rake
daddy-0.2.10 lib/tasks/generate/routes.rake
daddy-0.2.9 lib/tasks/generate/routes.rake
daddy-0.2.8 lib/tasks/generate/routes.rake
daddy-0.2.7 lib/tasks/generate/routes.rake
daddy-0.2.6 lib/tasks/generate/routes.rake
daddy-0.2.5 lib/tasks/generate/routes.rake
daddy-0.2.4 lib/tasks/generate/routes.rake