mucks 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: 38eb64d038ea93eb7532952786c999d4738ee97b
4
- data.tar.gz: 81ffe012ad7de98bf0c9352d30e4eda8b59c2f3b
3
+ metadata.gz: 414ab8ed231624b92174422bf3e3ad15a41b9fe2
4
+ data.tar.gz: 8766366c06a2f384aaff95e699741b4b8c94e950
5
5
  SHA512:
6
- metadata.gz: 824084cbb3f3ba00c791dca997afdd40b16ac03766e916b52dbe92c96dab1586c4996cf0e585bb786001ad01f061a6f9f58662b240d4f51ea8a144438176543e
7
- data.tar.gz: 471b055ad323f73cbc239e7e450d15d97ae19ecbf6aa988c9aa44e58afc16d347e05a419ada238139298dbf0a4a061e72b173f0cf0218f50e0748561607fe6da
6
+ metadata.gz: d6384296736c1f701aacbe542087ca0e106b18f614b2f6190fe065a5fb6b35b6ff4bcc96170dca04321778e582da05211e0e96650a8064310d653e8b480d144a
7
+ data.tar.gz: add43d9dd33bda9a838e9bb0d24b57e922a014c5c461e9a3416fb4489cde75d4e1f858dc2414b8b4dfcf55bc3f797b0f906d2534dc2833bbc8f8739846696607
@@ -1,2 +1 @@
1
- �/.�Hh���9z*�bB�u�S�,m���ɊJ���qX��s�zM��՚..Oy��f ���z!��<;�@ӊ�Q�(�'�.������-�u],m>
2
- �l��E��=a�tI����X9+��9}��2>�E��`h .M�o�XI1�"�}x��X�͸u���f��`Z�?~Hَ-?$˘�&�N�Ȉ�)�u���V4Zo>����<Q��}�I�9�z[�1�a�I0@̌��D*S܂���<�?���
1
+ ݪ��hM��`'��.�x7wy3z����edeLb�����Nj��˳�1>.�1��|�� "�j"�kڔ��^����{è�Y8��>�Ėu�(��Ħ��Vp&�p��CW���qH(_��������
data.tar.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -80,6 +80,25 @@ but `mucks` references `hg_layout`, which in turn references `base`.
80
80
  These will all get interpolated when it is time to run the commands.
81
81
  `mucks all -n` would show the exact commands that would be executed.
82
82
 
83
+ ### set_path
84
+
85
+ This should only be useful when using tmux under cygwin.
86
+ Linux-based operating systems honor the options
87
+ that set the path for new sessions/windows
88
+
89
+ There is a special `set_path` command that will be replaced
90
+ with the following command:
91
+
92
+ tmux send-keys 'cd "[session_path]"' C-m
93
+
94
+ where `session_path` is the path associated with the session
95
+ that is being started.
96
+
97
+ A specific path may be used (instead of the session path)
98
+ by simply including it after the `set_path` command.
99
+
100
+ All paths will be wrapped with quotes as shown above.
101
+
83
102
 
84
103
  ## Running
85
104
 
@@ -127,6 +127,7 @@ module Mucks
127
127
 
128
128
  class SessionElement
129
129
  attr_reader :name, :path, :layout
130
+
130
131
  def initialize(name, session)
131
132
  @name = name
132
133
  @path = File.expand_path(session['path'])
@@ -206,10 +207,42 @@ module Mucks
206
207
  end
207
208
 
208
209
  def configure(session)
209
- layout = @layout_config[session.layout]
210
+ layout = layout_for(session)
210
211
  layout.each do |command|
211
- Executor.run command
212
+ Executor.run command, session
213
+ end
214
+ end
215
+
216
+ def layout_for(session)
217
+ layout = []
218
+ @layout_config[session.layout].each do |command|
219
+ if set_path?(command)
220
+ layout << parse_path(session, command)
221
+ else
222
+ layout << command
223
+ end
224
+ end
225
+ layout
226
+ end
227
+
228
+ def set_path?(command)
229
+ command.downcase == 'set_path' || command.downcase =~ /^set_path /
230
+ end
231
+
232
+ def parse_path(session, command)
233
+ path = command.gsub(/set_path */i, '')
234
+
235
+ if path.empty?
236
+ path = session.path
237
+ else
238
+ path = File.expand_path(path)
212
239
  end
240
+
241
+ tmux_chdir path
242
+ end
243
+
244
+ def tmux_chdir(path)
245
+ "tmux send-keys 'cd \"#{path}\"' C-m"
213
246
  end
214
247
 
215
248
  def validate_configs
@@ -269,7 +302,7 @@ module Mucks
269
302
 
270
303
  module Executor
271
304
  extend self
272
- def run(command)
305
+ def run(command, session = nil)
273
306
  puts command if Config.verbose || Config.dry_run
274
307
  `#{command}` unless Config.dry_run
275
308
  $?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mucks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Herrick
@@ -30,7 +30,7 @@ cert_chain:
30
30
  dFfJVAFuyqXRLmrl1YroL9qLu8nKUUiKEcrRbc44Bd84Ti0VdHms+c7SZXqW+VUV
31
31
  kMsvl643w+TJ2BmsFnWZ4JMvHdZ8oQ==
32
32
  -----END CERTIFICATE-----
33
- date: 2014-08-09 00:00:00.000000000 Z
33
+ date: 2014-10-20 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: cane
metadata.gz.sig CHANGED
Binary file