mvn2 2.6.12 → 2.7.0

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: 1e3b543c693c51be739469993cff696542a5e052
4
- data.tar.gz: 41942ef3d73c1ec35834884a84c5989e66cfeb7c
3
+ metadata.gz: 71970b18bea283cc3efacc1bb4afc095a105c580
4
+ data.tar.gz: faf90bf62234e7b015b7cb32addd8a36c0e4a771
5
5
  SHA512:
6
- metadata.gz: 6e4fd25d90cee19bd3586b685bcaaa680585ada6bb7ef7586fe3dde309f9ef59b6a02f747a9a636bdb09c1f8cac1aa6dabff85b14ce3897613fef7ad5d16dac2
7
- data.tar.gz: 3ebc5795f904ba569ec0ba1be83e528290753d0045443634880d9917b453d483359d261c76aa7143559c588cbe4012f6d23503c667c0d6078ce0bc1dda8b2956
6
+ metadata.gz: ed967d0d8f9cb498c9ce1c20170f13ebc8d2c9da094346fab50becce3d0ba4d188c7d701a8c1ba408d939dd38c11fe782f12a119fa07389e68163ad960054682
7
+ data.tar.gz: b5972d34cd6516d595fbc2794abbadccb7671612cd33373f15b31afeb93e40f9513b6910394e115bf82dc566e8ce240540d8a6394a5bab818bac0c64c16065b4
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mvn2 (2.6.10)
4
+ mvn2 (2.6.12)
5
5
  everyday-cli-utils (~> 1.8, >= 1.8.6)
6
6
  everyday-plugins (~> 1.2)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- everyday-cli-utils (1.8.6)
11
+ everyday-cli-utils (1.8.7.1)
12
12
  everyday-plugins (1.2.1)
13
13
  everyday-cli-utils (~> 1.8, >= 1.8.6)
14
14
  rake (10.5.0)
@@ -22,4 +22,4 @@ DEPENDENCIES
22
22
  rake (~> 10.4)
23
23
 
24
24
  BUNDLED WITH
25
- 1.11.2
25
+ 1.14.3
data/bin/mvn2 CHANGED
@@ -54,8 +54,6 @@ Plugins.get :color_override
54
54
 
55
55
  class Mvn2Runner
56
56
  HEADLESS = ' -Djava.awt.headless=true'
57
- INFO_LINE = '[INFO] ------------------------------------------------------------------------'
58
- BUILD_REGEX = /\[INFO\] Building (?!(jar|war|zip))/
59
57
 
60
58
  def initialize(options)
61
59
  @options = options
@@ -3,7 +3,7 @@ include EverydayPlugins
3
3
 
4
4
  class String
5
5
  def start_with_any?(*strs)
6
- strs.empty? ? false : strs.any? { |str| start_with?(str) }
6
+ strs.empty? ? false : strs.any? { |str| gsub(/\e\[.*?m/, '').start_with?(str) }
7
7
  end
8
8
  end
9
9
 
@@ -11,13 +11,15 @@ class FilterPlugin
11
11
  extend Plugin
12
12
  extend PluginType
13
13
 
14
- INFO_LINE = '[INFO] ------------------------------------------------------------------------'
15
- BUILD_REGEX = /\[INFO\] Building (?!(jar|war|zip))/
14
+ INFO_LINE_FULL = '[INFO] ------------------------------------------------------------------------'
15
+ BUILD_REGEX = /(\[(?:\e\S+)?INFO(?:\e\S+)?\] (?:\e\S+)?)Building (?!(jar|war|zip)).*(?:\e\S+)?$/
16
+ RESULT_REGEX = /(\[(?:\e\S+)?INFO(?:\e\S+)?\] (?:\e\S+)?)(BUILD SUCCESS|Reactor Summary:|BUILD FAILURE).*(?:\e\S+)?$/
16
17
 
17
18
  def self.def_vars
18
19
  register_variable :info_line_last, false
19
20
  register_variable :found, false
20
21
  register_variable :failures, 0
22
+ register_variable :info_line, ''
21
23
  end
22
24
 
23
25
  def_vars
@@ -40,9 +42,10 @@ class FilterPlugin
40
42
  def self.def_filter1
41
43
  register(:line_filter, priority: 10) { |_, line|
42
44
  info_line_last = Plugins.get_var :info_line_last
45
+ info_line = Plugins.get_var :info_line
43
46
  if line.start_with_any?('[INFO] BUILD SUCCESS', '[INFO] Reactor Summary:', '[INFO] BUILD FAILURE')
44
47
  str = ''
45
- str << INFO_LINE << "\n" unless info_line_last
48
+ str << "#{info_line}\n" unless info_line_last
46
49
  str << line << "\n"
47
50
  Plugins.set_vars found: true, info_line_last: false
48
51
  str
@@ -69,7 +72,7 @@ class FilterPlugin
69
72
  found = Plugins.get_var :found
70
73
  if found
71
74
  str = line << "\n"
72
- Plugins.set_vars found: true, info_line_last: line.start_with?(INFO_LINE)
75
+ Plugins.set_vars found: true, info_line_last: line.start_with_any?(INFO_LINE_FULL)
73
76
  str
74
77
  else
75
78
  nil
@@ -80,7 +83,7 @@ class FilterPlugin
80
83
  def self.def_filter4
81
84
  register(:line_filter, priority: 40) { |options, line|
82
85
  found = Plugins.get_var :found
83
- if options[:hide_between] && found && line.start_with?('Tests run:')
86
+ if options[:hide_between] && found && line.start_with_any?('Tests run:')
84
87
  str = line << "\n\n"
85
88
  Plugins.set_vars found: false, info_line_last: false
86
89
  if line =~ /^.*Failures:\s+(\d+),.*$/
@@ -98,11 +101,15 @@ class FilterPlugin
98
101
  def self.def_filter5
99
102
  register(:line_filter, priority: 50) { |options, line|
100
103
  info_line_last = Plugins.get_var :info_line_last
101
- if options[:show_projects] && line =~ BUILD_REGEX
104
+ info_line = Plugins.get_var :info_line
105
+ if line.gsub(/\e\[.*?m/, '').chomp == INFO_LINE_FULL
106
+ Plugins.set_var :info_line, line.chomp
107
+ nil
108
+ elsif options[:show_projects] && line =~ BUILD_REGEX
102
109
  str = ''
103
- str << INFO_LINE << "\n" unless info_line_last
110
+ str << "#{info_line}\n" unless info_line_last
104
111
  str << line << "\n"
105
- str << INFO_LINE << "\n"
112
+ str << "#{info_line}\n"
106
113
  Plugins.set_var :info_line_last, true
107
114
  str
108
115
  else
@@ -1,3 +1,4 @@
1
+ require 'pty'
1
2
  require 'everyday-plugins'
2
3
  include EverydayPlugins
3
4
  class LivePrintPlugin
@@ -21,12 +22,14 @@ class LivePrintPlugin
21
22
  else
22
23
  log_file = nil
23
24
  end
24
- IO.popen(cmd).each do |l|
25
- log_file << l unless log_file.nil?
26
- output = Plugins.get :line_filter, l
27
- puts "\r\e[2K#{output}" unless output.nil?
28
- result = true if l.chomp.start_with?('[INFO] BUILD SUCCESS')
29
- end
25
+ PTY.spawn("TERM='xterm-256color' #{cmd}") { |r, w, pid|
26
+ r.each { |l|
27
+ log_file << l.gsub(/\e\[.*?m/, '') unless log_file.nil?
28
+ output = Plugins.get :line_filter, l
29
+ puts "\r\e[2K#{output}" unless output.nil?
30
+ result = true if l.chomp.gsub(/\e\[.*?;/, '').start_with?('[INFO] BUILD SUCCESS')
31
+ }
32
+ }
30
33
  ensure
31
34
  log_file.close unless log_file.nil?
32
35
  end
@@ -1,3 +1,3 @@
1
1
  module Mvn2
2
- VERSION = '2.6.12'
2
+ VERSION = '2.7.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mvn2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.12
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Henderson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-15 00:00:00.000000000 Z
11
+ date: 2017-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  version: '0'
130
130
  requirements: []
131
131
  rubyforge_project:
132
- rubygems_version: 2.5.1
132
+ rubygems_version: 2.6.11
133
133
  signing_key:
134
134
  specification_version: 4
135
135
  summary: Maven helper