No commit activity in last 3 years
No release in over 3 years
Creates environment variables with paths to Rubymine projects.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

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

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