Class: Syntaxer::LanguageDefinition

Inherits:
Struct
  • Object
show all
Defined in:
lib/syntaxer/language_definition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#deferredObject

Returns the value of attribute deferred

Returns:

  • (Object)

    the current value of deferred



4
5
6
# File 'lib/syntaxer/language_definition.rb', line 4

def deferred
  @deferred
end

#exec_existenceObject

Returns the value of attribute exec_existence

Returns:

  • (Object)

    the current value of exec_existence



4
5
6
# File 'lib/syntaxer/language_definition.rb', line 4

def exec_existence
  @exec_existence
end

#exec_ruleObject

Returns the value of attribute exec_rule

Returns:

  • (Object)

    the current value of exec_rule



4
5
6
# File 'lib/syntaxer/language_definition.rb', line 4

def exec_rule
  @exec_rule
end

#executorObject

Returns the value of attribute executor

Returns:

  • (Object)

    the current value of executor



4
5
6
# File 'lib/syntaxer/language_definition.rb', line 4

def executor
  @executor
end

#extensionsObject

Returns the value of attribute extensions

Returns:

  • (Object)

    the current value of extensions



4
5
6
# File 'lib/syntaxer/language_definition.rb', line 4

def extensions
  @extensions
end

#foldersObject

Returns the value of attribute folders

Returns:

  • (Object)

    the current value of folders



4
5
6
# File 'lib/syntaxer/language_definition.rb', line 4

def folders
  @folders
end

#ignore_foldersObject

Returns the value of attribute ignore_folders

Returns:

  • (Object)

    the current value of ignore_folders



4
5
6
# File 'lib/syntaxer/language_definition.rb', line 4

def ignore_folders
  @ignore_folders
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



4
5
6
# File 'lib/syntaxer/language_definition.rb', line 4

def name
  @name
end

#specific_filesObject

Returns the value of attribute specific_files

Returns:

  • (Object)

    the current value of 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