class BackboneGenerator::CLI
Abstract base class for CLI
utilities
@author Tawheed Abdul-Raheem @abstract @since 0.0.3
Public Instance Methods
collection(collection_name)
click to toggle source
# File lib/backbone_generator/cli.rb, line 50 def collection collection_name BackboneGenerator::CollectionGenerator.create_collection(collection_name) unless !isvalid? end
library(library_name)
click to toggle source
# File lib/backbone_generator/cli.rb, line 65 def library library_name BackboneGenerator::LibraryGenerator.fetch_library(library_name) unless !isvalid? end
model(model_name)
click to toggle source
# File lib/backbone_generator/cli.rb, line 35 def model model_name BackboneGenerator::ModelGenerator.create_model(model_name) unless !isvalid? end
new(app_name)
click to toggle source
# File lib/backbone_generator/cli.rb, line 25 def new app_name if File.exists? app_name print "error ".red puts "A folder with the name " + app_name + " already exists" else BackboneGenerator::NewGenerator.new app_name end end
route(route_name)
click to toggle source
# File lib/backbone_generator/cli.rb, line 45 def route route_name BackboneGenerator::RouteGenerator.create_route(route_name) unless !isvalid? end
server(port=5000)
click to toggle source
# File lib/backbone_generator/cli.rb, line 75 def server(port=5000) BackboneGenerator.start_server(port) unless !isvalid? end
template(template_name)
click to toggle source
# File lib/backbone_generator/cli.rb, line 60 def template template_name BackboneGenerator::TemplateGenerator.create_template(template_name) unless !isvalid? end
test(test_name)
click to toggle source
# File lib/backbone_generator/cli.rb, line 70 def test test_name BackboneGenerator::TestGenerator.create_test(test_name) unless !isvalid? end
utility(utility_name)
click to toggle source
# File lib/backbone_generator/cli.rb, line 55 def utility utility_name BackboneGenerator::UtilityGenerator.create_utility(utility_name) unless !isvalid? end
view(view_name)
click to toggle source
# File lib/backbone_generator/cli.rb, line 40 def view view_name BackboneGenerator::ViewGenerator.create_view(view_name) unless !isvalid? end
Private Instance Methods
isvalid?()
click to toggle source
# File lib/backbone_generator/cli.rb, line 13 def isvalid? if File.exists? ".BACKBONE_GENERATOR_APP" return true else print "error ".red puts "This command must be excuted in the root level of your app" return false end end