Permalink
Browse files

add rake tasks to rails 3 project

  • Loading branch information...
1 parent dc5f535 commit eb9adc3e9307effd75833d26467d757d1840cdf1 David Goudreau & Kurtis Seebaldt committed Mar 24, 2011
Showing with 22 additions and 1 deletion.
  1. +2 −1 .gitignore
  2. +3 −0 lib/license_finder.rb
  3. +11 −0 lib/license_finder/railtie.rb
  4. +6 −0 lib/tasks/license_finder.rake
View
@@ -2,4 +2,5 @@ pkg/*
*.gem
.bundle
Gemfile.lock
-
+.rvmrc
+.idea/*
@@ -1,13 +1,16 @@
require 'pathname'
module LicenseFinder
+
+
ROOT_PATH = Pathname.new(__FILE__).dirname
def self.from_bundler
require 'bundler'
Bundler.load.specs.map { |spec| Finder.new(spec) }.sort_by &:sort_order
end
end
+require 'license_finder/railtie' if defined?(Rails)
require 'license_finder/finder'
require 'license_finder/file_parser'
require 'license_finder/license_file'
@@ -0,0 +1,11 @@
+require 'license_finder'
+require 'rails'
+module LicenseFinder
+ class Railtie < Rails::Railtie
+ railtie_name :license_finder
+
+ rake_tasks do
+ load "tasks/license_finder.rake"
+ end
+ end
+end
@@ -0,0 +1,6 @@
+namespace :license do
+ desc 'generate a list of dependecy licenses'
+ task :check_dependencies do
+ LicenseFinder.from_bundler.each { |lf| puts lf.to_s(ARGV.first == "--with-licenses") }
+ end
+end

0 comments on commit eb9adc3

Please sign in to comment.