Solargraph

Public
IDE tools for code completion, inline documentation, and static analysis
Icons/chart bar
Used 76 times
Created by
V Viktor Schmidt

Usage

Run this command in your Rails app directory in the terminal:

rails app:template LOCATION="https://railsbytes.com/script/V4Ysrj"
Template Source

Review the code before running this template on your machine.

def do_bundle
  Bundler.with_original_env { run "bundle install" }
end

def print_green(heredoc)
  puts set_color heredoc, :green
end

def do_commit
  git :init
  git add: "."
  git commit: " -m 'Add Solargraph static analysis tool' "
end

say "\nApplying Solargraph static analysis tool..."
inject_into_file 'Gemfile', after: 'group :development do' do
  <<-RUBY

  # IDE tools for code completion, inline documentation, and static analysis
  gem "solargraph", "~> 0.48", require: false
  RUBY
end

do_bundle

say "\nAdding documentation for developers..."
create_file "doc/quality_assurance.md", "# Source code quality assurance and best praxis\n" unless File.exist? "doc/quality_assurance.md"
append_file "doc/quality_assurance.md" do
  <<~EOF 

  ## Solargraph

  [IDE tools](https://rubygems.org/gems/solargraph) for code completion, inline documentation, and static analysis.

  Also check out Microsoft Visual Studio Code Extension:

  [Ruby Solargraph](https://marketplace.visualstudio.com/items?itemName=castwide.solargraph)
  EOF
end

do_commit

print_green "\nAdded Solargraph successfully!"
Comments

Sign up or Login to leave a comment.