Module: Retrospec::Plugin::V1
- Defined in:
- lib/retrospec/plugins/v1/instance.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#module_dir_name ⇒ Object
Returns the value of attribute module_dir_name.
-
#module_name ⇒ Object
Returns the value of attribute module_name.
-
#module_path ⇒ Object
Returns the value of attribute module_path.
-
#plugin_name ⇒ Object
readonly
Returns the value of attribute plugin_name.
Class Method Summary collapse
-
.file_type ⇒ Object
the main file type that is used to help discover what the module is.
-
.plugin_name ⇒ Object
the name of the plugin, defaults to the name of the class.
-
.valid_module_dir?(dir) ⇒ Boolean
validates that the module meets the plugins criteria returns boolean true if module files are valid, false otherwise validates module directory fits the description of this plugin.
Instance Method Summary collapse
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
4 5 6 |
# File 'lib/retrospec/plugins/v1/instance.rb', line 4 def config @config end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
5 6 7 |
# File 'lib/retrospec/plugins/v1/instance.rb', line 5 def files @files end |
#module_dir_name ⇒ Object
Returns the value of attribute module_dir_name.
4 5 6 |
# File 'lib/retrospec/plugins/v1/instance.rb', line 4 def module_dir_name @module_dir_name end |
#module_name ⇒ Object
Returns the value of attribute module_name.
4 5 6 |
# File 'lib/retrospec/plugins/v1/instance.rb', line 4 def module_name @module_name end |
#module_path ⇒ Object
Returns the value of attribute module_path.
4 5 6 |
# File 'lib/retrospec/plugins/v1/instance.rb', line 4 def module_path @module_path end |
#plugin_name ⇒ Object (readonly)
Returns the value of attribute plugin_name.
5 6 7 |
# File 'lib/retrospec/plugins/v1/instance.rb', line 5 def plugin_name @plugin_name end |
Class Method Details
.file_type ⇒ Object
the main file type that is used to help discover what the module is
34 35 36 |
# File 'lib/retrospec/plugins/v1/instance.rb', line 34 def self.file_type raise NotImplementedError end |
.plugin_name ⇒ Object
the name of the plugin, defaults to the name of the class
29 30 31 |
# File 'lib/retrospec/plugins/v1/instance.rb', line 29 def self.plugin_name self.class.downcase end |
.valid_module_dir?(dir) ⇒ Boolean
validates that the module meets the plugins criteria returns boolean true if module files are valid, false otherwise validates module directory fits the description of this plugin
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/retrospec/plugins/v1/instance.rb', line 10 def self.valid_module_dir?(dir) if ! File.exist?(dir) false else module_files ||= Dir.glob("#{dir}/**/*#{file_type}") if module_files.length < 1 false else true end end end |
Instance Method Details
#run ⇒ Object
38 39 40 |
# File 'lib/retrospec/plugins/v1/instance.rb', line 38 def run raise NotImplementedError end |