muxify 0.1.12 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56167a6ae12faed56bee89852ed0e97297d1bb84d6a38f98060c5df1fb5fea23
4
- data.tar.gz: 5ab6bea4d7d3906e4f9317e138a24809885c4ea79a250999804b6f9dd3436f90
3
+ metadata.gz: 99b06fb29cb0313ee692a84da4cfa068931256fd8e19325c3431e45463d4ef76
4
+ data.tar.gz: ebfe044c5cd37f1f62574fd289a2ec0038ee56ab34f2eb14a80fe0ea6c704827
5
5
  SHA512:
6
- metadata.gz: 5c9c7d5bd6c246e676caf4bc0823b01b85ab87a8b5dc11374d8169dfa8e595da6ae2417c44d360466f1229e8b0d52d55685f34ee338d00793cfb3a9ba3e16304
7
- data.tar.gz: e4a030588dc175bbc4975dd0b18edeaa84e43244c682a6fff0ee78526bd043ac9421aed48f13e4f8afccb9df2a2a173c36fbc6c91eb851c99f735f16a0d64217
6
+ metadata.gz: 1fcf84278243026a0e7c9e5b80cb31924172f1ee3300da85641c174cf768f3183de26aa4c40aacfdf793049a47b4a5f8d5bd46a3a7cdf2b54607d12431628f3e
7
+ data.tar.gz: 97a6fceaf5887c62cae38a8919bdd35d43aa59ff1b0e5af0119e3ce953b9d665247fae166b9f289d8e39e79eddb0bc3f38b5fa57683c15abd2c39e77b69f351c
@@ -7,14 +7,13 @@ module Muxify
7
7
  DEFAULT_CUSTOM_CONFIG_PATH = File.join(ENV["HOME"], ".muxifyrc")
8
8
  private_constant :DEFAULT_CUSTOM_CONFIG_PATH
9
9
 
10
- def self.call(*args)
11
- new(*args).to_yaml
10
+ def self.call(path, **kwargs)
11
+ new(path, **kwargs).to_yaml
12
12
  end
13
13
 
14
- def initialize(root, name: nil, custom_config_path: nil)
14
+ def initialize(root, name: nil)
15
15
  @root = File.expand_path(root)
16
16
  @name = name || File.basename(@root)
17
- @custom_config_path = custom_config_path
18
17
  end
19
18
 
20
19
  def to_yaml
@@ -23,7 +22,7 @@ module Muxify
23
22
 
24
23
  private
25
24
 
26
- attr_reader :root, :name, :custom_config_path
25
+ attr_reader :root, :name
27
26
 
28
27
  def config
29
28
  {
@@ -34,11 +33,15 @@ module Muxify
34
33
  end
35
34
 
36
35
  def windows
37
- Windows.new(root).all.tap do |windows|
36
+ windows = Windows.new(root).all.tap do |windows|
38
37
  custom_windows.each do |name, command|
39
38
  windows << {name => command}
40
39
  end
41
40
  end
41
+
42
+ windows
43
+ .each_with_object({}) { |window, result| result[window.keys.first] = window.values.first }
44
+ .each_with_object([]) { |(k, v), result| result << {k => v} }
42
45
  end
43
46
 
44
47
  def custom_windows
@@ -54,7 +57,6 @@ module Muxify
54
57
  [
55
58
  DEFAULT_CUSTOM_CONFIG_PATH,
56
59
  project_custom_config_path,
57
- custom_config_path
58
60
  ].compact.uniq.select(&File.method(:exist?))
59
61
  end
60
62
 
@@ -95,7 +97,7 @@ module Muxify
95
97
  end
96
98
 
97
99
  def git?
98
- directory?(".git")
100
+ system("git rev-parse &>/dev/null")
99
101
  end
100
102
 
101
103
  def editor
@@ -123,7 +125,7 @@ module Muxify
123
125
  [
124
126
  {"db" => "rails db"},
125
127
  {"console" => "rails console"},
126
- {"server" => File.expand_path("../../bin/rails_server_with_puma_dev", __dir__)}
128
+ {"server" => File.join(Muxify.root, "bin/rails_server_with_puma_dev")},
127
129
  ]
128
130
  end
129
131
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Muxify
4
- VERSION = "0.1.12"
4
+ VERSION = "0.2.0"
5
5
  end
data/lib/muxify.rb CHANGED
@@ -2,3 +2,9 @@
2
2
 
3
3
  require "muxify/cli"
4
4
  require "muxify/version"
5
+
6
+ module Muxify
7
+ def self.root
8
+ File.expand_path("..", __dir__)
9
+ end
10
+ 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.12
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zubin Henner
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-22 00:00:00.000000000 Z
11
+ date: 2023-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- description:
97
+ description:
98
98
  email:
99
99
  - zubin@users.noreply.github.com
100
100
  executables:
@@ -124,7 +124,7 @@ files:
124
124
  homepage: https://github.com/zubin/muxify
125
125
  licenses: []
126
126
  metadata: {}
127
- post_install_message:
127
+ post_install_message:
128
128
  rdoc_options: []
129
129
  require_paths:
130
130
  - lib
@@ -139,8 +139,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
141
  requirements: []
142
- rubygems_version: 3.0.8
143
- signing_key:
142
+ rubygems_version: 3.3.7
143
+ signing_key:
144
144
  specification_version: 4
145
145
  summary: Simple tmux project config
146
146
  test_files: []