pphtml 0.1.1 → 0.1.3
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/.github/workflows/ruby.yml +27 -0
- data/Gemfile.lock +7 -7
- data/README.md +6 -1
- data/lib/pphtml/version.rb +1 -1
- data/lib/pphtml.rb +3 -1
- data/pphtml.gemspec +3 -3
- metadata +12 -12
- data/.travis.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5b096b193fea48de2c847476add10123f0d786d5f83ac18c19c6697c0714f13
|
4
|
+
data.tar.gz: 1d7334a569e775eca4acf73688f0c0fc68a4507688107977b5f40a394de79b14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fa98581fd03df067b6f0aa48124c235fefb0cb99f7ef638a53909e1bd3ab19c95c4992a14958c4c2e4190f1713bbe8f765333a66ac8402bcdbdaec3524340fb
|
7
|
+
data.tar.gz: 19138f5db551c3b5354c22b2a21c77a615ed6d51d3fa4424dc49172f6fdff3659497bcadcdb486f6e6b8075dd7588afc8614c14a04728c5b03cd31e3a7041e97
|
@@ -0,0 +1,27 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ "master" ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ "master" ]
|
8
|
+
|
9
|
+
permissions:
|
10
|
+
contents: read
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
test:
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
strategy:
|
16
|
+
matrix:
|
17
|
+
ruby-version: ['3.0', '3.1', '3.2', '3.3']
|
18
|
+
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v4
|
21
|
+
- name: Set up Ruby
|
22
|
+
uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: ${{ matrix.ruby-version }}
|
25
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
26
|
+
- name: Run tests
|
27
|
+
run: bundle exec rake
|
data/Gemfile.lock
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pphtml (0.1.
|
4
|
+
pphtml (0.1.3)
|
5
5
|
coderay
|
6
6
|
htmlbeautifier
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
coderay (1.1.
|
12
|
-
htmlbeautifier (1.3
|
13
|
-
minitest (5.
|
14
|
-
rake (
|
11
|
+
coderay (1.1.3)
|
12
|
+
htmlbeautifier (1.4.3)
|
13
|
+
minitest (5.25.1)
|
14
|
+
rake (13.2.1)
|
15
15
|
|
16
16
|
PLATFORMS
|
17
17
|
ruby
|
@@ -20,7 +20,7 @@ DEPENDENCIES
|
|
20
20
|
bundler (~> 2.0)
|
21
21
|
minitest (~> 5.0)
|
22
22
|
pphtml!
|
23
|
-
rake (~>
|
23
|
+
rake (~> 13.0)
|
24
24
|
|
25
25
|
BUNDLED WITH
|
26
|
-
2.
|
26
|
+
2.5.22
|
data/README.md
CHANGED
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
PP for HTML looking things.
|
4
4
|
|
5
|
-
[
|
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
|
+

|
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/version.rb
CHANGED
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
|
-
|
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
|
|
data/pphtml.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = "pphtml"
|
7
7
|
spec.version = PPHtml::VERSION
|
8
8
|
spec.authors = ["Tim Tilberg"]
|
9
|
-
spec.email = ["
|
9
|
+
spec.email = ["ttilberg@gmail.com"]
|
10
10
|
|
11
11
|
spec.summary = %q{Helper pphtml function to pretty print HTML text in a terminal}
|
12
12
|
spec.description = <<~TEXT
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
This is little helper tool that I usually wish I had quick access to.
|
17
17
|
TEXT
|
18
18
|
|
19
|
-
spec.homepage = "https://
|
19
|
+
spec.homepage = "https://github.com/ttilberg/pphtml"
|
20
20
|
|
21
21
|
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
22
22
|
|
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.require_paths = ["lib"]
|
35
35
|
|
36
36
|
spec.add_development_dependency "bundler", "~> 2.0"
|
37
|
-
spec.add_development_dependency "rake", "~>
|
37
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
38
38
|
spec.add_development_dependency "minitest", "~> 5.0"
|
39
39
|
|
40
40
|
spec.add_dependency 'htmlbeautifier'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Tilberg
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '13.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,13 +86,13 @@ description: |
|
|
86
86
|
|
87
87
|
This is little helper tool that I usually wish I had quick access to.
|
88
88
|
email:
|
89
|
-
-
|
89
|
+
- ttilberg@gmail.com
|
90
90
|
executables: []
|
91
91
|
extensions: []
|
92
92
|
extra_rdoc_files: []
|
93
93
|
files:
|
94
|
+
- ".github/workflows/ruby.yml"
|
94
95
|
- ".gitignore"
|
95
|
-
- ".travis.yml"
|
96
96
|
- Gemfile
|
97
97
|
- Gemfile.lock
|
98
98
|
- README.md
|
@@ -103,12 +103,12 @@ files:
|
|
103
103
|
- lib/pphtml/version.rb
|
104
104
|
- pphtml.gemspec
|
105
105
|
- screenshot.png
|
106
|
-
homepage: https://
|
106
|
+
homepage: https://github.com/ttilberg/pphtml
|
107
107
|
licenses: []
|
108
108
|
metadata:
|
109
109
|
allowed_push_host: https://rubygems.org
|
110
|
-
homepage_uri: https://
|
111
|
-
post_install_message:
|
110
|
+
homepage_uri: https://github.com/ttilberg/pphtml
|
111
|
+
post_install_message:
|
112
112
|
rdoc_options: []
|
113
113
|
require_paths:
|
114
114
|
- lib
|
@@ -123,8 +123,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
|
-
rubygems_version: 3.
|
127
|
-
signing_key:
|
126
|
+
rubygems_version: 3.5.16
|
127
|
+
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: Helper pphtml function to pretty print HTML text in a terminal
|
130
130
|
test_files: []
|