Socket
Book a DemoInstallSign in
Socket

vagrant-rubymine

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vagrant-rubymine

0.0.4
bundlerRubygems
Version published
Maintainers
1
Created
Source

Vagrant Rubymine

This plugin creates an environment variables on guest machine with paths to your Rubymine projects and its gems directory on host machine. Paths are read from Rubymine configuration.

Variables naming convention (e.g. for project named "sample"):

sample_path        # path to your project
sample_gems_path   # path to your project's gems

Requirments

This is first version tested on Rubymine 7.0.4 and Vagrant 1.7.2. If you need support for other version you can submit an issue.

Installation

Execute:

$ vagrant plugin install vagrant-rubymine

Usage

After login on your guest machine you can use variables with your projects' paths, e.g:

$ echo $sample_path
$ echo $sample_gems_dir

You can use it to configure [charliesome/better_errors] (https://github.com/charliesome/better_errors):

# initializers/better_errors.rb

if defined? BetterErrors
  # Opening files
  BetterErrors.editor = proc do |full_path, line|
    project_name = Rails.root.to_s.split('/').last.downcase
    project_path = ENV["#{project_name}_path"]
    gems_path = ENV["#{project_name}_gems_path"]

    if project_path && full_path =~ /#{Rails.root.to_s}/
      full_path = full_path.sub(Rails.root.to_s, project_path).sub('/', '\\')
    elsif gems_path && full_path =~ /#{Gem.dir}/
      full_path = full_path.sub("#{Gem.dir}/gems", gems_path).sub('/', '\\')
    end

    "runapp://rubymine?project_path=#{project_path}&line=#{line}&file_path=#{full_path}"
  end

  # Allowing host
  host = ENV["SSH_CLIENT"] ? ENV["SSH_CLIENT"].match(/\A([^\s]*)/)[1] : nil
  BetterErrors::Middleware.allow_ip! host if [:development, :test].member?(Rails.env.to_sym) && host
end

Contributing

  • Fork it ( https://github.com/bjarosze/vagrant-rubymine/fork )
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create a new Pull Request

FAQs

Package last updated on 04 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.