Class: HelixRuntime::CLI::Bootstrap

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/helix_runtime/cli/bootstrap.rb

Instance Method Summary collapse

Instance Method Details

#add_gitignoreObject



42
43
44
# File 'lib/helix_runtime/cli/bootstrap.rb', line 42

def add_gitignore
  template "gitignore", "#{base_path}/.gitignore"
end

#add_rake_taskObject



34
35
36
# File 'lib/helix_runtime/cli/bootstrap.rb', line 34

def add_rake_task
  template "helix_runtime.rake", "#{base_path}/lib/tasks/helix_runtime.rake"
end

#add_ruby_lib_fileObject



38
39
40
# File 'lib/helix_runtime/cli/bootstrap.rb', line 38

def add_ruby_lib_file
  template "lib.rb", "#{base_path}/lib/#{app_name}.rb"
end

#add_rust_lib_fileObject



22
23
24
# File 'lib/helix_runtime/cli/bootstrap.rb', line 22

def add_rust_lib_file
  template "lib.rs", "#{base_path}/src/lib.rs"
end

#bundleObject



54
55
56
57
58
59
60
# File 'lib/helix_runtime/cli/bootstrap.rb', line 54

def bundle
  unless options.skip_bundle
    inside path do
      run "bundle"
    end
  end
end

#create_cargo_tomlObject

NOTE: Instead of using destination_root, we include the full path so

that we see the path relative to the root of where we're running the command.


18
19
20
# File 'lib/helix_runtime/cli/bootstrap.rb', line 18

def create_cargo_toml
  template "Cargo.toml", "#{base_path}/Cargo.toml"
end

#create_gemfileObject



30
31
32
# File 'lib/helix_runtime/cli/bootstrap.rb', line 30

def create_gemfile
  template "Gemfile", "#{base_path}/Gemfile"
end

#create_gemspecObject



26
27
28
# File 'lib/helix_runtime/cli/bootstrap.rb', line 26

def create_gemspec
  template "gem.gemspec", "#{base_path}/#{app_name}.gemspec"
end

#update_rakefileObject



46
47
48
49
50
51
52
# File 'lib/helix_runtime/cli/bootstrap.rb', line 46

def update_rakefile
  unless File.exists?("#{base_path}/Rakefile")
    create_file "#{base_path}/Rakefile", "require 'bundler/setup'\n"
  end

  append_to_file "#{base_path}/Rakefile", "import 'lib/tasks/helix_runtime.rake'\n"
end