Class: Flexite::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/flexite/configuration.rb', line 9

def initialize
  @paths = {}
  @root_cache_key = 'all-cached-nodes'
  @cache = ActiveSupport::Cache::MemoryStore.new(size: 64.megabytes)
  @app_link = '/'
  @source_roots = {}
  @hierarchy = {}
  @history_limit = 10
  @diff_depth_separator = ' -> '
  @diff_approach = :sync
  @stages = []
  @cache_matcher = -> (pattern) { Regexp.new(pattern) }
end

Instance Attribute Details

Returns the value of attribute app_link.



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

def app_link
  @app_link
end

#app_nameObject

Returns the value of attribute app_name.



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

def app_name
  @app_name
end

#async_diff_handlerObject

Returns the value of attribute async_diff_handler.



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

def async_diff_handler
  @async_diff_handler
end

#cacheObject (readonly)

Returns the value of attribute cache.



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

def cache
  @cache
end

#cache_matcherObject

Returns the value of attribute cache_matcher.



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

def cache_matcher
  @cache_matcher
end

#diff_approachObject

Returns the value of attribute diff_approach.



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

def diff_approach
  @diff_approach
end

#diff_depth_separatorObject

Returns the value of attribute diff_depth_separator.



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

def diff_depth_separator
  @diff_depth_separator
end

#hierarchyObject

Returns the value of attribute hierarchy.



3
4
5
# File 'lib/flexite/configuration.rb', line 3

def hierarchy
  @hierarchy
end

#history_limitObject

Returns the value of attribute history_limit.



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

def history_limit
  @history_limit
end

#migration_tokenObject

Returns the value of attribute migration_token.



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

def migration_token
  @migration_token
end

#pathsObject

Returns the value of attribute paths.



3
4
5
# File 'lib/flexite/configuration.rb', line 3

def paths
  @paths
end

#root_cache_keyObject

Returns the value of attribute root_cache_key.



3
4
5
# File 'lib/flexite/configuration.rb', line 3

def root_cache_key
  @root_cache_key
end

#source_rootsObject

Returns the value of attribute source_roots.



3
4
5
# File 'lib/flexite/configuration.rb', line 3

def source_roots
  @source_roots
end

#stagenameObject

Returns the value of attribute stagename.



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

def stagename
  @stagename
end

#stagesObject

Returns the value of attribute stages.



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

def stages
  @stages
end

Instance Method Details

#cache_store=(*args) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/flexite/configuration.rb', line 23

def cache_store=(*args)
  @cache = ActiveSupport::Cache.lookup_store(*args)

  if @cache.options[:namespace].blank?
    @cache.options[:namespace] = :flexite
  end
end