epitools 0.5.133 → 0.5.134
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/epitools/autoloads.rb +4 -1
- data/lib/epitools/clitools.rb +10 -0
- data/lib/epitools/gem_ext/oga.rb +31 -0
- data/lib/epitools/path.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2aefbc7936ad578ce3f2ae8806e67be1815f4e2a55ddf43a915bcdaa0ca9f68a
|
4
|
+
data.tar.gz: 6d09789e434d7cda9b66e25ecf1ebf9db61d6236f1342b83743330e42d9ab09f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c98a36281937b7dd6e8f6154af595f5153d51803da0587eafc1a8dec26c96adac899e73c9ef49157b8fadcdf01fb845b60095d9ceb9722b5107c0eeaf6f8550
|
7
|
+
data.tar.gz: ccf09c13ef7df31e8d6994ba1c5550dc606fd61ac909c14f00c53788160a69cb53e7c425156a373732f4fbc7e021bde12c27e850be0ca1cf4735b86d9cf01285
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.134
|
data/lib/epitools/autoloads.rb
CHANGED
@@ -98,8 +98,11 @@ autoreq :Mechanize, 'mechanize'
|
|
98
98
|
autoreq :HTTP, 'http'
|
99
99
|
|
100
100
|
autoreq :Nokogiri, 'nokogiri'
|
101
|
-
autoreq :Oga, 'oga'
|
102
101
|
autoreq :Ox, 'ox'
|
102
|
+
autoreq :Oga do
|
103
|
+
require 'oga'
|
104
|
+
require 'epitools/gem_ext/oga'
|
105
|
+
end
|
103
106
|
|
104
107
|
autoreq :ANSI, 'ansi'
|
105
108
|
|
data/lib/epitools/clitools.rb
CHANGED
@@ -247,3 +247,13 @@ end
|
|
247
247
|
def curl_json(url)
|
248
248
|
JSON.parse(curl(url))
|
249
249
|
end
|
250
|
+
|
251
|
+
def cached_curl(url)
|
252
|
+
cache = "/tmp/curl-#{url.sha1}.cache"
|
253
|
+
if File.exist?(cache)
|
254
|
+
$stderr.puts "cached! => #{cache}"
|
255
|
+
else
|
256
|
+
File.write(cache, curl(url))
|
257
|
+
end
|
258
|
+
File.read(cache)
|
259
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
|
2
|
+
module Oga
|
3
|
+
module XML
|
4
|
+
# Serialize this node to HAML
|
5
|
+
module ElementToHAML
|
6
|
+
def to_haml
|
7
|
+
require 'html2haml'
|
8
|
+
require 'html2haml/html'
|
9
|
+
Html2haml::HTML.new(to_xml, {}).render.rstrip
|
10
|
+
end
|
11
|
+
alias_method :haml, :to_haml
|
12
|
+
|
13
|
+
def pretty
|
14
|
+
require 'coderay'
|
15
|
+
puts CodeRay.scan(haml, :haml).term
|
16
|
+
end
|
17
|
+
#alias_method :pp, :pretty
|
18
|
+
end
|
19
|
+
|
20
|
+
module PrettyNodeSet
|
21
|
+
def pretty
|
22
|
+
require 'coderay'
|
23
|
+
lesspipe(wrap: true) { |less| each { |node| less.puts CodeRay.scan(node.to_haml, :haml).term; less.puts; less.puts } }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
Oga::XML::Element.include Oga::XML::ElementToHAML
|
31
|
+
Oga::XML::NodeSet.include Oga::XML::PrettyNodeSet
|
data/lib/epitools/path.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epitools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.134
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- epitron
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- lib/epitools/core_ext/truthiness.rb
|
70
70
|
- lib/epitools/core_ext/uri.rb
|
71
71
|
- lib/epitools/daemonize.rb
|
72
|
+
- lib/epitools/gem_ext/oga.rb
|
72
73
|
- lib/epitools/hexdump.rb
|
73
74
|
- lib/epitools/iter.rb
|
74
75
|
- lib/epitools/its.rb
|
@@ -142,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
143
|
- !ruby/object:Gem::Version
|
143
144
|
version: '0'
|
144
145
|
requirements: []
|
145
|
-
rubygems_version: 3.2.
|
146
|
+
rubygems_version: 3.2.21
|
146
147
|
signing_key:
|
147
148
|
specification_version: 3
|
148
149
|
summary: Not utils... METILS!
|