tmuxinator 0.6.9 → 0.6.10.pre
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.
- checksums.yaml +4 -4
- data/bin/mux +1 -1
- data/bin/tmuxinator +1 -1
- data/lib/tmuxinator/cli.rb +27 -5
- data/lib/tmuxinator/version.rb +1 -1
- data/spec/lib/tmuxinator/cli_spec.rb +2 -1
- metadata +2 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 7cf9390018701842df43e662ae82659def0a7493
         | 
| 4 | 
            +
              data.tar.gz: 57c891da937c5418bec18526d553fb2e1c6c7953
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: eeabb93033c3714f2fe4778e7c6a1da3b29fa4256163364bf6009807176f422d49233d7a4e61aee6448acb96682f1f1cebdeadef9b262fbc3365d050c684780c
         | 
| 7 | 
            +
              data.tar.gz: 1907c39aab69f71534513707cd437d04cf06c042bf021a0cd5e0b1135bb03fbdca440d00fdabb11a158d7cb6f4e1d40bdea7d4f6c0e922ffb7552478a94b5cde
         | 
    
        data/bin/mux
    CHANGED
    
    | @@ -7,7 +7,7 @@ require "tmuxinator" | |
| 7 7 | 
             
            if ARGV.length == 1
         | 
| 8 8 | 
             
              name = ARGV[0]
         | 
| 9 9 |  | 
| 10 | 
            -
              if Tmuxinator::Cli.new. | 
| 10 | 
            +
              if Tmuxinator::Cli.new.command_hash.keys.include?(name.to_sym)
         | 
| 11 11 | 
             
                Tmuxinator::Cli.start
         | 
| 12 12 | 
             
              elsif Tmuxinator::Config.exists?(name)
         | 
| 13 13 | 
             
                Tmuxinator::Cli.new.start(name)
         | 
    
        data/bin/tmuxinator
    CHANGED
    
    | @@ -7,7 +7,7 @@ require "tmuxinator" | |
| 7 7 | 
             
            if ARGV.length == 1
         | 
| 8 8 | 
             
              name = ARGV[0]
         | 
| 9 9 |  | 
| 10 | 
            -
              if Tmuxinator::Cli.new. | 
| 10 | 
            +
              if Tmuxinator::Cli.new.command_hash.keys.include?(name.to_sym)
         | 
| 11 11 | 
             
                Tmuxinator::Cli.start
         | 
| 12 12 | 
             
              elsif Tmuxinator::Config.exists?(name)
         | 
| 13 13 | 
             
                Tmuxinator::Cli.new.start(name)
         | 
    
        data/lib/tmuxinator/cli.rb
    CHANGED
    
    | @@ -2,19 +2,41 @@ module Tmuxinator | |
| 2 2 | 
             
              class Cli < Thor
         | 
| 3 3 | 
             
                include Tmuxinator::Util
         | 
| 4 4 |  | 
| 5 | 
            -
                attr_reader : | 
| 5 | 
            +
                attr_reader :command_hash
         | 
| 6 6 |  | 
| 7 7 | 
             
                def initialize(*args)
         | 
| 8 8 | 
             
                  super
         | 
| 9 | 
            -
             | 
| 9 | 
            +
             | 
| 10 | 
            +
                  @command_hash = {
         | 
| 11 | 
            +
                    commands: "Lists commands available in tmuxinator",
         | 
| 12 | 
            +
                    completions: "Used for shell completion",
         | 
| 13 | 
            +
                    new: "Create a new project file and open it in your editor",
         | 
| 14 | 
            +
                    open: "Alias of new",
         | 
| 15 | 
            +
                    start: "Start a tmux session using a project's tmuxinator config",
         | 
| 16 | 
            +
                    debug: "Output the shell commands that are generated by tmuxinator",
         | 
| 17 | 
            +
                    copy: "Copy an existing project to a new project and open it in your editor",
         | 
| 18 | 
            +
                    delete: "Deletes given project",
         | 
| 19 | 
            +
                    implode: "Deletes all tmuxinator projects",
         | 
| 20 | 
            +
                    version: "Display installed tmuxinator version",
         | 
| 21 | 
            +
                    doctor: "Look for problems in your configuration"
         | 
| 22 | 
            +
                  }
         | 
| 23 | 
            +
             | 
| 10 24 | 
             
                end
         | 
| 11 25 |  | 
| 12 26 | 
             
                package_name "tmuxinator" unless Gem::Version.create(Thor::VERSION) < Gem::Version.create("0.18")
         | 
| 13 27 |  | 
| 14 28 | 
             
                desc "commands", "Lists commands available in tmuxinator"
         | 
| 15 29 |  | 
| 16 | 
            -
                def commands
         | 
| 17 | 
            -
                   | 
| 30 | 
            +
                def commands(shell = nil)
         | 
| 31 | 
            +
                  out = if shell == "zsh"
         | 
| 32 | 
            +
                    command_hash.map do |command, desc|
         | 
| 33 | 
            +
                      "#{command}:#{desc}"
         | 
| 34 | 
            +
                    end.join("\n")
         | 
| 35 | 
            +
                  else
         | 
| 36 | 
            +
                    command_hash.keys.join("\n")
         | 
| 37 | 
            +
                  end
         | 
| 38 | 
            +
             | 
| 39 | 
            +
                  puts out
         | 
| 18 40 | 
             
                end
         | 
| 19 41 |  | 
| 20 42 | 
             
                desc "completions [arg1 arg2]", "Used for shell completion"
         | 
| @@ -97,7 +119,7 @@ module Tmuxinator | |
| 97 119 | 
             
                      say "Deleted #{project}"
         | 
| 98 120 | 
             
                    end
         | 
| 99 121 | 
             
                  else
         | 
| 100 | 
            -
                    exit! | 
| 122 | 
            +
                    exit!("That file doesn't exist.")
         | 
| 101 123 | 
             
                  end
         | 
| 102 124 | 
             
                end
         | 
| 103 125 |  | 
    
        data/lib/tmuxinator/version.rb
    CHANGED
    
    
| @@ -36,7 +36,7 @@ describe Tmuxinator::Cli do | |
| 36 36 |  | 
| 37 37 | 
             
                it "lists the commands" do
         | 
| 38 38 | 
             
                  out, _ = capture_io { cli.start }
         | 
| 39 | 
            -
                  expect(out).to eq "#{%w(commands  | 
| 39 | 
            +
                  expect(out).to eq "#{%w(commands completions new open start debug copy delete implode version doctor).join("\n")}\n"
         | 
| 40 40 | 
             
                end
         | 
| 41 41 | 
             
              end
         | 
| 42 42 |  | 
| @@ -163,6 +163,7 @@ describe Tmuxinator::Cli do | |
| 163 163 |  | 
| 164 164 | 
             
                context "project doesn't exist" do
         | 
| 165 165 | 
             
                  before do
         | 
| 166 | 
            +
                    allow(Tmuxinator::Config).to receive(:exists?) { false }
         | 
| 166 167 | 
             
                    allow(Thor::LineEditor).to receive_messages(:readline => "y")
         | 
| 167 168 | 
             
                  end
         | 
| 168 169 |  | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: tmuxinator
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.6. | 
| 4 | 
            +
              version: 0.6.10.pre
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Allen Bargi
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2014- | 
| 11 | 
            +
            date: 2014-12-01 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: thor
         | 
| @@ -232,4 +232,3 @@ test_files: | |
| 232 232 | 
             
            - spec/lib/tmuxinator/util_spec.rb
         | 
| 233 233 | 
             
            - spec/lib/tmuxinator/window_spec.rb
         | 
| 234 234 | 
             
            - spec/spec_helper.rb
         | 
| 235 | 
            -
            has_rdoc: 
         |