pphtml 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -5
- data/lib/pphtml/version.rb +1 -1
- data/lib/pphtml.rb +2 -4
- data/screenshot.png +0 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9bc790a60c20445cdb00ae408f19555aed43e8f400d47586d62d52ee331db9e
|
4
|
+
data.tar.gz: 7bbb939ca9581810ee0a5b353c09923f0092f3bb70052af686cc722188003bd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57e5da4faa4286c2b58694baba595191ea05de587eaf74a6f01519f8a14457c672f5adca1591fd6b35c5bdf4f078acbae06003124770c4f3d5f0edd09e00a28f
|
7
|
+
data.tar.gz: 2f3650e18bfe6bb2365d7c0a8fc18e1d72c75fd95408095c33e181ffb012ef0d358ff6a6da35d51928133405a0c2b35b55ebc83e5c1d6d0ab61429f47d8f736f
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
#
|
1
|
+
# PPHtml
|
2
2
|
|
3
|
-
|
3
|
+
PP for HTML looking things.
|
4
4
|
|
5
|
-
|
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
|
-
|
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/
|
45
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ttilberg/pphtml.
|
data/lib/pphtml/version.rb
CHANGED
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
|
-
|
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.
|
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:
|