Skip to content
This repository

Just adding rbenv support #45

Closed
wants to merge 2 commits into from
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 in Soliah/tmuxinator February 10, 2013
Christopher Chow [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
aziz commented March 14, 2013

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
Collaborator

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 April 08, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
1  Gemfile
@@ -2,7 +2,6 @@ source "http://rubygems.org"
2 2
 
3 3
 group :development do
4 4
   gem "rspec",   "~> 2.6.0"
5  
-  gem "bundler", "~> 1.1.rc"
6 5
   gem "jeweler", "~> 1.6.4"
7 6
   gem "rcov",    "~> 0.9.10"
8 7
 end
1  Gemfile.lock
@@ -22,7 +22,6 @@ PLATFORMS
22 22
   ruby
23 23
 
24 24
 DEPENDENCIES
25  
-  bundler (~> 1.1.rc)
26 25
   jeweler (~> 1.6.4)
27 26
   rcov (~> 0.9.10)
28 27
   rspec (~> 2.6.0)
22  lib/tmuxinator/assets/rbenv_sample.yml
... ...
@@ -0,0 +1,22 @@
  1
+# ~/.tmuxinator/<%= @name %>.yml
  2
+# you can make as many tabs as you wish...
  3
+
  4
+project_name: Tmuxinator
  5
+project_root: ~/code/rails_project
  6
+socket_name: foo # Not needed.  Remove to use default socket
  7
+rbenv: 1.9.2-p290
  8
+pre: sudo /etc/rc.d/mysqld start
  9
+tabs:
  10
+  - editor:
  11
+      layout: main-vertical
  12
+      panes:
  13
+        - vim
  14
+        - #empty, will just run plain bash
  15
+        - top
  16
+  - shell: git pull
  17
+  - database: rails db
  18
+  - server: rails s
  19
+  - logs: tail -f logs/development.log
  20
+  - console: rails c
  21
+  - capistrano:
  22
+  - server: ssh me@myhost
11  lib/tmuxinator/config_writer.rb
... ...
@@ -1,7 +1,7 @@
1 1
 module Tmuxinator
2 2
 
3 3
   class ConfigWriter
4  
-    attr_accessor :file_name, :file_path, :project_name, :project_root, :rvm, :tabs, :pre, :settings, :hotkeys
  4
+    attr_accessor :file_name, :file_path, :project_name, :project_root, :rvm, :tabs, :pre, :settings, :hotkeys, :rbenv
5 5
 
6 6
     include Tmuxinator::Helper
7 7
 
@@ -52,6 +52,7 @@ def process_config!
52 52
       @project_name = yaml["project_name"]
53 53
       @project_root = yaml["project_root"]
54 54
       @rvm          = yaml["rvm"]
  55
+      @rbenv        = yaml["rbenv"]
55 56
       @pre          = build_command(yaml["pre"])
56 57
       @tabs         = []
57 58
       @socket_name  = yaml['socket_name']
@@ -103,8 +104,12 @@ def ensure_list(value)
103 104
 
104 105
     def build_command(value, rvm_prepend=true)
105 106
       commands = ensure_list(value)
106  
-      if @rvm && rvm_prepend
107  
-        commands.unshift "rvm use #{@rvm}"
  107
+      if rvm_prepend
  108
+        if @rbenv
  109
+          commands.unshift "rbenv shell #{@rbenv}"
  110
+        elsif @rvm
  111
+          commands.unshift "rvm use #{@rvm}"
  112
+        end
108 113
       end
109 114
       commands.join ' && '
110 115
     end
1  spec/spec_helper.rb
@@ -8,6 +8,7 @@
8 8
 Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
9 9
 
10 10
 SAMPLE_CONFIG = File.join(File.dirname(__FILE__), '..', 'lib', 'tmuxinator', 'assets', 'sample.yml')
  11
+RBENV_SAMPLE_CONFIG = File.join(File.dirname(__FILE__), '..', 'lib', 'tmuxinator', 'assets', 'rbenv_sample.yml')
11 12
 
12 13
 RSpec.configure do |config|
13 14
 
18  spec/tmuxinator_spec.rb
@@ -59,4 +59,22 @@
59 59
     specify{ third_tab.panes.should be_an Array }
60 60
     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!'"}
61 61
   end
  62
+  
  63
+  context "with rbenv configured" do
  64
+    before do
  65
+      subject.file_path = RBENV_SAMPLE_CONFIG
  66
+    end
  67
+   
  68
+    its(:rbenv){ should eql '1.9.2-p290' }
  69
+   
  70
+    let(:first_tab){ subject.tabs[0] }
  71
+   
  72
+    it "should prepend each pane with the rbenv string" do
  73
+      first_tab.panes.map{|p| p.split(/ && /)[0] }.should eql ["rbenv shell 1.9.2-p290"] * 3
  74
+    end
  75
+ 
  76
+    let(:second_tab){ subject.tabs[1] }
  77
+    specify{ second_tab.name.should eql "shell" }
  78
+    specify{ second_tab.command.should eql "rbenv shell 1.9.2-p290 && git pull"}
  79
+  end
62 80
 end
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.