| Remove rails 2.x generators - reportable - Fork of reportable required by WarVo… | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| commit 96f40a0780ef3c4bd3dcf862da9c9c83e0d632b9 | |
| parent 42019b02a0cf723dd20b78850cc68a7be2730fe1 | |
| Author: Martin Kavalar <[email protected]> | |
| Date: Tue, 14 Feb 2012 10:45:01 +0100 | |
| Remove rails 2.x generators | |
| Diffstat: | |
| M generators/reportable_jquery_flot_… | 49 ++++++++++-----------------… | |
| M generators/reportable_migration/re… | 44 +++++++++------------------… | |
| M generators/reportable_raphael_asse… | 58 ++++++++++-----------------… | |
| 3 files changed, 46 insertions(+), 105 deletions(-) | |
| --- | |
| diff --git a/generators/reportable_jquery_flot_assets/reportable_jquery_flot_as… | |
| @@ -1,37 +1,18 @@ | |
| -if Saulabs::Reportable::RailsAdapter::IS_RAILS3 | |
| - | |
| - class ReportableJqueryFlotAssetsGenerator < Rails::Generators::Base | |
| - | |
| - include Rails::Generators::Actions | |
| - | |
| - def create_jquery_flot_file | |
| - empty_directory('public/javascripts') | |
| - copy_file( | |
| - File.join(File.dirname(__FILE__), 'templates', 'jquery.flot.min.js'), | |
| - 'public/javascripts/jquery.flot.min.js' | |
| - ) | |
| - copy_file( | |
| - File.join(File.dirname(__FILE__), 'templates', 'excanvas.min.js'), | |
| - 'public/javascripts/excanvas.min.js' | |
| - ) | |
| - readme(File.join(File.dirname(__FILE__), 'templates', 'NOTES')) | |
| - end | |
| - | |
| - end | |
| - | |
| -else | |
| - | |
| - class ReportableJqueryFlotAssetsGenerator < Rails::Generator::Base | |
| - | |
| - def manifest | |
| - record do |m| | |
| - m.directory('public/javascripts') | |
| - m.file('jquery.flot.min.js', 'public/javascripts/jquery.flot.min.js') | |
| - m.file('excanvas.min.js', 'public/javascripts/excanvas.min.js') | |
| - m.readme('NOTES') | |
| - end | |
| - end | |
| - | |
| +class ReportableJqueryFlotAssetsGenerator < Rails::Generators::Base | |
| + | |
| + include Rails::Generators::Actions | |
| + | |
| + def create_jquery_flot_file | |
| + empty_directory('public/javascripts') | |
| + copy_file( | |
| + File.join(File.dirname(__FILE__), 'templates', 'jquery.flot.min.js'), | |
| + 'public/javascripts/jquery.flot.min.js' | |
| + ) | |
| + copy_file( | |
| + File.join(File.dirname(__FILE__), 'templates', 'excanvas.min.js'), | |
| + 'public/javascripts/excanvas.min.js' | |
| + ) | |
| + readme(File.join(File.dirname(__FILE__), 'templates', 'NOTES')) | |
| end | |
| end | |
| diff --git a/generators/reportable_migration/reportable_migration_generator.rb … | |
| @@ -1,40 +1,20 @@ | |
| -if Saulabs::Reportable::RailsAdapter::IS_RAILS3 | |
| +class ReportableMigrationGenerator < Rails::Generators::Base | |
| - class ReportableMigrationGenerator < Rails::Generators::Base | |
| - | |
| - include Rails::Generators::Migration | |
| - | |
| - def create_migration | |
| - migration_template( | |
| - File.join(File.dirname(__FILE__), 'templates', 'migration.rb'), | |
| - 'db/migrate/create_reportable_cache.rb' | |
| - ) | |
| - end | |
| - | |
| - def self.next_migration_number(dirname) | |
| - if ActiveRecord::Base.timestamped_migrations | |
| - Time.now.utc.strftime("%Y%m%d%H%M%S") | |
| - else | |
| - "%.3d" % (current_migration_number(dirname) + 1) | |
| - end | |
| - end | |
| + include Rails::Generators::Migration | |
| + def create_migration | |
| + migration_template( | |
| + File.join(File.dirname(__FILE__), 'templates', 'migration.rb'), | |
| + 'db/migrate/create_reportable_cache.rb' | |
| + ) | |
| end | |
| -else | |
| - | |
| - class ReportableMigrationGenerator < Rails::Generator::Base | |
| - | |
| - def manifest | |
| - record do |m| | |
| - m.migration_template('migration.rb', 'db/migrate') | |
| - end | |
| + def self.next_migration_number(dirname) | |
| + if ActiveRecord::Base.timestamped_migrations | |
| + Time.now.utc.strftime("%Y%m%d%H%M%S") | |
| + else | |
| + "%.3d" % (current_migration_number(dirname) + 1) | |
| end | |
| - | |
| - def file_name | |
| - 'create_reportable_cache' | |
| - end | |
| - | |
| end | |
| end | |
| diff --git a/generators/reportable_raphael_assets/reportable_raphael_assets_gen… | |
| @@ -1,42 +1,22 @@ | |
| -if Saulabs::Reportable::RailsAdapter::IS_RAILS3 | |
| - | |
| - class ReportableRaphaelAssetsGenerator < Rails::Generators::Base | |
| - | |
| - include Rails::Generators::Actions | |
| - | |
| - def create_raphael_file | |
| - empty_directory('public/javascripts') | |
| - copy_file( | |
| - File.join(File.dirname(__FILE__), 'templates', 'raphael.min.js'), | |
| - 'public/javascripts/raphael.min.js' | |
| - ) | |
| - copy_file( | |
| - File.join(File.dirname(__FILE__), 'templates', 'g.raphael.min.js'), | |
| - 'public/javascripts/g.raphael.min.js' | |
| - ) | |
| - copy_file( | |
| - File.join(File.dirname(__FILE__), 'templates', 'g.line.min.js'), | |
| - 'public/javascripts/g.line.min.js' | |
| - ) | |
| - readme(File.join(File.dirname(__FILE__), 'templates', 'NOTES')) | |
| - end | |
| - | |
| - end | |
| - | |
| -else | |
| - | |
| - class ReportableRaphaelAssetsGenerator < Rails::Generator::Base | |
| - | |
| - def manifest | |
| - record do |m| | |
| - m.directory('public/javascripts') | |
| - m.file('raphael.min.js', 'public/javascripts/raphael.min.js') | |
| - m.file('g.raphael.min.js', 'public/javascripts/g.raphael.min.js') | |
| - m.file('g.line.min.js', 'public/javascripts/g.line.min.js') | |
| - m.readme('NOTES') | |
| - end | |
| - end | |
| - | |
| +class ReportableRaphaelAssetsGenerator < Rails::Generators::Base | |
| + | |
| + include Rails::Generators::Actions | |
| + | |
| + def create_raphael_file | |
| + empty_directory('public/javascripts') | |
| + copy_file( | |
| + File.join(File.dirname(__FILE__), 'templates', 'raphael.min.js'), | |
| + 'public/javascripts/raphael.min.js' | |
| + ) | |
| + copy_file( | |
| + File.join(File.dirname(__FILE__), 'templates', 'g.raphael.min.js'), | |
| + 'public/javascripts/g.raphael.min.js' | |
| + ) | |
| + copy_file( | |
| + File.join(File.dirname(__FILE__), 'templates', 'g.line.min.js'), | |
| + 'public/javascripts/g.line.min.js' | |
| + ) | |
| + readme(File.join(File.dirname(__FILE__), 'templates', 'NOTES')) | |
| end | |
| end |