Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Just adding rbenv support #45

Closed
wants to merge 2 commits into from

13 participants

Matthew Hutchinson Wael M. Nasreddine Patrick Detlefsen Alejandro Dev. Alex Okolish Lake Denman Brian Pearce Thomas Rix Dennis Reimann Daniel Bayerlein Allen Bargi Fran Casas Christopher Chow
Matthew Hutchinson

Added rbenv support, in a similar way rvm was done; new sample file in assets added for additional specs

Wael M. Nasreddine

+1 Please pull

Patrick Detlefsen

yes. please merge this pull request.

Alex Okolish

:+1: can this be merged?

Lake Denman

This would be awesome to have. If you need any help maintaining this project, do let me know.

Brian Pearce

+1

Thomas Rix

Why is this still not merged?

Brian Pearce

I'm thinking it may be abandonware. @aziz could be very busy on something else.

Christopher Chow Soliah referenced this pull request from a commit
Christopher Chow Soliah [Closes #45, #36] Add support for rbenv. 6429f80
Dennis Reimann

yeah, would be nice to have this. is tmuxinator abandoned?

Dennis Reimann

Is someone willing to fork it, integrate all the pulls and add it as a new gem to RubyGems.org?

Daniel Bayerlein

@aziz Would you no longer maintain this project?

Allen Bargi
Owner

I tried several times to find some time for this project but I failed, but don't worry now I found a collaborator.
Starting this week @franciscoj is helping me maintaining Tmuxinator. So stay tuned for a lot of new features and , finally, merging some of those old pull requests.

Dennis Reimann

That's great news! :+1:

Daniel Bayerlein

@aziz @franciscoj Last commit: 7 months ago :pensive:

Fran Casas

@danielbayerlein I know :( And I'm sorry. Just when @aziz told me I could give him a hand with it I got quite a lot more load from work and home and I need to organize before I can go with this.

In the meantime, there's an error on master which prevented me from being able to merge anything. If anybody can send a pull requests to fix it. Everything would be much more smooth and I could start merging all the amazing pull requests that the comunity has already sent.

Kr,
Fran.

Daniel Bayerlein

@franciscoj

In the meantime, there's an error on master which prevented me from being able to merge anything. If anybody can send a pull requests to fix it.

Can you tell me more about the error in a new issue?

Christopher Chow
Owner

I've managed to rebase this and #79 on top of master and have been using my fork successfully with rbenv. Have a look at #96.

Fran Casas

@danielbayerlein it doesn't matter the layout or panes I load, I get only one pane and 1 window.

However, the rebase from @Soliah seems to fix this for some reason.

I'm merging the @Soliah rebase (which includes some more things).

Thanks a lot @matthutchinson for your work :+1:

Fran Casas franciscoj closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 29, 2011
  1. Matthew Hutchinson
Commits on Mar 19, 2012
  1. Matthew Hutchinson
This page is out of date. Refresh to see the latest.
1  Gemfile
View
@@ -2,7 +2,6 @@ source "http://rubygems.org"
group :development do
gem "rspec", "~> 2.6.0"
- gem "bundler", "~> 1.1.rc"
gem "jeweler", "~> 1.6.4"
gem "rcov", "~> 0.9.10"
end
1  Gemfile.lock
View
@@ -22,7 +22,6 @@ PLATFORMS
ruby
DEPENDENCIES
- bundler (~> 1.1.rc)
jeweler (~> 1.6.4)
rcov (~> 0.9.10)
rspec (~> 2.6.0)
22 lib/tmuxinator/assets/rbenv_sample.yml
View
@@ -0,0 +1,22 @@
+# ~/.tmuxinator/<%= @name %>.yml
+# you can make as many tabs as you wish...
+
+project_name: Tmuxinator
+project_root: ~/code/rails_project
+socket_name: foo # Not needed. Remove to use default socket
+rbenv: 1.9.2-p290
+pre: sudo /etc/rc.d/mysqld start
+tabs:
+ - editor:
+ layout: main-vertical
+ panes:
+ - vim
+ - #empty, will just run plain bash
+ - top
+ - shell: git pull
+ - database: rails db
+ - server: rails s
+ - logs: tail -f logs/development.log
+ - console: rails c
+ - capistrano:
+ - server: ssh me@myhost
11 lib/tmuxinator/config_writer.rb
View
@@ -1,7 +1,7 @@
module Tmuxinator
class ConfigWriter
- attr_accessor :file_name, :file_path, :project_name, :project_root, :rvm, :tabs, :pre, :settings, :hotkeys
+ attr_accessor :file_name, :file_path, :project_name, :project_root, :rvm, :tabs, :pre, :settings, :hotkeys, :rbenv
include Tmuxinator::Helper
@@ -52,6 +52,7 @@ def process_config!
@project_name = yaml["project_name"]
@project_root = yaml["project_root"]
@rvm = yaml["rvm"]
+ @rbenv = yaml["rbenv"]
@pre = build_command(yaml["pre"])
@tabs = []
@socket_name = yaml['socket_name']
@@ -103,8 +104,12 @@ def ensure_list(value)
def build_command(value, rvm_prepend=true)
commands = ensure_list(value)
- if @rvm && rvm_prepend
- commands.unshift "rvm use #{@rvm}"
+ if rvm_prepend
+ if @rbenv
+ commands.unshift "rbenv shell #{@rbenv}"
+ elsif @rvm
+ commands.unshift "rvm use #{@rvm}"
+ end
end
commands.join ' && '
end
1  spec/spec_helper.rb
View
@@ -8,6 +8,7 @@
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
SAMPLE_CONFIG = File.join(File.dirname(__FILE__), '..', 'lib', 'tmuxinator', 'assets', 'sample.yml')
+RBENV_SAMPLE_CONFIG = File.join(File.dirname(__FILE__), '..', 'lib', 'tmuxinator', 'assets', 'rbenv_sample.yml')
RSpec.configure do |config|
18 spec/tmuxinator_spec.rb
View
@@ -59,4 +59,22 @@
specify{ third_tab.panes.should be_an Array }
specify{ third_tab.pre.should eql "rvm use 1.9.2@rails_project && echo 'I get run in each pane.' && echo 'Before each pane command!'"}
end
+
+ context "with rbenv configured" do
+ before do
+ subject.file_path = RBENV_SAMPLE_CONFIG
+ end
+
+ its(:rbenv){ should eql '1.9.2-p290' }
+
+ let(:first_tab){ subject.tabs[0] }
+
+ it "should prepend each pane with the rbenv string" do
+ first_tab.panes.map{|p| p.split(/ && /)[0] }.should eql ["rbenv shell 1.9.2-p290"] * 3
+ end
+
+ let(:second_tab){ subject.tabs[1] }
+ specify{ second_tab.name.should eql "shell" }
+ specify{ second_tab.command.should eql "rbenv shell 1.9.2-p290 && git pull"}
+ end
end
Something went wrong with that request. Please try again.