tmux-erb-parser 0.1.2 → 0.1.3

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: 7da9078d32cc8302a89b36462a0cd9bc9329679e205e8be50cfdc0e839b019e0
4
- data.tar.gz: c3ef1b2b8c8105d7f4a32515853920aabb72f337a009bfae36a2c8840a04f624
3
+ metadata.gz: 5f4710a740b1fb2595955f5a74f957850146d0a85dadef0e6d5c666086c005a1
4
+ data.tar.gz: 9093fc2ff95994ce9dbc596654487c94ce40f837c20a4a2464143c882819f9c7
5
5
  SHA512:
6
- metadata.gz: 7150f31dfd4bef069c6799cc25cdcd28c529eff87746e774f5560eb4a611c69c3306c9c9a15120ffc5e534b1c672c87e96f65846624e452916ddf0703ecc0133
7
- data.tar.gz: 300d0087b6e77ae478d31ddb57d441e68536c61b4f31dbeb2aa1fce560d9fbf55fce66e1da414b4b27db77d44f088fba71d3a7e9d572edfba74f4323efd07d9d
6
+ metadata.gz: 06b12de75b04a6db27c357079d8ef0e7fcdd1ca5e143b6d5165aaf63c301db0c3df2f9f31a3c699b05aa9d17bbdfcadfccc494c642e5cb4b37ce6066d10ad594
7
+ data.tar.gz: 4346861045e56320e10ac419c43438ddddfa8ea2b0070797faacb2042f43eaa3e1dd7eff02c35752f51de1f164843a433e43189ec8b8532ce7048eda0ebbfafd
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Tmux ERB Parser
2
+ [![Gem Version](https://badge.fury.io/rb/tmux-erb-parser.svg)](https://badge.fury.io/rb/tmux-erb-parser)
2
3
  [![Build Status](https://travis-ci.org/epaew/tmux-erb-parser.svg?branch=master)](https://travis-ci.org/epaew/tmux-erb-parser)
4
+ [![Maintainability](https://api.codeclimate.com/v1/badges/a4c67b3c8ba8e555d98f/maintainability)](https://codeclimate.com/github/epaew/tmux-erb-parser/maintainability)
5
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/a4c67b3c8ba8e555d98f/test_coverage)](https://codeclimate.com/github/epaew/tmux-erb-parser/test_coverage)
3
6
 
4
7
  A Tmux plugin to load tmux.conf.erb
5
8
  [What's ERB?](https://ruby-doc.org/stdlib-2.5.1/libdoc/erb/rdoc/ERB.html)
data/bin/tmux-erb-parser CHANGED
@@ -4,5 +4,10 @@
4
4
  $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
5
5
  require 'tmux-erb-parser'
6
6
 
7
+ # limit recursive execution
8
+ command = File.basename(__FILE__)
9
+ processes = `ps ax`.each_line.map { |line| line.split(' ', 5)[4] }
10
+ exit 1 if processes.grep(/\Aruby.+#{command}/).size > 5
11
+
7
12
  cmd = TmuxERBParser::Command.new(ARGV)
8
13
  cmd.run
@@ -74,16 +74,13 @@ module TmuxERBParser
74
74
  def exec_tmux(buf, line)
75
75
  buf << line
76
76
  return buf if buf.empty?
77
+ return buf.chop! if buf.end_with?('\\')
77
78
 
78
- if buf.end_with?('\\')
79
- buf.chop!
80
- else
81
- command = "tmux #{buf.gsub(%(\\;), %( '\\;'))}"
82
- @logger.debug "exec: #{command}"
79
+ command = "tmux #{buf.gsub(%(\\;), %( '\\;'))}"
80
+ @logger.debug "exec: #{command}"
83
81
 
84
- `#{command}` unless ENV['DEBUG']
85
- +''
86
- end
82
+ `#{command}` unless ENV['DEBUG']
83
+ +''
87
84
  end
88
85
 
89
86
  def process
@@ -13,7 +13,7 @@ module TmuxERBParser
13
13
  def initialize(input, type = :erb)
14
14
  @input = case input
15
15
  when IO then input.read
16
- when Array then input.join('\n')
16
+ when Array then input.join("\n")
17
17
  when String then input
18
18
  else raise ArgumentError
19
19
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TmuxERBParser
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tmux-erb-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - epaew
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-16 00:00:00.000000000 Z
11
+ date: 2018-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler