0.0
No commit activity in last 3 years
No release in over 3 years
Generate a rails scaffold based on a .CSV, .dat or .txt file.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
>= 0
~> 10.0
>= 0
 Project Readme

Scaffolding

Generate a rails scaffold from a CSV, Dat or Txt file and imports the data into your rails application.

Installation

Add this line to your application's Gemfile:

gem 'scaffolding'

And then execute:

$ bundle

Or install it yourself as:

$ gem install scaffolding

Usage

$ rails g scaffolding [source] [name]

You can pass either a path/to/the/file or a URL as the [source].

If a [name] is not passed, the scaffold will be named from the source:

$ rails g scaffolding path/to/file.csv

Will generate a scaffold named file

$ rails g scaffolding path/to/file.csv purchase_orders

Will generate a scaffold named purchase_orders

Multiple

To generate multiple scaffolds at the same time setup a scaffolding folder

$ rake scaffolding:folder

then add files to the 'tmp/scaffolding' directory and process them all with:

$ rails g scaffolding

The scaffold's will be named the same as there respective files names.

Options

(You will be asked these at the terminal if not specified)

Automatically determine the data types of each column:

--auto

Migrate the database after the scaffold has been generated:

--migrate

Import the data from the data source into the development database:

--import

Example:

$ rails g scaffolding --auto --migrate --import

If you want to do a large number of files at once and only do specific tasks:

$ rails g scaffolding --auto --no-migrate --no-import  

You can leave this running and it will generate scaffolds, but skip migration and importing data.

Import file uploads

To import data from a file uploaded through the web browser:

$ rake scaffolding:controller

$ rails s

Then go to http://localhost:3000/scaffolding

And upload the file you wish to import.

Hot Tips:

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Jordan-deJong/scaffolding. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.