Sha256: 4aa051b82ffedac719f9808b456d3636686774fcb895a3224867664582714536

Contents?: true

Size: 1.24 KB

Versions: 48

Compression:

Stored size: 1.24 KB

Contents

module OldSql
  class CopyAssetsGenerator < Rails::Generators::Base
    source_root File.expand_path('../templates', __FILE__)
    
    desc "Old SQL Copy Assets"
    
    def copy_assets
      
    end
    
    def create_old_sql_dirs
      empty_directory "#{app_path}/public/stylesheets/old_sql"
      empty_directory "#{app_path}/app/views/layouts/old_sql"
    end
    
    def copy_old_sql_files
      copy_file "#{gem_path}/public/stylesheets/old_sql/old_sql.css", "#{app_path}/public/stylesheets/old_sql/old_sql.css"
      copy_file "#{gem_path}/public/stylesheets/old_sql/old_sql.css", "#{app_path}/public/stylesheets/old_sql/table.css"
      copy_file "#{gem_path}/app/views/layouts/old_sql/report.html.erb", "#{app_path}/app/views/layouts/old_sql/report.html.erb"
      copy_file "#{gem_path}/app/views/layouts/old_sql/report.html.erb", "#{app_path}/app/views/layouts/old_sql/chart.html.erb"
    end
    
    private
    
    def app_path
      app_path = Rails.public_path.split("/")
      app_path.delete_at(-1)
      app_path = app_path.join("/")
      app_path
    end
    
    def gem_path
      gem_path = __FILE__
      gem_path = gem_path.split("/")
      gem_path = gem_path[0..-5]
      gem_path = gem_path.join("/")
      gem_path
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
old_sql-1.65.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.64.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.63.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.62.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.61.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.60.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.59.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.58.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.57.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.56.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.55.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.54.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.53.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.52.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.51.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.50.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.49.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.48.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.47.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.46.0 lib/generators/old_sql/copy_assets_generator.rb