pretty_debug 0.3.14 → 0.3.15
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 +4 -4
- data/lib/pretty_debug.rb +6 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9c26c261ab006b2929278eb291ad85acc7eb9d4
|
4
|
+
data.tar.gz: 97266be8bd3fde4e63b41309b04030d379d14481
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfaff304ebbbacc67ed175b0575cb2a7168b99ae52f65b464293a3ef73b5b5010b36d4013686b61de07fd3ca3d55329d785a187704950f8e013b5c0d0c60f59f
|
7
|
+
data.tar.gz: b6acce0405558cd3e01c4cf431a6066074333404d307401ccb33eaa12cf2b2fe6bac5bcee6cf376aa7378a056b51b3a0e438b0dcab2291f75e62493945746a14
|
data/lib/pretty_debug.rb
CHANGED
@@ -9,6 +9,11 @@ require "utility"
|
|
9
9
|
class File
|
10
10
|
def self.relativize f; f.sub(%r{\A/}, "") end
|
11
11
|
def self.expand_path_relative f; expand_path(f, caller_location(1).dirname) end
|
12
|
+
def self.add f, s
|
13
|
+
open(f, "a+") do |io|
|
14
|
+
io.readlines.last.tap{|l| io.puts if l && l.end_with?($/).!}
|
15
|
+
io.write(s)
|
16
|
+
end
|
12
17
|
end
|
13
18
|
|
14
19
|
class Dir
|
@@ -53,11 +58,7 @@ class String
|
|
53
58
|
def binary_write_to f; binary_write_to!(f) rescue nil end
|
54
59
|
def binary_write_to! f; File.write(f, self, "wb") end
|
55
60
|
def add_to f; add_to!(f) rescue nil end
|
56
|
-
def add_to! f; File.
|
57
|
-
io.readlines.last.tap{|l| io.puts if l && l.end_with?($/).!}
|
58
|
-
io.write(self)
|
59
|
-
end
|
60
|
-
end
|
61
|
+
def add_to! f; File.add(f, self) end
|
61
62
|
# Raises an error if either save, read, or round-trip-matching fails.
|
62
63
|
def safely_write_to dest, tmp = "#{Dir.tmpdir}/safe-save"
|
63
64
|
write_to!(tmp)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pretty_debug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ''
|
14
14
|
email: []
|
@@ -36,7 +36,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
36
36
|
version: '0'
|
37
37
|
requirements: []
|
38
38
|
rubyforge_project:
|
39
|
-
rubygems_version: 2.1.
|
39
|
+
rubygems_version: 2.1.4
|
40
40
|
signing_key:
|
41
41
|
specification_version: 4
|
42
42
|
summary: ''
|