pphtml 0.1.1 → 0.1.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
  SHA256:
3
- metadata.gz: d9bc790a60c20445cdb00ae408f19555aed43e8f400d47586d62d52ee331db9e
4
- data.tar.gz: 7bbb939ca9581810ee0a5b353c09923f0092f3bb70052af686cc722188003bd9
3
+ metadata.gz: 1b6e9e9347bbf9eea48f2a290cf3f3ac21e1cc5fccbcf86c0322801ca8688729
4
+ data.tar.gz: f0691692e6d2cc22970d0ca01d1ef4d82c88b39f3aabfc32aa2dea7bdcecbf1d
5
5
  SHA512:
6
- metadata.gz: 57e5da4faa4286c2b58694baba595191ea05de587eaf74a6f01519f8a14457c672f5adca1591fd6b35c5bdf4f078acbae06003124770c4f3d5f0edd09e00a28f
7
- data.tar.gz: 2f3650e18bfe6bb2365d7c0a8fc18e1d72c75fd95408095c33e181ffb012ef0d358ff6a6da35d51928133405a0c2b35b55ebc83e5c1d6d0ab61429f47d8f736f
6
+ metadata.gz: da69389cd3d26b8a62aa58210ded3e3ab441dbf3a3149357c23db227ff512ae92b3a0ad45c7f0bb80b13da6bb69ff71ea589d3a0f3b582e72859ae7be5fbde44
7
+ data.tar.gz: a10eefb229540b206b96d25614d2285e49178a54875dfe4a4ceb0b0dec8ed76642ec634b5545ddd5b94f4dd682f5ff5150548348f0dc18afe0cc98dc46ca4524
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pphtml (0.1.0)
4
+ pphtml (0.1.2)
5
5
  coderay
6
6
  htmlbeautifier
7
7
 
data/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  PP for HTML looking things.
4
4
 
5
- [![screenshot](https://raw.githubusercontent.com/ttilberg/pphtml/master/screenshot.png)]
5
+ It will `puts` colorized HTML using ANSI escape codes from [CodeRay](https://github.com/rubychan/coderay) and returns an html document formatted by [HtmlBeautifier](https://github.com/threedaymonk/htmlbeautifier). This allows you to easily save the output to a file.
6
+
7
+ ![screenshot](https://raw.githubusercontent.com/ttilberg/pphtml/master/screenshot.png)
6
8
 
7
9
  ## Installation
8
10
 
@@ -32,6 +34,9 @@ pphtml response
32
34
 
33
35
  doc = Nokogiri.parse(response)
34
36
  pphtml doc
37
+
38
+ # The return value from pphtml is the html formatted without the ANSI escape codes:
39
+ File.write('myfile.html', pphtml doc)
35
40
  ```
36
41
 
37
42
  ## Development
data/lib/pphtml.rb CHANGED
@@ -8,7 +8,9 @@ class PP < PrettyPrint
8
8
  # Displays nice formatted output for an HTML string, or something that can look like one
9
9
  #
10
10
  def PP.pphtml(html)
11
- puts CodeRay.scan(HtmlBeautifier.beautify(html.to_s), :html).terminal
11
+ pretty_html = HtmlBeautifier.beautify(html.to_s)
12
+ puts CodeRay.scan(pretty_html, :html).terminal
13
+ pretty_html
12
14
  end
13
15
  end
14
16
 
@@ -1,3 +1,3 @@
1
1
  module PPHtml
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pphtml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Tilberg