ruby-zoom 3.2.0 → 3.3.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
  SHA1:
3
- metadata.gz: e066194536e36c82139cf680bcf3b7fcb35e5787
4
- data.tar.gz: 3ed2196ca2c49ddfb4958b1c519416091041e0d5
3
+ metadata.gz: 54c82ec02a3f8fd56c99f71a28540f2bf2898002
4
+ data.tar.gz: 47f87ffb3270ee86f957493fda358cd30aedf8f2
5
5
  SHA512:
6
- metadata.gz: 9195ae177d3f28ed280e8b682829ba24b1278179c3ccf4cfa860532d67793d9e92e71f00e24d90fb868a7536d3573a5ee1b4e3bc880334da36969f240131bc80
7
- data.tar.gz: 037b00f17a8ac1ae1a980bf2881ac5970e387cfe9072ccc47d722ab4a689fe086b5b212da75677228234218e5712562944f6dcef7c3e24dc96f23e8a507d8847
6
+ metadata.gz: dcf39b5c8eb4ba8f8c71fdb9138641dde45aea9c882c093fb5bebb8b2f29e3f9795841e6c9d0288e0ec3301380aa114035a29d41a1b484eacc73b9a6fe9aa227
7
+ data.tar.gz: 55a81f2f64ce1864f3ff360481cf495c9cd74dc92d24b172a51db6bb0ecbb63a4b11143414b28d668b9afdf13e0263429897a4e6ea6471a8f0a44bae03010dca
@@ -77,13 +77,20 @@ class Zoom
77
77
  profiles = Hash.new
78
78
 
79
79
  all = nil
80
+ ag = nil
81
+ pt = nil
82
+ ack = nil
80
83
 
81
84
  # Default ag profiles
82
85
  if (ScoobyDoo.where_are_you("ag"))
83
86
  ag = Zoom::Profile::Ag.new
84
- all = Zoom::Profile::Ag.new(nil, "-uS")
85
- else
86
- ag = nil
87
+ all = Zoom::Profile::Ag.new(nil, "-u")
88
+ end
89
+
90
+ # Default pt profiles
91
+ if (ScoobyDoo.where_are_you("pt"))
92
+ pt = Zoom::Profile::Pt.new
93
+ all ||= Zoom::Profile::Pt.new(nil, "--color -SeU")
87
94
  end
88
95
 
89
96
  # Default ack profile
@@ -92,20 +99,17 @@ class Zoom
92
99
  ScoobyDoo.where_are_you("ack-grep")
93
100
  )
94
101
  ack = Zoom::Profile::Ack.new
95
- else
96
- ack = nil
97
102
  end
98
103
 
99
104
  # Default grep profile (emulate ag/ack as much as possible)
100
105
  grep = Zoom::Profile::Grep.new
101
- if (all.nil?)
102
- all = Zoom::Profile::Grep.new
103
- all.flags("--color=always -EHinR")
104
- end
106
+ all ||= Zoom::Profile::Grep.new(nil, "--color=always -EHinR")
105
107
 
106
108
  # Create default profile
107
109
  if (ag)
108
110
  default = ag
111
+ elsif (pt)
112
+ default = pt
109
113
  elsif (ack)
110
114
  default = ack
111
115
  else
@@ -122,6 +126,7 @@ class Zoom
122
126
  profiles["default"] = default
123
127
  profiles["grep"] = grep
124
128
  profiles["passwords"] = Zoom::Profile::Passwords.new
129
+ profiles["pt"] = pt
125
130
  profiles["zoom_find"] = find
126
131
  rc["profiles"] = profiles
127
132
 
@@ -248,6 +253,8 @@ class Zoom
248
253
  default_op = "grep"
249
254
  if (ScoobyDoo.where_are_you("ag"))
250
255
  default_op = "ag"
256
+ elsif (ScoobyDoo.where_are_you("pt"))
257
+ default_op = "pt"
251
258
  elsif (ScoobyDoo.where_are_you("ack"))
252
259
  default_op = "ack"
253
260
  elsif (ScoobyDoo.where_are_you("ack-grep"))
@@ -257,6 +264,7 @@ class Zoom
257
264
  ack_class = Zoom::Profile::Ack.to_s
258
265
  ag_class = Zoom::Profile::Ag.to_s
259
266
  grep_class = Zoom::Profile::Grep.to_s
267
+ pt_class = Zoom::Profile::Pt.to_s
260
268
 
261
269
  case default_op
262
270
  when "ack", "ack-grep"
@@ -265,6 +273,8 @@ class Zoom
265
273
  puts "Enter class (default #{ag_class}):"
266
274
  when "grep"
267
275
  puts "Enter class (default #{grep_class}):"
276
+ when "pt"
277
+ puts "Enter class (default #{pt_class}):"
268
278
  end
269
279
 
270
280
  clas = gets.chomp
@@ -277,6 +287,8 @@ class Zoom
277
287
  clas = ag_class if (clas.nil? || clas.empty?)
278
288
  when "grep"
279
289
  clas = grep_class if (clas.nil? || clas.empty?)
290
+ when "pt"
291
+ clas = pt_class if (clas.nil? || clas.empty?)
280
292
  end
281
293
 
282
294
  add_profile(name, clas)
@@ -619,8 +631,3 @@ end
619
631
 
620
632
  require "zoom/error"
621
633
  require "zoom/profile"
622
- require "zoom/profile/ack"
623
- require "zoom/profile/ag"
624
- require "zoom/profile/find"
625
- require "zoom/profile/grep"
626
- require "zoom/profile/passwords"
@@ -102,3 +102,10 @@ class Zoom::Profile < Hash
102
102
  ].join(" ").strip
103
103
  end
104
104
  end
105
+
106
+ require "zoom/profile/ack"
107
+ require "zoom/profile/ag"
108
+ require "zoom/profile/find"
109
+ require "zoom/profile/grep"
110
+ require "zoom/profile/passwords"
111
+ require "zoom/profile/pt"
@@ -22,7 +22,7 @@ class Zoom::Profile::Ag < Zoom::Profile
22
22
 
23
23
  def initialize(
24
24
  operator = nil,
25
- flags = "-S",
25
+ flags = "",
26
26
  envprepend = "",
27
27
  append = ""
28
28
  )
@@ -0,0 +1,30 @@
1
+ require "shellwords"
2
+ require "zoom/profile"
3
+
4
+ class Zoom::Profile::Pt < Zoom::Profile
5
+ def exe(args, pattern)
6
+ # Emulate ag/ack as much as possible
7
+ if (pattern.nil? || pattern.empty?)
8
+ system(
9
+ "#{self.to_s} #{args} #{self.append} | " \
10
+ "sed \"s|\\[K[:-]|\\[K\\n|\" | #{@pager}"
11
+ )
12
+ else
13
+ system(
14
+ "#{self.to_s} #{args} #{pattern.shellescape} " \
15
+ "#{self.append} | sed \"s|\\[K[:-]|\\[K\\n|\" | " \
16
+ "#{@pager}"
17
+ )
18
+ end
19
+ end
20
+
21
+ def initialize(
22
+ operator = nil,
23
+ flags = "--color -Se",
24
+ envprepend = "",
25
+ append = ""
26
+ )
27
+ super("pt", flags, envprepend, append)
28
+ @taggable = true
29
+ end
30
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-zoom
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Whittaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-20 00:00:00.000000000 Z
11
+ date: 2015-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -89,6 +89,7 @@ files:
89
89
  - lib/zoom/profile/find.rb
90
90
  - lib/zoom/profile/grep.rb
91
91
  - lib/zoom/profile/passwords.rb
92
+ - lib/zoom/profile/pt.rb
92
93
  homepage: http://mjwhitta.github.io/zoom
93
94
  licenses:
94
95
  - GPL-3.0
@@ -109,9 +110,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
110
  version: '0'
110
111
  requirements: []
111
112
  rubyforge_project:
112
- rubygems_version: 2.4.8
113
+ rubygems_version: 2.4.5.1
113
114
  signing_key:
114
115
  specification_version: 4
115
116
  summary: Quickly open CLI search results in your favorite editor!
116
117
  test_files: []
117
- has_rdoc: