Class: JsDependency::CliUtils::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/js_dependency/cli_utils/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options, args) ⇒ Config

Returns a new instance of Config.

Parameters:

  • options (Hash)
  • args (Hash)


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/js_dependency/cli_utils/config.rb', line 11

def initialize(options, args)
  @src_path = options[:src_path] || args[:src_path]
  @target_paths = calc_target_paths(options[:target_path], options[:target_paths], args[:target_path],
                                    args[:target_paths])
  @target_path = calc_target_path(options[:target_path], options[:target_paths], args[:target_path],
                                  args[:target_paths])
  @child_analyze_level = options[:child_analyze_level] || args[:child_analyze_level] || 2
  @parent_analyze_level = options[:parent_analyze_level] || args[:parent_analyze_level] || 2
  @output_path = options[:output_path] || args[:output_path] || nil
  @alias_paths = options[:alias_paths] || args[:alias_paths] || {}
  @name_level = options[:name_level] || args[:name_level] || 1
  @excludes = calc_excludes(options[:excludes], args[:excludes])
  @identifier = options[:identifier] || nil
  @exclude_output_names = options[:exclude_output_names] || []
end

Instance Attribute Details

#alias_pathsObject (readonly)

Returns the value of attribute alias_paths.



6
7
8
# File 'lib/js_dependency/cli_utils/config.rb', line 6

def alias_paths
  @alias_paths
end

#child_analyze_levelObject (readonly)

Returns the value of attribute child_analyze_level.



6
7
8
# File 'lib/js_dependency/cli_utils/config.rb', line 6

def child_analyze_level
  @child_analyze_level
end

#exclude_output_namesObject (readonly)

Returns the value of attribute exclude_output_names.



6
7
8
# File 'lib/js_dependency/cli_utils/config.rb', line 6

def exclude_output_names
  @exclude_output_names
end

#excludesObject (readonly)

Returns the value of attribute excludes.



6
7
8
# File 'lib/js_dependency/cli_utils/config.rb', line 6

def excludes
  @excludes
end

#identifierObject (readonly)

Returns the value of attribute identifier.



6
7
8
# File 'lib/js_dependency/cli_utils/config.rb', line 6

def identifier
  @identifier
end

#name_levelObject (readonly)

Returns the value of attribute name_level.



6
7
8
# File 'lib/js_dependency/cli_utils/config.rb', line 6

def name_level
  @name_level
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



6
7
8
# File 'lib/js_dependency/cli_utils/config.rb', line 6

def output_path
  @output_path
end

#parent_analyze_levelObject (readonly)

Returns the value of attribute parent_analyze_level.



6
7
8
# File 'lib/js_dependency/cli_utils/config.rb', line 6

def parent_analyze_level
  @parent_analyze_level
end

#src_pathObject (readonly)

Returns the value of attribute src_path.



6
7
8
# File 'lib/js_dependency/cli_utils/config.rb', line 6

def src_path
  @src_path
end

#target_pathObject (readonly)

Returns the value of attribute target_path.



6
7
8
# File 'lib/js_dependency/cli_utils/config.rb', line 6

def target_path
  @target_path
end

#target_pathsObject (readonly)

Returns the value of attribute target_paths.



6
7
8
# File 'lib/js_dependency/cli_utils/config.rb', line 6

def target_paths
  @target_paths
end