Sha256: 98342416e07a37b132027ac23ea6db2a2b6d80fcc19f67d0c8262bd34ad9bc5c

Contents?: true

Size: 693 Bytes

Versions: 48

Compression:

Stored size: 693 Bytes

Contents

namespace :db do

  namespace :cms do

    desc "Checks if the infopark CMS object classes are valid ruby class names"
    task :check_obj_classes => :environment do
      all_obj_classes = Obj.select("distinct(obj_class)").collect(&:obj_class)
      invalid_names = all_obj_classes.reject { |obj_class|
        begin
          obj_class.constantize
        rescue NameError => e
          e.message !~ /not a valid constant name/
        end
      }
      if invalid_names.empty?
        puts "\nAll object class names are valid Ruby class names."
      else
        puts "\nThe following object class names are invalid Ruby class names:"
        y invalid_names
      end
    end

  end

end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
infopark_rails_connector-6.9.4 lib/tasks/check.rake
infopark_rails_connector-6.9.3.1.36404185 lib/tasks/check.rake
infopark_rails_connector-6.9.2.1.125136549 lib/tasks/check.rake
infopark_rails_connector-6.9.1.3.22208381 lib/tasks/check.rake
infopark_rails_connector-6.9.0.3.197272233 lib/tasks/check.rake
infopark_rails_connector-6.8.3.174.51542603 lib/tasks/check.rake
infopark_rails_connector-6.8.3.115.227021242 lib/tasks/check.rake
infopark_rails_connector-6.8.3.73.75172665 lib/tasks/check.rake
infopark_rails_connector-6.8.3.2.153416031 lib/tasks/check.rake
infopark_rails_connector-6.8.3.67.110847540 lib/tasks/check.rake
infopark_rails_connector-6.8.3.1.23895778 lib/tasks/check.rake
infopark_rails_connector-6.8.2.36.82613853 lib/tasks/check.rake
infopark_rails_connector-6.8.2.7.128454143 lib/tasks/check.rake
infopark_rails_connector-6.8.1.26.236500544 lib/tasks/check.rake
infopark_rails_connector-6.8.1 lib/tasks/check.rake
infopark_rails_connector-6.8.0.539.93842523 lib/tasks/check.rake
infopark_rails_connector-6.8.0.529.114081979 lib/tasks/check.rake
infopark_rails_connector-6.8.0.518.30999728 lib/tasks/check.rake
infopark_rails_connector-6.8.0.515.34928522 lib/tasks/check.rake
infopark_rails_connector-6.8.0.498.46559598 lib/tasks/check.rake