muxify 0.1.8 → 0.1.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 298d8e881539662ac5af8d1c60d498d0e74e67ed0ba23193654ff0653eeaf26d
4
- data.tar.gz: bfe249a4affba9e9a2193448eba50475bcaa7bcd105590095f576fe28d65bd62
3
+ metadata.gz: 364357540e766dbc1377febee98052f4c0cfebce953bbb388d68c3e6fbac79b7
4
+ data.tar.gz: be79765ed65d4f32db46eb83ef68c2e491fb63f07a7d15c78de662119e56fe97
5
5
  SHA512:
6
- metadata.gz: cee3dcbed021eb83eb1d20f3af0eb022829f96fae6ae564274d3cb0c7bfe105c42afa360bd8ce1585e15caea3df6cb835997b9b086f06760a3ec5a5cd6332f63
7
- data.tar.gz: c7871e74b4df305a3c7a3428ba49041fd128cd5b7bc83c6101f9ef44da63bddbd9ae21bc42433fe5c1ac86a04e91723620cb4ab38cf2f25020176ee2a0d092dc
6
+ metadata.gz: eb77c3e0ad0d372471cd3291a99079497e2da1c6b35cc52f80e62b00fedac77ada2d7db2cf1ac685752111d6f926dd13f3d1356216874de4c5ccc4097cb3855c
7
+ data.tar.gz: 101b579693df736e9a2f34a121321092f95eb1f5a5ab4b5853ebac6c350bf2fbfa24358ad1776202262bbeb11a9188b073d71c8b97f151a0af2ff1c96aff6f16
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
- --format documentation
2
1
  --color
2
+ --format documentation
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ Layout/SpaceInsideArrayLiteralBrackets:
3
+ EnforcedStyle: no_space
4
+ Layout/SpaceInsideHashLiteralBraces:
5
+ EnforcedStyle: no_space
6
+ Style/Documentation:
7
+ Enabled: false
8
+ Style/StringLiterals:
9
+ Enabled: false
10
+ Style/TrailingCommaInArguments:
11
+ EnforcedStyleForMultiline: comma
12
+ Style/TrailingCommaInArrayLiteral:
13
+ EnforcedStyleForMultiline: comma
14
+ Style/TrailingCommaInHashLiteral:
15
+ EnforcedStyleForMultiline: comma
data/.travis.yml CHANGED
@@ -1,5 +1,10 @@
1
- sudo: false
1
+ ---
2
2
  language: ruby
3
3
  rvm:
4
- - 2.4.1
5
- before_install: gem install bundler -v 1.15.1
4
+ - 2.7
5
+ - 3.0
6
+ deploy:
7
+ provider: rubygems
8
+ on:
9
+ branch: main
10
+ edge: true # opt in to dpl v2
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source "https://rubygems.org"
3
+ source 'https://rubygems.org'
4
4
 
5
5
  # Specify your gem's dependencies in muxify.gemspec
6
6
  gemspec
data/Rakefile CHANGED
@@ -1,8 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
3
+ require 'bundler/gem_tasks'
4
+ require 'rubocop/rake_task'
5
+ require 'rspec/core/rake_task'
5
6
 
7
+ RuboCop::RakeTask.new
6
8
  RSpec::Core::RakeTask.new(:spec)
7
9
 
8
- task :default => :spec
10
+ task default: %i[rubocop spec]
data/bin/console CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- require "bundler/setup"
4
- require "muxify"
4
+ require 'bundler/setup'
5
+ require 'muxify'
5
6
 
6
7
  # You can add fixtures and/or initialization code here to make experimenting
7
8
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +11,5 @@ require "muxify"
10
11
  # require "pry"
11
12
  # Pry.start
12
13
 
13
- require "irb"
14
+ require 'irb'
14
15
  IRB.start(__FILE__)
data/bin/muxify CHANGED
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- if File.directory? File.expand_path('../../.git', __FILE__)
4
- $:.unshift File.expand_path('../../lib', __FILE__)
5
- end
4
+ $LOAD_PATH.unshift File.expand_path('../lib', __dir__) if File.directory? File.expand_path('../.git', __dir__)
6
5
 
7
6
  require 'bundler/setup'
8
7
  require 'muxify'
data/bin/rake ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rake' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require 'pathname'
12
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path('bundle', __dir__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require 'rubygems'
27
+ require 'bundler/setup'
28
+
29
+ load Gem.bin_path('rake', 'rake')
data/bin/rspec ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rspec' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require 'pathname'
12
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path('bundle', __dir__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require 'rubygems'
27
+ require 'bundler/setup'
28
+
29
+ load Gem.bin_path('rspec-core', 'rspec')
data/bin/rubocop ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rubocop' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require 'pathname'
12
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path('bundle', __dir__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require 'rubygems'
27
+ require 'bundler/setup'
28
+
29
+ load Gem.bin_path('rubocop', 'rubocop')
@@ -11,9 +11,10 @@ module Muxify
11
11
  new(*args).to_yaml
12
12
  end
13
13
 
14
- def initialize(root, name: nil)
14
+ def initialize(root, name: nil, custom_config_path: CUSTOM_CONFIG_PATH)
15
15
  @root = File.expand_path(root)
16
16
  @name = name || File.basename(@root)
17
+ @custom_config_path = custom_config_path
17
18
  end
18
19
 
19
20
  def to_yaml
@@ -22,7 +23,7 @@ module Muxify
22
23
 
23
24
  private
24
25
 
25
- attr_reader :root, :name
26
+ attr_reader :root, :name, :custom_config_path
26
27
 
27
28
  def config
28
29
  {
@@ -41,9 +42,18 @@ module Muxify
41
42
  end
42
43
 
43
44
  def custom_windows
44
- return {} unless File.exist?(CUSTOM_CONFIG_PATH)
45
+ return {} unless custom_config.key?('windows')
45
46
 
46
- YAML.load_file(CUSTOM_CONFIG_PATH).dig(name, 'windows') || {}
47
+ YAML.load_file(custom_config_path).dig(name, 'windows') || {}
48
+ end
49
+
50
+ def custom_config
51
+ return {} unless File.exist?(custom_config_path)
52
+
53
+ yaml = YAML.load_file(custom_config_path)
54
+ return {} unless yaml
55
+
56
+ yaml.fetch(name, {})
47
57
  end
48
58
 
49
59
  class Windows
@@ -56,7 +66,6 @@ module Muxify
56
66
  *shell,
57
67
  *editor,
58
68
  *logs,
59
- *foreman,
60
69
  *rails,
61
70
  *elixir_non_phoenix,
62
71
  *phoenix,
@@ -74,11 +83,9 @@ module Muxify
74
83
  end
75
84
 
76
85
  def init_shell
77
- if git?
78
- 'git fetch; git status'
79
- else
80
- 'echo "Not a git repository."'
81
- end
86
+ return 'echo "Not a git repository."' unless git?
87
+
88
+ 'git fetch; git status'
82
89
  end
83
90
 
84
91
  def git?
@@ -104,18 +111,6 @@ module Muxify
104
111
  File.truncate(path, 0)
105
112
  end
106
113
 
107
- def foreman
108
- return [] unless foreman?
109
-
110
- [{'foreman' => <<-SH.strip}]
111
- ps aux | grep 'unicorn_rails master' | awk '{print $2}' | xargs kill; foreman start
112
- SH
113
- end
114
-
115
- def foreman?
116
- # TODO?
117
- end
118
-
119
114
  def rails
120
115
  return [] unless rails?
121
116
 
data/lib/muxify/cli.rb CHANGED
@@ -6,17 +6,17 @@ require 'muxify/linker'
6
6
 
7
7
  module Muxify
8
8
  class CLI < Thor
9
- desc "add", "Adds tmuxinator config for current (or supplied) path"
9
+ desc 'add', 'Adds tmuxinator config for current (or supplied) path'
10
10
  def add(root = Dir.pwd)
11
- Muxify::Linker.(root: root)
11
+ Muxify::Linker.call(root: root)
12
12
  end
13
13
 
14
- desc "debug", "Prints tmuxinator config of current (or supplied) path to stdout"
14
+ desc 'debug', 'Prints tmuxinator config of current (or supplied) path to stdout'
15
15
  def debug(root = Dir.pwd)
16
- puts Muxify::Builder.(root)
16
+ puts Muxify::Builder.call(root)
17
17
  end
18
18
 
19
- desc "stop", "Kills tmux session"
19
+ desc 'stop', 'Kills tmux session'
20
20
  def stop(name = File.basename(Dir.pwd))
21
21
  Kernel.system("tmux kill-session -t #{name}")
22
22
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Muxify
4
- VERSION = '0.1.8'
4
+ VERSION = '0.1.9'
5
5
  end
data/muxify.gemspec CHANGED
@@ -7,10 +7,10 @@ require 'muxify/version'
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = 'muxify'
9
9
  spec.version = Muxify::VERSION
10
- spec.authors = ["Zubin Henner"]
10
+ spec.authors = ['Zubin Henner']
11
11
  spec.email = ['zubin@users.noreply.github.com']
12
12
 
13
- spec.summary = "Simple tmux project config"
13
+ spec.summary = 'Simple tmux project config'
14
14
  spec.homepage = 'https://github.com/zubin/muxify'
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.bindir = 'bin'
20
20
  spec.executables = ['muxify']
21
21
  spec.require_paths = ['lib']
22
+ spec.required_ruby_version = '>= 2.7.0'
22
23
 
23
24
  spec.add_dependency 'thor'
24
25
  spec.add_dependency 'tmuxinator'
@@ -26,4 +27,5 @@ Gem::Specification.new do |spec|
26
27
  spec.add_development_dependency 'bundler'
27
28
  spec.add_development_dependency 'rake'
28
29
  spec.add_development_dependency 'rspec'
30
+ spec.add_development_dependency 'rubocop'
29
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muxify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zubin Henner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-18 00:00:00.000000000 Z
11
+ date: 2021-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  description:
84
98
  email:
85
99
  - zubin@users.noreply.github.com
@@ -90,6 +104,7 @@ extra_rdoc_files: []
90
104
  files:
91
105
  - ".gitignore"
92
106
  - ".rspec"
107
+ - ".rubocop.yml"
93
108
  - ".travis.yml"
94
109
  - Gemfile
95
110
  - README.md
@@ -97,6 +112,9 @@ files:
97
112
  - bin/console
98
113
  - bin/muxify
99
114
  - bin/rails_server_with_puma_dev
115
+ - bin/rake
116
+ - bin/rspec
117
+ - bin/rubocop
100
118
  - bin/setup
101
119
  - lib/muxify.rb
102
120
  - lib/muxify/builder.rb
@@ -115,14 +133,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
133
  requirements:
116
134
  - - ">="
117
135
  - !ruby/object:Gem::Version
118
- version: '0'
136
+ version: 2.7.0
119
137
  required_rubygems_version: !ruby/object:Gem::Requirement
120
138
  requirements:
121
139
  - - ">="
122
140
  - !ruby/object:Gem::Version
123
141
  version: '0'
124
142
  requirements: []
125
- rubygems_version: 3.1.2
143
+ rubygems_version: 3.0.8
126
144
  signing_key:
127
145
  specification_version: 4
128
146
  summary: Simple tmux project config