Class: Suspenders::PreloaderGenerator

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

Defined Under Namespace

Classes: SpringBinstubs, UncacheClasses

Instance Method Summary collapse

Methods inherited from Generators::Base

default_source_root, inherited

Methods included from Actions

#action_mailer_asset_host, #action_mailer_host, #configure_environment, #expand_json, #replace_in_file

Instance Method Details

#cache_classes_testObject


20
21
22
# File 'lib/suspenders/generators/preloader_generator.rb', line 20

def cache_classes_test
  action UncacheClasses.new(self, "config/environments/test.rb")
end

#spring_binstubsObject


24
25
26
# File 'lib/suspenders/generators/preloader_generator.rb', line 24

def spring_binstubs
  action SpringBinstubs.new(self)
end

#spring_configObject


5
6
7
# File 'lib/suspenders/generators/preloader_generator.rb', line 5

def spring_config
  template "spring.rb", "config/spring.rb", force: false, skip: true
end

#spring_gemObject


9
10
11
12
13
14
15
16
17
18
# File 'lib/suspenders/generators/preloader_generator.rb', line 9

def spring_gem
  always_gsub_file("Gemfile", /# Spring speeds up development.*/, "")

  gem_group :development do
    gem "spring"
    gem "spring-watcher-listen", "~> 2.0.0"
  end

  Bundler.with_unbundled_env { run "bundle install" }
end