Class: Specfac::CLI
- Inherits:
-
Thor
- Object
- Thor
- Specfac::CLI
- Includes:
- E2eModule, FactoryModule, SpecModule, SupportModule, Thor::Actions, Utils
- Defined in:
- lib/specfac.rb
Instance Attribute Summary collapse
-
#available_methods ⇒ Object
Returns the value of attribute available_methods.
-
#dir_controllers ⇒ Object
Returns the value of attribute dir_controllers.
-
#dir_factories ⇒ Object
Returns the value of attribute dir_factories.
-
#dir_features ⇒ Object
Returns the value of attribute dir_features.
-
#dir_support ⇒ Object
Returns the value of attribute dir_support.
-
#paths ⇒ Object
Returns the value of attribute paths.
-
#working_dirs ⇒ Object
Returns the value of attribute working_dirs.
-
#working_file ⇒ Object
Returns the value of attribute working_file.
Instance Method Summary collapse
Methods included from E2eModule
create, destroy, edit, index, new, show, update
Methods included from SupportModule
Methods included from FactoryModule
Methods included from Utils
define_utils_methods_params, pl, pluralize, si, si_ca, singularize
Methods included from SpecModule
create, destroy, edit, index, new, show, update
Instance Attribute Details
#available_methods ⇒ Object
Returns the value of attribute available_methods.
46 47 48 |
# File 'lib/specfac.rb', line 46 def available_methods @available_methods end |
#dir_controllers ⇒ Object
Returns the value of attribute dir_controllers.
46 47 48 |
# File 'lib/specfac.rb', line 46 def dir_controllers @dir_controllers end |
#dir_factories ⇒ Object
Returns the value of attribute dir_factories.
46 47 48 |
# File 'lib/specfac.rb', line 46 def dir_factories @dir_factories end |
#dir_features ⇒ Object
Returns the value of attribute dir_features.
46 47 48 |
# File 'lib/specfac.rb', line 46 def dir_features @dir_features end |
#dir_support ⇒ Object
Returns the value of attribute dir_support.
46 47 48 |
# File 'lib/specfac.rb', line 46 def dir_support @dir_support end |
#paths ⇒ Object
Returns the value of attribute paths.
46 47 48 |
# File 'lib/specfac.rb', line 46 def paths @paths end |
#working_dirs ⇒ Object
Returns the value of attribute working_dirs.
46 47 48 |
# File 'lib/specfac.rb', line 46 def working_dirs @working_dirs end |
#working_file ⇒ Object
Returns the value of attribute working_file.
46 47 48 |
# File 'lib/specfac.rb', line 46 def working_file @working_file end |
Instance Method Details
#__print_version ⇒ Object
104 105 106 |
# File 'lib/specfac.rb', line 104 def __print_version puts Specfac.show_v end |
#extract(dest) ⇒ Object
72 73 74 75 76 77 78 |
# File 'lib/specfac.rb', line 72 def extract(dest) @paths = $paths @paths[:options]["path"] = dest puts "Setting extract destination..." create_file(@paths[:options_path]) opener(nil, @paths[:options].to_json, "w", @paths[:options_path]) end |
#generate(*args) ⇒ Object
86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/specfac.rb', line 86 def generate(*args) init_vars() controller = args.shift actions = args if controller sanitize(controller, actions, ) else puts "Please provide a controller name." exit end end |
#setup(*args) ⇒ Object
111 112 113 114 115 116 |
# File 'lib/specfac.rb', line 111 def setup(*args) init_vars @working_file = "#{@dir_support}/specfac/config.rb" create_file(@working_file) args != nil ? args.each {|arg| opener("support", SupportModule.public_send(arg.to_sym), "a")} : nil end |