Skip to content

Commit

Permalink
Merge branch 'master' into readme-base-index
Browse files Browse the repository at this point in the history
  • Loading branch information
ethagnawl authored Jun 14, 2018
2 parents 16e1738 + 03c8bab commit 1960f94
Show file tree
Hide file tree
Showing 28 changed files with 630 additions and 146 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ tmp
db
vendor/
tags
.env*
.env
26 changes: 12 additions & 14 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Style/CaseIndentation:
Description: Indentation of when in a case/when/[else/]end.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-when-to-case
Enabled: true
IndentWhenRelativeTo: case
EnforcedStyle: case
SupportedStyles:
- case
- end
Expand Down Expand Up @@ -374,9 +374,6 @@ Style/SpaceAroundBlockParameters:
Description: Checks the spacing inside and after block parameters pipes.
Enabled: true
EnforcedStyleInsidePipes: no_space
SupportedStyles:
- space
- no_space
Style/SpaceAroundEqualsInParameterDefault:
Description: Checks that the equals signs in parameter default assignments have
or don't have surrounding space depending on configuration.
Expand Down Expand Up @@ -504,6 +501,7 @@ Metrics/LineLength:
- http
- https
Exclude:
- tmuxinator.gemspec
- lib/tmuxinator/window.rb
- spec/lib/tmuxinator/window_spec.rb
Metrics/MethodLength:
Expand All @@ -525,10 +523,14 @@ Metrics/PerceivedComplexity:
Max: 7
Metrics/BlockLength:
Exclude:
- tmuxinator.gemspec
- lib/tmuxinator/cli.rb
- spec/factories/**/*.rb
- spec/matchers/**/*.rb
- spec/**/*_spec.rb
Style/InverseMethods:
Exclude:
- lib/tmuxinator/project.rb
Lint/PercentStringArray:
Exclude:
- lib/tmuxinator/cli.rb
Expand All @@ -543,17 +545,11 @@ Lint/AssignmentInCondition:
Lint/EndAlignment:
Description: Align ends correctly.
Enabled: true
AlignWith: keyword
SupportedStyles:
- keyword
- variable
EnforcedStyleAlignWith: keyword
Lint/DefEndAlignment:
Description: Align ends corresponding to defs correctly.
Enabled: true
AlignWith: start_of_line
SupportedStyles:
- start_of_line
- def
EnforcedStyleAlignWith: start_of_line
Style/InlineComment:
Description: Avoid inline comments.
Enabled: false
Expand Down Expand Up @@ -717,7 +713,7 @@ Style/LineEndConcatenation:
Description: Use \ instead of + or << to concatenate two string literals at line
end.
Enabled: false
Style/MethodCallParentheses:
Style/MethodCallWithoutArgsParentheses:
Description: Do not use parentheses for method calls with no arguments.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-args-no-parens
Enabled: true
Expand Down Expand Up @@ -876,6 +872,8 @@ Style/UnneededPercentQ:
Description: Checks for %q/%Q when single quotes or double quotes would do.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q
Enabled: true
Exclude:
- tmuxinator.gemspec
# Style/UnneededPercentX:
# Description: Checks for %x when `` would do.
# StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-x
Expand Down Expand Up @@ -935,7 +933,7 @@ Lint/EnsureReturn:
Description: Do not use return in an ensure block.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-return-ensure
Enabled: true
Lint/Eval:
Security/Eval:
Description: The use of eval represents a serious security risk.
Enabled: true
Lint/HandleExceptions:
Expand Down
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
language: ruby
rvm:
- "2.2.8"
- "2.3.5"
- "2.4.2"
- "2.2.9"
- "2.3.6"
- "2.4.3"
- "2.5.0"
env:
- TMUX_VERSION=master
- TMUX_VERSION=2.7
- TMUX_VERSION=2.6
- TMUX_VERSION=2.5
- TMUX_VERSION=2.4
- TMUX_VERSION=2.3
- TMUX_VERSION=2.2
- TMUX_VERSION=2.1
Expand Down
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,45 @@
window-base-index options. These options can be set independently of one
another now that #542 and #543 are merged.

## 0.11.3
### Misc
- replace j3rn's email with ethagnawl's in COC
- use correct paths in generated config file comment (#440)

### Bugfixes
- fix "wrong namespace" RuboCop warnings (#620)
- fix [#431](https://github.com/tmuxinator/tmuxinator/issues/431), where Thor-based commands (e.g. "-v", "help") were failing

## 0.11.2
### Bugfixes
- Fix [#555](https://github.com/tmuxinator/tmuxinator/issues/555), restoring
`on_project_exit` hook behaviour (same as deprecated `post`)

## 0.11.1
### Misc
- Add support for tmux 2.7 (#611)
- Fix load order when multiple versions of tmuxinator are installed (#603)

## 0.11.0
### Misc
- Make Config#xdg comment reference correct XDG variable and include example of
degenerate case (#597)
- Introduce factory_bot, to replace factory_girl, which was renamed
recently.
- Add Ruby 2.5 to the TravisCI test matrix and bump patch level of existing Rubies
(2.2, 2.3, 2.4)
### New Features
- Add optional `--project-config=...` parameter to `tmuxinator start` (#595)

## 0.10.1
- Handle emojis in project names (#564)
- Fix remaining sites where the base-index option (for windows) was incorrectly
used in place of the pane-base-index option.
- Treat 'tmux master' as an arbitrarily high version and display a deprecation
warning for unsupported tmux versions (#524, #570)
- Add tmux 2.4, 2.5, and 2.6 to the TravisCI test matrix
- Updates `rubocop` to resolve security vulnerability

## 0.10.0
- Fix a bug causing the user's global pane-base-index setting not to be
respected
Expand Down
38 changes: 29 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,25 @@ root: ~/
# Optional. tmux socket
# socket_name: foo

# Runs before everything. Use it to start daemons etc.
# pre: sudo /etc/rc.d/mysqld start
# Note that the pre and post options have been deprecated and will be replaced by
# project hooks.

# Project hooks

# Runs on project start, always
#on_project_start: command

# Run on project start, the first time
# on_project_first_start: command

# Run on project start, after the first time
# on_project_restart: command

# Run on project exit ( detaching from tmux session )
# on_project_exit: command

# Run on project stop
# on_project_stop: command

# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions.
# pre_window: rbenv shell 2.0.0-p247
Expand Down Expand Up @@ -156,7 +173,9 @@ windows:

The layout setting gets handed down to tmux directly, so you can choose from
one of [the five standard layouts](http://manpages.ubuntu.com/manpages/precise/en/man1/tmux.1.html#contenttoc6)
or [specify your own](http://stackoverflow.com/a/9976282/183537).
or [specify your own](http://stackoverflow.com/a/9976282/183537).

**Please note the indentation here is deliberate. YAML's indentation rules can be confusing, so if your config isn't working as expected, please check the indentation.** For a more detailed explanation of _why_ YAML behaves this way, see [this](https://stackoverflow.com/questions/50594758/why-isnt-two-spaced-yaml-parsed-like-four-spaced-yaml/50600253#50600253) Stack Overflow question.

## Interpreter Managers & Environment Variables

Expand All @@ -168,18 +187,17 @@ pre_window: rbenv shell 2.0.0-p247

These command(s) will run before any subsequent commands in all panes and windows.

## Custom attachment and post commands
## Custom session attachment

You can set tmuxinator to skip auto-attaching to the session by using the `attach` option.

```yaml
attach: false
```

You can also run arbitrary commands by using the `post` option. This is useful if you want to attach to tmux in a non-standard way (e.g. for a program that makes use of tmux control mode like iTerm2).
If you want to attach to tmux in a non-standard way (e.g. for a program that makes use of tmux control mode like iTerm2), you can run arbitrary commands by using a project hook:

```yaml
post: tmux -CC attach
on_project_start: tmux -CC attach
```

## Passing directly to send-keys
Expand Down Expand Up @@ -252,13 +270,15 @@ root: ~/<%= @settings["workspace"] %>
This will fire up tmux with all the tabs and panes you configured, `start` is aliased to `s`.

```
tmuxinator start [project] -n [name]
tmuxinator start [project] -n [name] -p [project-config]
```
If you use the optional `[name]` argument, it will start a new tmux session with the custom name provided. This is to enable reuse of a project without tmux session name collision.
If there is a `./.tmuxinator.yml` file in the current working directory but not a named project file in `~/.tmuxinator`, tmuxinator will use the local file. This is primarily intended to be used for sharing tmux configurations in complex development environments.
You can provide tmuxinator with a project config file using the optional `[project-config]` argument (e.g. `--project-config=path/to/my-project.yaml` or `-p path/to/my-project.yaml`). This option will override a `[project]` name (if provided) and a local tmuxinator file (if present).
## Shorthand
The [shell completion files](#completion) also include a shorthand alias for tmuxinator that can be used in place of the full name.
Expand Down Expand Up @@ -337,4 +357,4 @@ To contribute, please read the [contributing guide](https://github.com/tmuxinato
## Copyright
Copyright (c) 2010-2017 Allen Bargi, Christopher Chow. See LICENSE for further details.
Copyright (c) 2010-2018 Allen Bargi, Christopher Chow. See LICENSE for further details.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ require "rspec/core/rake_task"
RuboCop::RakeTask.new
RSpec::Core::RakeTask.new

task :test => ["spec", "rubocop"]
task test: ["spec", "rubocop"]
13 changes: 2 additions & 11 deletions bin/tmuxinator
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
#!/usr/bin/env ruby
$: << File.expand_path("../../lib/", __FILE__)
$:.unshift File.expand_path("../../lib/", __FILE__)

require "thor"
require "tmuxinator"

name = ARGV[0] || nil

if ARGV.empty? && Tmuxinator::Config.local?
Tmuxinator::Cli.new.local
elsif name && !Tmuxinator::Cli::COMMANDS.keys.include?(name.to_sym) &&
Tmuxinator::Config.exists?(name)
Tmuxinator::Cli.new.start(name, *ARGV.drop(1))
else
Tmuxinator::Cli.start
end
Tmuxinator::Cli.bootstrap ARGV
11 changes: 6 additions & 5 deletions code_of_conduct.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at jonarnett90@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
reported by contacting the project team at pdoherty+tmuxinator@protonmail.com.
All complaints will be reviewed and investigated and will result in a response
that is deemed necessary and appropriate to the circumstances. The project team
is obligated to maintain confidentiality with regard to the reporter of an
incident. Further details of specific enforcement policies may be posted
separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
Expand Down
21 changes: 18 additions & 3 deletions lib/tmuxinator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@
require "xdg"
require "yaml"

module Tmuxinator
SUPPORTED_TMUX_VERSIONS = [
1.5,
1.6,
1.7,
1.8,
1.9,
2.0,
2.1,
2.2,
2.3,
2.4,
2.5,
2.6,
2.7
].freeze
end

require "tmuxinator/util"
require "tmuxinator/deprecations"
require "tmuxinator/wemux_support"
Expand All @@ -18,6 +36,3 @@
require "tmuxinator/project"
require "tmuxinator/window"
require "tmuxinator/version"

module Tmuxinator
end
2 changes: 1 addition & 1 deletion lib/tmuxinator/assets/sample.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ~/.tmuxinator/<%= name %>.yml
# <%= path %>

name: <%= name %>
root: ~/
Expand Down
7 changes: 3 additions & 4 deletions lib/tmuxinator/assets/template.erb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ cd <%= root || "." %>
<%- end -%>

<%= post %>
<%- unless attach? -%>
# Run on_project_exit command.
<%= hook_on_project_exit %>
<%- end -%>

# Run on_project_exit command.
<%= hook_on_project_exit %>
Loading

0 comments on commit 1960f94

Please sign in to comment.