Class: FeatureMap::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/feature_map/configuration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(assigned_globs: nil, unassigned_globs: nil, unbuilt_gems_path: nil, skip_features_validation: nil, raw_hash: nil, skip_code_ownership: nil, require_assignment_for_teams: nil, ignore_feature_definitions: nil, code_cov: nil, repository: nil, documentation_site: nil, documentation_site_url: nil) ⇒ Configuration

Returns a new instance of Configuration.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/feature_map/configuration.rb', line 17

def initialize(
  assigned_globs: nil,
  unassigned_globs: nil,
  unbuilt_gems_path: nil,
  skip_features_validation: nil,
  raw_hash: nil,
  skip_code_ownership: nil,
  require_assignment_for_teams: nil,
  ignore_feature_definitions: nil,
  code_cov: nil,
  repository: nil,
  documentation_site: nil,
  documentation_site_url: nil
)
  @assigned_globs = assigned_globs
  @unassigned_globs = unassigned_globs
  @unbuilt_gems_path = unbuilt_gems_path
  @skip_features_validation = skip_features_validation
  @raw_hash = raw_hash
  @skip_code_ownership = skip_code_ownership
  @require_assignment_for_teams = require_assignment_for_teams
  @ignore_feature_definitions = ignore_feature_definitions
  @code_cov = code_cov
  @repository = repository
  @documentation_site = documentation_site
  @documentation_site_url = documentation_site_url
end

Instance Attribute Details

#assigned_globsObject (readonly)

Returns the value of attribute assigned_globs.



4
5
6
# File 'lib/feature_map/configuration.rb', line 4

def assigned_globs
  @assigned_globs
end

#code_covObject (readonly)

Returns the value of attribute code_cov.



12
13
14
# File 'lib/feature_map/configuration.rb', line 12

def code_cov
  @code_cov
end

#documentation_siteObject (readonly)

Returns the value of attribute documentation_site.



14
15
16
# File 'lib/feature_map/configuration.rb', line 14

def documentation_site
  @documentation_site
end

#documentation_site_urlObject (readonly)

Returns the value of attribute documentation_site_url.



15
16
17
# File 'lib/feature_map/configuration.rb', line 15

def documentation_site_url
  @documentation_site_url
end

#ignore_feature_definitionsObject (readonly)

Returns the value of attribute ignore_feature_definitions.



11
12
13
# File 'lib/feature_map/configuration.rb', line 11

def ignore_feature_definitions
  @ignore_feature_definitions
end

#raw_hashObject (readonly)

Returns the value of attribute raw_hash.



8
9
10
# File 'lib/feature_map/configuration.rb', line 8

def raw_hash
  @raw_hash
end

#repositoryObject (readonly)

Returns the value of attribute repository.



13
14
15
# File 'lib/feature_map/configuration.rb', line 13

def repository
  @repository
end

#require_assignment_for_teamsObject (readonly)

Returns the value of attribute require_assignment_for_teams.



10
11
12
# File 'lib/feature_map/configuration.rb', line 10

def require_assignment_for_teams
  @require_assignment_for_teams
end

#skip_code_ownershipObject (readonly)

Returns the value of attribute skip_code_ownership.



9
10
11
# File 'lib/feature_map/configuration.rb', line 9

def skip_code_ownership
  @skip_code_ownership
end

#skip_features_validationObject (readonly)

Returns the value of attribute skip_features_validation.



7
8
9
# File 'lib/feature_map/configuration.rb', line 7

def skip_features_validation
  @skip_features_validation
end

#unassigned_globsObject (readonly)

Returns the value of attribute unassigned_globs.



5
6
7
# File 'lib/feature_map/configuration.rb', line 5

def unassigned_globs
  @unassigned_globs
end

#unbuilt_gems_pathObject (readonly)

Returns the value of attribute unbuilt_gems_path.



6
7
8
# File 'lib/feature_map/configuration.rb', line 6

def unbuilt_gems_path
  @unbuilt_gems_path
end

Class Method Details

.fetchObject



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/feature_map/configuration.rb', line 45

def self.fetch
  config_hash = YAML.load_file('.feature_map/config.yml')

  if config_hash.key?('require')
    config_hash['require'].each do |require_directive|
      Private::ExtensionLoader.load(require_directive)
    end
  end

  new(
    assigned_globs: config_hash.fetch('assigned_globs', []),
    unassigned_globs: config_hash.fetch('unassigned_globs', []),
    skip_features_validation: config_hash.fetch('skip_features_validation', false),
    raw_hash: config_hash,
    skip_code_ownership: config_hash.fetch('skip_code_ownership', true),
    require_assignment_for_teams: config_hash.fetch('require_assignment_for_teams', nil),
    ignore_feature_definitions: config_hash.fetch('ignore_feature_definitions', false),
    code_cov: config_hash.fetch('code_cov', {}),
    repository: config_hash.fetch('repository', {}),
    documentation_site: config_hash.fetch('documentation_site', {}),
    documentation_site_url: config_hash.fetch('documentation_site_url', nil)
  )
end