Class: Syntaxer::LanguageDefinition
- Inherits:
-
Struct
- Object
- Struct
- Syntaxer::LanguageDefinition
- Defined in:
- lib/syntaxer/language_definition.rb
Instance Attribute Summary collapse
-
#deferred ⇒ Object
Returns the value of attribute deferred.
-
#exec_existence ⇒ Object
Returns the value of attribute exec_existence.
-
#exec_rule ⇒ Object
Returns the value of attribute exec_rule.
-
#executor ⇒ Object
Returns the value of attribute executor.
-
#extensions ⇒ Object
Returns the value of attribute extensions.
-
#folders ⇒ Object
Returns the value of attribute folders.
-
#ignore_folders ⇒ Object
Returns the value of attribute ignore_folders.
-
#name ⇒ Object
Returns the value of attribute name.
-
#specific_files ⇒ Object
Returns the value of attribute specific_files.
Instance Method Summary collapse
- #files_list(root_path) ⇒ Object
-
#initialize(*args) ⇒ LanguageDefinition
constructor
A new instance of LanguageDefinition.
Constructor Details
#initialize(*args) ⇒ LanguageDefinition
Returns a new instance of LanguageDefinition.
5 6 7 8 |
# File 'lib/syntaxer/language_definition.rb', line 5 def initialize(*args) super(*args) raise LanguageDefinitionException.new "name can't be blank" unless self.name end |
Instance Attribute Details
#deferred ⇒ Object
Returns the value of attribute deferred
4 5 6 |
# File 'lib/syntaxer/language_definition.rb', line 4 def deferred @deferred end |
#exec_existence ⇒ Object
Returns the value of attribute exec_existence
4 5 6 |
# File 'lib/syntaxer/language_definition.rb', line 4 def exec_existence @exec_existence end |
#exec_rule ⇒ Object
Returns the value of attribute exec_rule
4 5 6 |
# File 'lib/syntaxer/language_definition.rb', line 4 def exec_rule @exec_rule end |
#executor ⇒ Object
Returns the value of attribute executor
4 5 6 |
# File 'lib/syntaxer/language_definition.rb', line 4 def executor @executor end |
#extensions ⇒ Object
Returns the value of attribute extensions
4 5 6 |
# File 'lib/syntaxer/language_definition.rb', line 4 def extensions @extensions end |
#folders ⇒ Object
Returns the value of attribute folders
4 5 6 |
# File 'lib/syntaxer/language_definition.rb', line 4 def folders @folders end |
#ignore_folders ⇒ Object
Returns the value of attribute ignore_folders
4 5 6 |
# File 'lib/syntaxer/language_definition.rb', line 4 def ignore_folders @ignore_folders end |
#name ⇒ Object
Returns the value of attribute name
4 5 6 |
# File 'lib/syntaxer/language_definition.rb', line 4 def name @name end |
#specific_files ⇒ Object
Returns the value of attribute specific_files
4 5 6 |
# File 'lib/syntaxer/language_definition.rb', line 4 def specific_files @specific_files end |
Instance Method Details
#files_list(root_path) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/syntaxer/language_definition.rb', line 11 def files_list(root_path) root_path += "/" if root_path.match(/\/$/).nil? main_rule = folders.map{|f| root_path + f + ".\{#{extensions.join(',')}\}"} list = Rake::FileList.new(main_rule) do |fl| fl.exclude(ignore_folders) if ignore_folders end all_files = Rake::FileList.new(root_path+'*') list += all_files.find_all {|f| f if !File.directory?(f) && !specific_files.nil? && specific_files.include?(File.basename(f)) } list end |