Top Level Namespace
Defined Under Namespace
Modules: RailsInteractive
Instance Method Summary
collapse
Instance Method Details
#bundle_install ⇒ Object
3
4
5
|
# File 'lib/cli/templates/setup_haml.rb', line 3
def bundle_install
Bundler.with_unbundled_env { run "bundle install" }
end
|
#file_contains?(filename, string) ⇒ Boolean
3
4
5
|
# File 'lib/cli/templates/setup_sidekiq.rb', line 3
def file_contains?(filename, string)
File.foreach(filename).detect { |line| line.include?(string) }
end
|
#package?(package) ⇒ Boolean
3
4
5
6
7
8
9
10
11
|
# File 'lib/cli/templates/setup_tailwind.rb', line 3
def package?(package)
require "json"
file = File.open("package.json") if File.file?("package.json")
packages = JSON.parse(file.read) if file
packages["dependencies"].include?(package) if packages
end
|