No commit activity in last 3 years
No release in over 3 years
FactoryGirl build syntax generator
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.7
~> 10.0
>= 0

Runtime

>= 0
 Project Readme

FactoryGirlBsGen Gem Version Code Climate wercker status

Overview

FactoryGirlBsGen = factory_girl build syntax generater

The build syntax of factory_girl from a file is CLI tool to generate. Currently I only supports CSV.

Installation

Add this line to your application's Gemfile:

gem 'factory_girl_bs_gen'

And then execute:

$ bundle

Or install it yourself as:

$ gem install factory_girl_bs_gen

Usage

$ factory_girl_bs_gen exec -t hoge -f data.csv -o factory_girl_bs_gen.out --format=build --omit_syntax=false

Input(CSV file):

hoge,foo,bar
1,2,3
4,5,6
7,8,9

Output:

FactoryGirl.build(:hoge, hoge:1, foo:2, bar:3)
FactoryGirl.build(:hoge, hoge:4, foo:5, bar:6)
FactoryGirl.build(:hoge, hoge:7, foo:8, bar:9)

CommandLine Option

Name Alias Type Required Setting Remarks
--table -t string true table name -
--file -f string true input csv file -
--format none string true create | build specifies the format of the output after
--output -o string false output file name specify if you want to output the output results to a file. If not specified, the stdout.
--omit_syntax none boolean false true | false enable an abbreviated notation. Ex: FactoryGirl.build -> build

Contributing

  1. Fork it ( https://github.com/fukuiretu/factory_girl_bs_gen/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request