tweemux 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/tweemux/action/at.rb +2 -15
 - data/lib/tweemux/action/on.rb +25 -1
 - data/lib/tweemux/version.rb +1 -1
 - data/test/tweemux/action/on_test.rb +8 -0
 - metadata +2 -2
 
    
        data/lib/tweemux/action/at.rb
    CHANGED
    
    | 
         @@ -1,15 +1,2 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
                host, port = args
         
     | 
| 
       4 
     | 
    
         
            -
                cmd = 'ssh', host
         
     | 
| 
       5 
     | 
    
         
            -
                if port
         
     | 
| 
       6 
     | 
    
         
            -
                  cmd.push '-p'+port
         
     | 
| 
       7 
     | 
    
         
            -
                  port_parens = " (on port #{port})"
         
     | 
| 
       8 
     | 
    
         
            -
                end
         
     | 
| 
       9 
     | 
    
         
            -
                forced_path_for_osx_people = 'PATH=/usr/local/bin:/usr/bin'
         
     | 
| 
       10 
     | 
    
         
            -
                explained_run cmd + [
         
     | 
| 
       11 
     | 
    
         
            -
                  '-t', forced_path_for_osx_people,
         
     | 
| 
       12 
     | 
    
         
            -
                  'tmux', '-2uS', Tweemux::SOCK, 'attach',
         
     | 
| 
       13 
     | 
    
         
            -
                ], "Connect to #{host}#{port_parens}, demand a pty, then attach to session"
         
     | 
| 
       14 
     | 
    
         
            -
              end
         
     | 
| 
       15 
     | 
    
         
            -
            end
         
     | 
| 
      
 1 
     | 
    
         
            +
            require 'tweemux/action/on'
         
     | 
| 
      
 2 
     | 
    
         
            +
            class Tweemux::Action::At < Tweemux::Action::On; end
         
     | 
    
        data/lib/tweemux/action/on.rb
    CHANGED
    
    | 
         @@ -1 +1,25 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            class Tweemux::Action::On < Tweemux::Action 
     | 
| 
      
 1 
     | 
    
         
            +
            class Tweemux::Action::On < Tweemux::Action
         
     | 
| 
      
 2 
     | 
    
         
            +
              def run args
         
     | 
| 
      
 3 
     | 
    
         
            +
                host, port, *rest = args
         
     | 
| 
      
 4 
     | 
    
         
            +
                cmd = 'ssh', host
         
     | 
| 
      
 5 
     | 
    
         
            +
                if port
         
     | 
| 
      
 6 
     | 
    
         
            +
                  cmd.push '-p'+port
         
     | 
| 
      
 7 
     | 
    
         
            +
                  port_parens = " (on port #{port})"
         
     | 
| 
      
 8 
     | 
    
         
            +
                end
         
     | 
| 
      
 9 
     | 
    
         
            +
                desc = ["Connect to #{host}#{port_parens}"]
         
     | 
| 
      
 10 
     | 
    
         
            +
                forced_path_for_osx_people = 'PATH=/usr/local/bin:/usr/bin'
         
     | 
| 
      
 11 
     | 
    
         
            +
                cmd.concat [ '-t', forced_path_for_osx_people ]
         
     | 
| 
      
 12 
     | 
    
         
            +
                desc.push 'demand a pty'
         
     | 
| 
      
 13 
     | 
    
         
            +
                cmd.concat [ 'tmux', '-2uS', Tweemux::SOCK ]
         
     | 
| 
      
 14 
     | 
    
         
            +
                desc.push 'Run tmux (with 256 colors, UTF-8, on the shared socket'
         
     | 
| 
      
 15 
     | 
    
         
            +
                if rest.empty?
         
     | 
| 
      
 16 
     | 
    
         
            +
                  cmd.push 'attach'
         
     | 
| 
      
 17 
     | 
    
         
            +
                  desc.push 'attach to existing session'
         
     | 
| 
      
 18 
     | 
    
         
            +
                else
         
     | 
| 
      
 19 
     | 
    
         
            +
                  cmd.concat rest
         
     | 
| 
      
 20 
     | 
    
         
            +
                  desc.push rest.join ' '
         
     | 
| 
      
 21 
     | 
    
         
            +
                end
         
     | 
| 
      
 22 
     | 
    
         
            +
                description = desc.join ', '
         
     | 
| 
      
 23 
     | 
    
         
            +
                explained_run cmd, description
         
     | 
| 
      
 24 
     | 
    
         
            +
              end
         
     | 
| 
      
 25 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/tweemux/version.rb
    CHANGED
    
    
| 
         @@ -14,3 +14,11 @@ class Tweemux::Action::OnImplicitPortTest  < MiniTest::Unit::TestCase 
     | 
|
| 
       14 
14 
     | 
    
         
             
                [ %w(ssh sharpsaw.org -t PATH=/usr/local/bin:/usr/bin tmux -2uS /tmp/tweemux.sock attach) ]
         
     | 
| 
       15 
15 
     | 
    
         
             
              end
         
     | 
| 
       16 
16 
     | 
    
         
             
            end
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
            class Tweemux::Action::PassThruIsCoolForOnTest  < MiniTest::Unit::TestCase
         
     | 
| 
      
 19 
     | 
    
         
            +
              include TweemuxActionHelper
         
     | 
| 
      
 20 
     | 
    
         
            +
              def argv; %w'on sharpsaw.org 22 -CC a' end
         
     | 
| 
      
 21 
     | 
    
         
            +
              def expected_commands
         
     | 
| 
      
 22 
     | 
    
         
            +
                [ %w(ssh sharpsaw.org -p22 -t PATH=/usr/local/bin:/usr/bin tmux -2uS /tmp/tweemux.sock -CC a) ]
         
     | 
| 
      
 23 
     | 
    
         
            +
              end
         
     | 
| 
      
 24 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: tweemux
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.4.0
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -11,7 +11,7 @@ authors: 
     | 
|
| 
       11 
11 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       12 
12 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       13 
13 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       14 
     | 
    
         
            -
            date: 2013-03- 
     | 
| 
      
 14 
     | 
    
         
            +
            date: 2013-03-17 00:00:00.000000000 Z
         
     | 
| 
       15 
15 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       16 
16 
     | 
    
         
             
            description: ! 'For Remote Pair Programming: A handy script to create-or-join a world-readable
         
     | 
| 
       17 
17 
     | 
    
         
             
              tmux session
         
     |