Class: CljsRails::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/cljs_rails/install_generator.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#add_foreman_to_gemfileObject



14
15
16
# File 'lib/generators/cljs_rails/install_generator.rb', line 14

def add_foreman_to_gemfile
  gem 'foreman'
end

#add_to_gitignoreObject



39
40
41
42
43
44
45
46
47
# File 'lib/generators/cljs_rails/install_generator.rb', line 39

def add_to_gitignore
  append_to_file ".gitignore" do
    <<-EOF.strip_heredoc
    # Added by cljs-rails
    /app/assets/cljs-build
    .nrepl-port
    EOF
  end
end

#copy_boot_propertiesObject



26
27
28
# File 'lib/generators/cljs_rails/install_generator.rb', line 26

def copy_boot_properties
  copy_file "boot.properties", "boot.properties"
end

#copy_build_bootObject



22
23
24
# File 'lib/generators/cljs_rails/install_generator.rb', line 22

def copy_build_boot
  template("build.boot", "build.boot")
end

#copy_procfileObject



18
19
20
# File 'lib/generators/cljs_rails/install_generator.rb', line 18

def copy_procfile
  copy_file "Procfile", "Procfile"
end

#create_core_cljsObject



30
31
32
33
# File 'lib/generators/cljs_rails/install_generator.rb', line 30

def create_core_cljs
  empty_directory "cljs/src/#{app_name}"
  template("core.cljs", "cljs/src/#{app_name}/core.cljs")
end

#create_main_ednObject



35
36
37
# File 'lib/generators/cljs_rails/install_generator.rb', line 35

def create_main_edn
  template("main.cljs.edn", "cljs/src/main.cljs.edn")
end

#whats_nextObject



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/generators/cljs_rails/install_generator.rb', line 49

def whats_next
  puts <<-EOF.strip_heredoc

    We've set up the basics of clojurescript-rails for you, but you'll still
    need to:

      1. Add the 'main' entry point into your layout, and
      2. Run 'foreman start' to run the boot build and rails server

    See the README.md for this gem at
    https://github.com/bogdan-dumitru/cljs-rails/blob/master/README.md
    for more info.

    Have a functional day!
  EOF
end