Documentation ¶
Index ¶
- Variables
- func NewBootstrapGenerator() *gentronics.Generator
- func NewBootswatchGenerator(theme string) (*gentronics.Generator, error)
- func NewJQueryGenerator() *gentronics.Generator
- func NewRailsJSGenerator() *gentronics.Generator
- func NewResourceGenerator(data gentronics.Data) *gentronics.Generator
Constants ¶
This section is empty.
Variables ¶
var BootstrapCmd = &cobra.Command{ Use: "bootstrap", Short: "Generates Bootstrap 3 files", RunE: func(cmd *cobra.Command, args []string) error { return NewBootstrapGenerator().Run(".", gentronics.Data{ "withBootstrap": true, }) }, }
BootstrapCmd will generate new Bootstrap files. Regardless of whatever other settings you might, this will generate jQuery files as that is a pre-requisite of Bootstrap.
var BootswatchCmd = &cobra.Command{ Use: "bootswatch [theme]", Short: "Generates Bootswatch 3 files", RunE: func(cmd *cobra.Command, args []string) error { if len(args) == 0 { return fmt.Errorf("You must choose a theme! [%s]", strings.Join(bootswatchThemes, ", ")) } g, err := NewBootswatchGenerator(args[0]) if err != nil { return err } return g.Run(".", gentronics.Data{ "withBootswatch": true, }) }, }
BootswatchCmd will generate new Bootswatch themes. Regardless of whatever other settings you have, this will generate jQuery and Bootstrap files as they are pre-requisites for Bootswatch
var Fmt *gentronics.Command
Fmt is command that will use `goimports` if available, or fail back to `gofmt` otherwise.
var JQueryCmd = &cobra.Command{ Use: "jquery", Short: "Generates an assets/jquery.js file", RunE: func(cmd *cobra.Command, args []string) error { data := gentronics.Data{ "withJQuery": true, } return NewJQueryGenerator().Run(".", data) }, }
JQueryCmd will generate jQuery files.
var RailsJSCmd = &cobra.Command{ Use: "railsjs", Short: "Generates an assets/rails.js file", Long: `Generates the jQuery UJS file from the Rails project. More information can be found at: https://github.com/rails/jquery-ujs`, RunE: func(cmd *cobra.Command, args []string) error { return NewRailsJSGenerator().Run(".", gentronics.Data{}) }, }
RailsJSCmd generates the jQuery UJS file from the Rails project.
var ResourceCmd = &cobra.Command{ Use: "resource [name]", Aliases: []string{"r"}, Short: "Generates a new actions/resource file", RunE: func(cmd *cobra.Command, args []string) error { if len(args) == 0 { return errors.New("You must specifiy a resource name!") } name := args[0] data := gentronics.Data{ "name": name, "singular": inflect.Singularize(name), "plural": inflect.Pluralize(name), "camel": inflect.Camelize(name), "underscore": inflect.Underscore(name), } return NewResourceGenerator(data).Run(".", data) }, }
ResourceCmd generates a new actions/resource file and a stub test.
Functions ¶
func NewBootstrapGenerator ¶
func NewBootstrapGenerator() *gentronics.Generator
NewBootstrapGenerator will generate new Bootstrap files. Regardless of whatever other settings you might, this will generate jQuery files as that is a pre-requisite of Bootstrap.
func NewBootswatchGenerator ¶
func NewBootswatchGenerator(theme string) (*gentronics.Generator, error)
NewBootswatchGenerator will generate new Bootswatch themes. Regardless of whatever other settings you have, this will generate jQuery and Bootstrap files as they are pre-requisites for Bootswatch
func NewJQueryGenerator ¶
func NewJQueryGenerator() *gentronics.Generator
NewJQueryGenerator will generate jQuery files.
func NewRailsJSGenerator ¶
func NewRailsJSGenerator() *gentronics.Generator
NewRailsJSGenerator generates the jQuery UJS file from the Rails project.
func NewResourceGenerator ¶
func NewResourceGenerator(data gentronics.Data) *gentronics.Generator
NewResourceGenerator generates a new actions/resource file and a stub test.
Types ¶
This section is empty.