Sha256: 2ed3afff68c5ec8807cbe93155ee263d3e6e5deac76e5e4ecce69fb191072769

Contents?: true

Size: 611 Bytes

Versions: 18

Compression:

Stored size: 611 Bytes

Contents

require 'plezi/builders/builder'

module Plezi

	module FormBuilder

		FORM_BUILDERS = %w{ Slim ERB }
		MODEL_BUILDERS = %w{ Squel }

		DB_TYPES = %w{primary_key string text integer float decimal datetime time date binary boolean}

		@gem_root = ::Plezi::Builder::GEM_ROOT
		def self.parse_args
			return unless ARGS[0][0] == 'g'
			struct = {}
			ARGS[1..-1].each do |s|
				s = s.split /[\:\.]/
				raise "Cannot parse parameters - need to be defined as name.type or name:type." if s.count !=2
				struct[s[0]] = DB_TYPES[s[1].downcase] || (raise "Unrecognized type #{s[1]}.")
			end
			struct
		end
	end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
plezi-0.12.13 lib/plezi/builders/form_builder.rb
plezi-0.12.11 lib/plezi/builders/form_builder.rb
plezi-0.12.10 lib/plezi/builders/form_builder.rb
plezi-0.12.9 lib/plezi/builders/form_builder.rb
plezi-0.12.8 lib/plezi/builders/form_builder.rb
plezi-0.12.7 lib/plezi/builders/form_builder.rb
plezi-0.12.6 lib/plezi/builders/form_builder.rb
plezi-0.12.5 lib/plezi/builders/form_builder.rb
plezi-0.12.4 lib/plezi/builders/form_builder.rb
plezi-0.12.3 lib/plezi/builders/form_builder.rb
plezi-0.12.2 lib/plezi/builders/form_builder.rb
plezi-0.12.1 lib/plezi/builders/form_builder.rb
plezi-0.12.0 lib/plezi/builders/form_builder.rb
plezi-0.11.2 lib/plezi/builders/form_builder.rb
plezi-0.11.1 lib/plezi/builders/form_builder.rb
plezi-0.11.0 lib/plezi/builders/form_builder.rb
plezi-0.10.17 lib/plezi/builders/form_builder.rb
plezi-0.10.16 lib/plezi/builders/form_builder.rb