Class: HelixRuntime::CLI::Bootstrap
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- HelixRuntime::CLI::Bootstrap
- Includes:
- Thor::Actions
- Defined in:
- lib/helix_runtime/cli/bootstrap.rb
Instance Method Summary collapse
- #add_gitignore ⇒ Object
- #add_rake_task ⇒ Object
- #add_ruby_lib_file ⇒ Object
- #add_rust_lib_file ⇒ Object
- #bundle ⇒ Object
-
#create_cargo_toml ⇒ Object
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.
- #create_gemfile ⇒ Object
- #create_gemspec ⇒ Object
- #update_rakefile ⇒ Object
Instance Method Details
#add_gitignore ⇒ Object
42 43 44 |
# File 'lib/helix_runtime/cli/bootstrap.rb', line 42 def add_gitignore template "gitignore", "#{base_path}/.gitignore" end |
#add_rake_task ⇒ Object
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_file ⇒ Object
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_file ⇒ Object
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 |
#bundle ⇒ Object
54 55 56 57 58 59 60 |
# File 'lib/helix_runtime/cli/bootstrap.rb', line 54 def bundle unless .skip_bundle inside path do run "bundle" end end end |
#create_cargo_toml ⇒ Object
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_gemfile ⇒ Object
30 31 32 |
# File 'lib/helix_runtime/cli/bootstrap.rb', line 30 def create_gemfile template "Gemfile", "#{base_path}/Gemfile" end |
#create_gemspec ⇒ Object
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_rakefile ⇒ Object
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 |