utils 0.2.1 → 0.2.2

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: 5f7479321d74ae71a8290840dfc5b08c554d1406
4
- data.tar.gz: fae08ff9daf35e7293a2356ea88e0d373e3b3af8
3
+ metadata.gz: 8514a94586fa480b82deb20918d1d40ac89d284d
4
+ data.tar.gz: e53cac57b84397754de9291f73076d498b50c408
5
5
  SHA512:
6
- metadata.gz: b1b07887fb9bd8b03cba6266075d3d75fd07234c81c3eaa9b9b9b8cc5253308deee72bd09a638a31aec908f228d08fcad3fedcb2741689d4fe62c6d7f7671940
7
- data.tar.gz: a8fcea882bb64d1417ce923e975eea79dbd943f2bc79e5c8c0dd8397c0d1c630e09dd1e5cc6aae11f995ab8ef92479f7dc7e029378a54cc9b2ae7b7b1282b5c0
6
+ metadata.gz: 3ed309d7fe82e8145414f1af30ef2b516d0742af071ec638a70fb21d83a0db1f04cac671da74b651cf17a14cb121e37f873ce85adbb9d02e96f2e27d34ec75c6
7
+ data.tar.gz: f59099c146fba8e204f6ba185dfceea62ddd4018d4f12a3027b38b75d4888af1e17ad9a03c08e1ca9f7f95bb31487f053df71ec0c60c737230e7e5e43265e699
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
data/bin/probe CHANGED
@@ -99,9 +99,9 @@ puts "Running tests in #{$args.inspect}"
99
99
  case ($opt['t'] || $config.probe.test_framework).to_sym
100
100
  when :rspec
101
101
  if zeus?
102
- rspec = %w[-S zeus rspec]
102
+ rspec = %w[-S zeus rspec -f Utils::LineFormatter ]
103
103
  else
104
- rspec = find_cmd('rspec', 'spec')
104
+ rspec = [ find_cmd('rspec', 'spec') ] << '-f' << 'Utils::LineFormatter'
105
105
  end
106
106
  if linenumber = $opt['n']
107
107
  cmd 'ruby', '-I', $config.probe.include_dirs_argument, *rspec, '-l',
@@ -0,0 +1,109 @@
1
+ require 'tins/terminal'
2
+ require 'term/ansicolor'
3
+ begin
4
+ require 'rpsec'
5
+ require 'rspec/core/formatters/base_text_formatter'
6
+ rescue LoadError
7
+ end
8
+
9
+ if defined? RSpec
10
+ module Utils
11
+ class LineFormatter < RSpec::Core::Formatters::BaseTextFormatter
12
+ def start(example_count)
13
+ super
14
+ filename = 'errors.lst'
15
+ output.puts "Storing error list in #{filename.inspect}: "
16
+ @errors_lst = File.new(filename, 'w')
17
+ @errors_lst.sync = true
18
+ end
19
+
20
+ def close
21
+ super
22
+ @errors_lst.puts "\n#{?= * 75}\nFinished in #{format_duration(duration)}\n"
23
+ @errors_lst.puts summary_line(example_count, failure_count, pending_count)
24
+ @errors_lst.close
25
+ end
26
+
27
+ def example_passed(example)
28
+ super
29
+ output.puts format_line(example)
30
+ end
31
+
32
+ def example_pending(example)
33
+ super
34
+ output.puts format_line(example)
35
+ end
36
+
37
+ def example_failed(example)
38
+ super
39
+ dump_line_to_error_file(example)
40
+ output.puts format_line(example)
41
+ dump_failure_info(example)
42
+ end
43
+
44
+ def dump_failures
45
+ end
46
+
47
+ def dump_pending
48
+ end
49
+
50
+ def dump_commands_to_rerun_failed_examples
51
+ end
52
+
53
+ private
54
+
55
+ def dump_failure_for_error_file(example)
56
+ result = ''
57
+ exception = example.execution_result[:exception]
58
+ exception_class_name = exception_class_name_for(exception)
59
+ result << "#{long_padding}Failure/Error: #{read_failed_line(exception, example).strip}\n"
60
+ result << "#{long_padding}#{exception_class_name}:\n" unless exception_class_name =~ /RSpec/
61
+ exception.message.to_s.split("\n").each { |line| result << "#{long_padding} #{line}\n" } if exception.message
62
+ result
63
+ end
64
+
65
+ def dump_line_to_error_file(example)
66
+ @errors_lst.flock File::LOCK_EX
67
+ @errors_lst.puts "%s\n%3.3fs %s\n%s\n%s" % [
68
+ location(example), run_time(example), example.full_description,
69
+ Term::ANSIColor.uncolored(dump_failure_for_error_file(example)),
70
+ (%w[ {{{ ] +
71
+ format_backtrace(example.execution_result[:exception].backtrace, example) +
72
+ %w[ }}} ]) * ?\n
73
+ ]
74
+ ensure
75
+ @errors_lst.flock File::LOCK_UN
76
+ end
77
+
78
+ def run_time(example)
79
+ example.execution_result[:run_time]
80
+ end
81
+
82
+ def format_line(example)
83
+ description =
84
+ if ENV['VERBOSE'].to_i == 1
85
+ example.full_description
86
+ else
87
+ example.description
88
+ end
89
+ args = [ location(example), run_time(example), description ]
90
+ uncolored = "%s # S %3.3fs %s" % args
91
+ uncolored = uncolored[0, Tins::Terminal.columns]
92
+ case example.execution_result[:status]
93
+ when 'passed'
94
+ success_color(uncolored)
95
+ when 'failed'
96
+ failure_color(uncolored)
97
+ when 'pending'
98
+ pending_color(uncolored)
99
+ else
100
+ uncolored % args
101
+ end
102
+ end
103
+
104
+ def location(example)
105
+ RSpec::Core::Metadata::relative_path(example.location)
106
+ end
107
+ end
108
+ end
109
+ end
data/lib/utils/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Utils
2
2
  # Utils version
3
- VERSION = '0.2.1'
3
+ VERSION = '0.2.2'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
data/lib/utils.rb CHANGED
@@ -10,4 +10,5 @@ module Utils
10
10
  require 'utils/grepper'
11
11
  require 'utils/probe_server'
12
12
  require 'utils/ssh_tunnel_specification'
13
+ require 'utils/line_formatter'
13
14
  end
data/utils.gemspec CHANGED
@@ -1,19 +1,19 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: utils 0.2.1 ruby lib
2
+ # stub: utils 0.2.2 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "utils"
6
- s.version = "0.2.1"
6
+ s.version = "0.2.2"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib"]
10
10
  s.authors = ["Florian Frank"]
11
- s.date = "2014-07-26"
11
+ s.date = "2014-08-25"
12
12
  s.description = "This ruby gem provides some useful command line utilities"
13
13
  s.email = "flori@ping.de"
14
14
  s.executables = ["brakeman2err", "chroot-exec", "chroot-libs", "classify", "create_tags", "discover", "edit", "edit_wait", "enum", "errf", "git-empty", "irb_connect", "json_check", "myex", "number_files", "on_change", "path", "probe", "remote_copy", "same_files", "search", "sedit", "ssh-tunnel", "strip_spaces", "unquarantine_apps", "untest", "utils-install-config", "utils-utilsrc", "vacuum_firefox_sqlite", "xmp"]
15
- s.extra_rdoc_files = ["README.md", "lib/utils.rb", "lib/utils/config.rb", "lib/utils/config/config_file.rb", "lib/utils/editor.rb", "lib/utils/file_xt.rb", "lib/utils/finder.rb", "lib/utils/grepper.rb", "lib/utils/irb.rb", "lib/utils/md5.rb", "lib/utils/patterns.rb", "lib/utils/probe_server.rb", "lib/utils/ssh_tunnel_specification.rb", "lib/utils/version.rb"]
16
- s.files = [".gitignore", "COPYING", "Gemfile", "README.md", "Rakefile", "VERSION", "bin/brakeman2err", "bin/chroot-exec", "bin/chroot-libs", "bin/classify", "bin/create_tags", "bin/discover", "bin/edit", "bin/edit_wait", "bin/enum", "bin/errf", "bin/git-empty", "bin/irb_connect", "bin/json_check", "bin/myex", "bin/number_files", "bin/on_change", "bin/path", "bin/probe", "bin/remote_copy", "bin/same_files", "bin/search", "bin/sedit", "bin/ssh-tunnel", "bin/strip_spaces", "bin/unquarantine_apps", "bin/untest", "bin/utils-install-config", "bin/utils-utilsrc", "bin/vacuum_firefox_sqlite", "bin/xmp", "lib/utils.rb", "lib/utils/config.rb", "lib/utils/config/config_file.rb", "lib/utils/config/gdb/asm", "lib/utils/config/gdb/ruby", "lib/utils/config/gdbinit", "lib/utils/config/irbrc", "lib/utils/config/rdebugrc", "lib/utils/config/rvmrc", "lib/utils/config/screenrc", "lib/utils/config/utilsrc", "lib/utils/editor.rb", "lib/utils/file_xt.rb", "lib/utils/finder.rb", "lib/utils/grepper.rb", "lib/utils/irb.rb", "lib/utils/md5.rb", "lib/utils/patterns.rb", "lib/utils/probe_server.rb", "lib/utils/ssh_tunnel_specification.rb", "lib/utils/version.rb", "utils.gemspec"]
15
+ s.extra_rdoc_files = ["README.md", "lib/utils.rb", "lib/utils/config.rb", "lib/utils/config/config_file.rb", "lib/utils/editor.rb", "lib/utils/file_xt.rb", "lib/utils/finder.rb", "lib/utils/grepper.rb", "lib/utils/irb.rb", "lib/utils/line_formatter.rb", "lib/utils/md5.rb", "lib/utils/patterns.rb", "lib/utils/probe_server.rb", "lib/utils/ssh_tunnel_specification.rb", "lib/utils/version.rb"]
16
+ s.files = [".gitignore", "COPYING", "Gemfile", "README.md", "Rakefile", "VERSION", "bin/brakeman2err", "bin/chroot-exec", "bin/chroot-libs", "bin/classify", "bin/create_tags", "bin/discover", "bin/edit", "bin/edit_wait", "bin/enum", "bin/errf", "bin/git-empty", "bin/irb_connect", "bin/json_check", "bin/myex", "bin/number_files", "bin/on_change", "bin/path", "bin/probe", "bin/remote_copy", "bin/same_files", "bin/search", "bin/sedit", "bin/ssh-tunnel", "bin/strip_spaces", "bin/unquarantine_apps", "bin/untest", "bin/utils-install-config", "bin/utils-utilsrc", "bin/vacuum_firefox_sqlite", "bin/xmp", "lib/utils.rb", "lib/utils/config.rb", "lib/utils/config/config_file.rb", "lib/utils/config/gdb/asm", "lib/utils/config/gdb/ruby", "lib/utils/config/gdbinit", "lib/utils/config/irbrc", "lib/utils/config/rdebugrc", "lib/utils/config/rvmrc", "lib/utils/config/screenrc", "lib/utils/config/utilsrc", "lib/utils/editor.rb", "lib/utils/file_xt.rb", "lib/utils/finder.rb", "lib/utils/grepper.rb", "lib/utils/irb.rb", "lib/utils/line_formatter.rb", "lib/utils/md5.rb", "lib/utils/patterns.rb", "lib/utils/probe_server.rb", "lib/utils/ssh_tunnel_specification.rb", "lib/utils/version.rb", "utils.gemspec"]
17
17
  s.homepage = "http://github.com/flori/utils"
18
18
  s.rdoc_options = ["--title", "Utils - Some useful command line utilities", "--main", "README.md"]
19
19
  s.rubygems_version = "2.2.2"
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-26 00:00:00.000000000 Z
11
+ date: 2014-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.0.0
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: tins
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: term-ansicolor
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.3'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pstree
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.1'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: pry-editline
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: This ruby gem provides some useful command line utilities
@@ -124,13 +124,14 @@ extra_rdoc_files:
124
124
  - lib/utils/finder.rb
125
125
  - lib/utils/grepper.rb
126
126
  - lib/utils/irb.rb
127
+ - lib/utils/line_formatter.rb
127
128
  - lib/utils/md5.rb
128
129
  - lib/utils/patterns.rb
129
130
  - lib/utils/probe_server.rb
130
131
  - lib/utils/ssh_tunnel_specification.rb
131
132
  - lib/utils/version.rb
132
133
  files:
133
- - ".gitignore"
134
+ - .gitignore
134
135
  - COPYING
135
136
  - Gemfile
136
137
  - README.md
@@ -182,6 +183,7 @@ files:
182
183
  - lib/utils/finder.rb
183
184
  - lib/utils/grepper.rb
184
185
  - lib/utils/irb.rb
186
+ - lib/utils/line_formatter.rb
185
187
  - lib/utils/md5.rb
186
188
  - lib/utils/patterns.rb
187
189
  - lib/utils/probe_server.rb
@@ -193,20 +195,20 @@ licenses: []
193
195
  metadata: {}
194
196
  post_install_message:
195
197
  rdoc_options:
196
- - "--title"
198
+ - --title
197
199
  - Utils - Some useful command line utilities
198
- - "--main"
200
+ - --main
199
201
  - README.md
200
202
  require_paths:
201
203
  - lib
202
204
  required_ruby_version: !ruby/object:Gem::Requirement
203
205
  requirements:
204
- - - ">="
206
+ - - '>='
205
207
  - !ruby/object:Gem::Version
206
208
  version: '0'
207
209
  required_rubygems_version: !ruby/object:Gem::Requirement
208
210
  requirements:
209
- - - ">="
211
+ - - '>='
210
212
  - !ruby/object:Gem::Version
211
213
  version: '0'
212
214
  requirements: []