Class: Suspenders::PreloaderGenerator::UncacheClasses

Inherits:
Object
  • Object
show all
Defined in:
lib/suspenders/generators/preloader_generator.rb

Instance Method Summary collapse

Constructor Details

#initialize(base, config_file) ⇒ UncacheClasses

Returns a new instance of UncacheClasses.


47
48
49
50
# File 'lib/suspenders/generators/preloader_generator.rb', line 47

def initialize(base, config_file)
  @base = base
  @config_file = config_file
end

Instance Method Details

#invoke!Object


52
53
54
55
56
57
58
59
# File 'lib/suspenders/generators/preloader_generator.rb', line 52

def invoke!
  @base.send(
    :always_gsub_file,
    @config_file,
    "config.cache_classes = true",
    "config.cache_classes = false"
  )
end

#revoke!Object


61
62
63
64
65
66
67
68
# File 'lib/suspenders/generators/preloader_generator.rb', line 61

def revoke!
  @base.send(
    :always_gsub_file,
    @config_file,
    "config.cache_classes = false",
    "config.cache_classes = true"
  )
end