Class: Validator
- Inherits:
-
Object
- Object
- Validator
- Defined in:
- lib/railsbricks/validator.rb
Instance Attribute Summary collapse
-
#log ⇒ Object
Returns the value of attribute log.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Validator
constructor
A new instance of Validator.
- #validate(validate = :script, abort_on_error = true) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Validator
Returns a new instance of Validator.
11 12 13 14 |
# File 'lib/railsbricks/validator.rb', line 11 def initialize( = {}) @log = [] @options = end |
Instance Attribute Details
#log ⇒ Object
Returns the value of attribute log.
9 10 11 |
# File 'lib/railsbricks/validator.rb', line 9 def log @log end |
Instance Method Details
#validate(validate = :script, abort_on_error = true) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/railsbricks/validator.rb', line 16 def validate(validate = :script, abort_on_error = true) add_error("RailsBricks version not set") if @options[:railsbricks_version].to_s == '' add_error("Rails version not set") if @options[:rails_version].to_s == '' add_error("App name not set") if @options[:app_name].to_s == '' add_error("Rails app name not set") if @options[:rails_app_name].to_s == '' add_error("Ruby version not set") if @options[:ruby_version].to_s == '' add_error("Gem command not set") if @options[:gem_command].to_s == '' add_error("Rake command not set") if @options[:rake_command].to_s == '' add_error("Database engine not set") if @options[:development_db].to_s == '' if @options[:development_db].to_s == "postgresql" add_error("PostgreSQL server not set") if @options[:db_config][:server].to_s == '' add_error("PostgreSQL port not set") if @options[:db_config][:port].to_s == '' add_error("PostgreSQL database name not set") if @options[:db_config][:name].to_s == '' add_error("PostgreSQL username not set") if @options[:db_config][:username].to_s == '' end add_error("Local Git option not set") if @options[:local_git].nil? add_error("Remote Git option not set") if @options[:remote_git].nil? if @options[:remote_git] add_error("Remote Git URL not set") if @options[:git_url].to_s == '' end add_error("Devise option not set") if @options[:devise].nil? if @options[:devise] end end |