pphtml 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: 1df96a2bd034f6d8c943ead8156cc51da28d1f3ad22a4fb56ff1229c5bbf96e9
4
- data.tar.gz: c90d32756c8172762f9c4e045c7fa0442e42d719e57c5b8afaf463d6f43d884a
3
+ metadata.gz: d9bc790a60c20445cdb00ae408f19555aed43e8f400d47586d62d52ee331db9e
4
+ data.tar.gz: 7bbb939ca9581810ee0a5b353c09923f0092f3bb70052af686cc722188003bd9
5
5
  SHA512:
6
- metadata.gz: 7af8a8fc5b0e11d965bb12c83abb182d67a3f82ebf7a3b07d5c7a19f418774abd1c3973f62bfb609d244d8304cbabd1f8c7b18f78030c789c1889f54cc502d16
7
- data.tar.gz: c9fc5129508ca5ffed7005d35f7b069a9e1b1099f1bd5fd2402c0924f15d1ccc55a381b05ae9c9d18ef9a41edfdf72cbaff2bfeb104acc36f37a16b774c86ded
6
+ metadata.gz: 57e5da4faa4286c2b58694baba595191ea05de587eaf74a6f01519f8a14457c672f5adca1591fd6b35c5bdf4f078acbae06003124770c4f3d5f0edd09e00a28f
7
+ data.tar.gz: 2f3650e18bfe6bb2365d7c0a8fc18e1d72c75fd95408095c33e181ffb012ef0d358ff6a6da35d51928133405a0c2b35b55ebc83e5c1d6d0ab61429f47d8f736f
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # Pphtml
1
+ # PPHtml
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/pphtml`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ PP for HTML looking things.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ [![screenshot](https://raw.githubusercontent.com/ttilberg/pphtml/master/screenshot.png)]
6
6
 
7
7
  ## Installation
8
8
 
@@ -22,7 +22,17 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ ```ruby
26
+ require 'pphtml'
27
+
28
+ pphtml "<html><body><h1>Wow!</h1></body></html>"
29
+
30
+ response = HTTParty.get 'https://www.example.com'
31
+ pphtml response
32
+
33
+ doc = Nokogiri.parse(response)
34
+ pphtml doc
35
+ ```
26
36
 
27
37
  ## Development
28
38
 
@@ -32,4 +42,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
42
 
33
43
  ## Contributing
34
44
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/pphtml.
45
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ttilberg/pphtml.
@@ -1,3 +1,3 @@
1
1
  module PPHtml
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/pphtml.rb CHANGED
@@ -5,12 +5,10 @@ require 'prettyprint'
5
5
 
6
6
  class PP < PrettyPrint
7
7
 
8
- # Displays nice formatted output for an HTML string.
9
- # If passed an object that responds to .body? such as a response from several HTTP clients, it will automatically call that.
8
+ # Displays nice formatted output for an HTML string, or something that can look like one
10
9
  #
11
10
  def PP.pphtml(html)
12
- html = html.body if html.respond_to? :body
13
- puts CodeRay.scan(HtmlBeautifier.beautify(html), :html).terminal
11
+ puts CodeRay.scan(HtmlBeautifier.beautify(html.to_s), :html).terminal
14
12
  end
15
13
  end
16
14
 
data/screenshot.png ADDED
Binary file
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Tilberg
@@ -102,6 +102,7 @@ files:
102
102
  - lib/pphtml.rb
103
103
  - lib/pphtml/version.rb
104
104
  - pphtml.gemspec
105
+ - screenshot.png
105
106
  homepage: https://git.thegeck.com/tim/pphtml
106
107
  licenses: []
107
108
  metadata: