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.45.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.44.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.43.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.42.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.41.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.40.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.39.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.38.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.37.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.36.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.35.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.34.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.33.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.32.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.31.1 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.30.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.29.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.28.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.27.0 lib/generators/old_sql/copy_assets_generator.rb
old_sql-1.26.0 lib/generators/old_sql/copy_assets_generator.rb