FriendlyFire 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/bin/friendlyfire +5 -0
  3. data/lib/friendlyfire.rb +30 -0
  4. metadata +46 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ecdd99f6819bdf8d3778e04015c03ac357fd08d4
4
+ data.tar.gz: 27c439780b81fc8805d3aba740b4a2edbcc8b9ef
5
+ SHA512:
6
+ metadata.gz: 6684752cffa568ef64045ccf02937d60bd290a6206cb57e8a0a4b82d5b5ed3ff6b4728d3566c4a186c36179c8226a308765af67882f5b301a5141b8319785825
7
+ data.tar.gz: 242ad0525169588f012cd18095401cbf4a37f55f398e6e7b94778d4f9086d07a7dfe7b37169e9dbf1998898936264aa6e776068de8b8728bcee092d6d81f712b
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'friendlyfire'
4
+
5
+ FriendlyFire.print_friendly(ARGV[0])
@@ -0,0 +1,30 @@
1
+ require 'colored'
2
+ require 'open3'
3
+
4
+ module FriendlyFire
5
+
6
+ def self.print_friendly(file)
7
+ cmd = "ruby #{file}"
8
+
9
+ output = ""
10
+ Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|
11
+ output << stderr.read
12
+ end
13
+
14
+ # error status returned
15
+ if output
16
+ lines = output.lines
17
+
18
+ # Future, red the first line originating from a file in the same directory, ie. not in a gem
19
+ puts lines.shift.chomp.red
20
+ lines.each do |line|
21
+ if line =~ /from\s[^\/]/
22
+ puts line.chomp.red
23
+ else
24
+ puts line
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: FriendlyFire
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Matthew Bunday
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-29 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Friendly error highlighting for Ruby
14
+ email: mkbunday@gmail.com
15
+ executables:
16
+ - friendlyfire
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/friendlyfire.rb
21
+ - bin/friendlyfire
22
+ homepage: http://rubygems.org/gems/friendlyfire
23
+ licenses:
24
+ - MIT
25
+ metadata: {}
26
+ post_install_message:
27
+ rdoc_options: []
28
+ require_paths:
29
+ - lib
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirements: []
41
+ rubyforge_project:
42
+ rubygems_version: 2.0.14
43
+ signing_key:
44
+ specification_version: 4
45
+ summary: Friendly error highlighting for Ruby
46
+ test_files: []