nokorexi 0.5.5 → 0.6.0

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: 25605bfc0ee4f888df2d747607d7f36686b53936719a25583a5e363376aecae2
4
- data.tar.gz: 69a07ae4c77dcd9abc99a6daf37eef062e3c0ebea6dd96eee68fcc6c6cf4cd0c
3
+ metadata.gz: 97e4a26dea2512d1ed2e3935c890d4fb03ab76b71b01dfdc1901a249fb39e9e8
4
+ data.tar.gz: 9eefb201c8db8b392d662bc75bbfa45e70404167b591c0693e7b0bf464353449
5
5
  SHA512:
6
- metadata.gz: d008d96bc2796177243535e371aa7de407ffd9711deb633f3606c802a68ad9474fe1e27679326adae42291b8ffef9563e1e52bb2cb41d95248de279369a59cd1
7
- data.tar.gz: 0ad62669fadf9ec315a333974f35ff7c7ddb407ad7a67bac61e30ec843c1fca49766bb5480002c88ccc5f780c9953ae0a59a10d76ab75bf77ddeaf9dc4a66f2a
6
+ metadata.gz: fffe85ab8d1369ad256f8492a32dd8803471a5344428daa9848c286b2a20fd3d80cee2ae7ae298a9eb2dc9e6312e06a07e64b639fc6248d1cefa7eb8ff308bf9
7
+ data.tar.gz: 7ceaa0f5ebbdfdc46595fc7f2ceb17fb330afe18707d7b93b98e6600b3a13b5bf87539ce758098810c9a78b0e20482887de3ef11292a6055ee4e0779a1ef6aec
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/nokorexi.rb CHANGED
@@ -9,29 +9,35 @@ require 'rxfhelper'
9
9
 
10
10
  class Nokorexi
11
11
 
12
- attr_reader :to_doc, :to_s
12
+ attr_reader :to_doc, :to_doc2, :to_s
13
13
 
14
- def initialize(x, noscript: true, noevents: true, nosvg: true, debug: false)
14
+ def initialize(x, noscript: true, noevents: true, nosvg: true,
15
+ nostyle: true, nolink: true, filter: false, debug: false)
15
16
 
16
17
  raws = RXFHelper.read(x).first
17
18
  s = raws[/.*<\/html>$/m] || raws
18
19
  puts 's: ' + s.inspect if debug
19
20
 
20
- raw_doc = Nokogiri::HTML(s.gsub("&nbsp;",' '))
21
- raw_doc.xpath('//style').each(&:remove)
22
- raw_doc.xpath('//link').each(&:remove)
23
- raw_doc.xpath('//script').each(&:remove) if noscript
24
- raw_doc.xpath('//svg').each(&:remove) if nosvg
21
+ @to_doc2 = raw_doc = Nokogiri::HTML(s.gsub("&nbsp;",' '))
25
22
 
26
- if noevents then
23
+ if filter then
27
24
 
28
- raw_doc.xpath('//*[@onclick]').each do |e|
29
- e.attributes['onclick'].value = ''
30
- end
25
+ raw_doc.xpath('//style').each(&:remove) if nostyle
26
+ raw_doc.xpath('//link').each(&:remove) if nolink
27
+ raw_doc.xpath('//script').each(&:remove) if noscript
28
+ raw_doc.xpath('//svg').each(&:remove) if nosvg
29
+
30
+ if noevents then
31
+
32
+ raw_doc.xpath('//*[@onclick]').each do |e|
33
+ e.attributes['onclick'].value = ''
34
+ end
35
+
36
+ raw_doc.xpath('//*[@onmousedown]').each do |e|
37
+ e.attributes['onmousedown'].value = ''
38
+ end
39
+ end
31
40
 
32
- raw_doc.xpath('//*[@onmousedown]').each do |e|
33
- e.attributes['onmousedown'].value = ''
34
- end
35
41
  end
36
42
 
37
43
  yield(raw_doc) if block_given?
data.tar.gz.sig CHANGED
@@ -1 +1,3 @@
1
- {��b
1
+ q��+Q �$ �a|�&���_��9`̍~�A]�o�R��[���C�6 �����vl,�bj[�@��0d�E�B�z�m�;�$owսl�W�8��z�E 6��'֋]4�N��&�O8�x�t�w�?��0z�u
2
+ ue-��B��LO��K�D�eC�)�ī�=
3
+ ��zX*�挭�K����q����È󱙲-��sd���(�@ֲ����D�3�GMH��NY����9�x���v�2��S�����3��T�V�ޝ<����zd$v�Gg�Q7��ҡc���e���kVy��4y�ެ#hD5&�Ȥ&������?� 7w�o��8�Kv�����n3bD��7�8��+�������b�w���3ۙ
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokorexi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  IfE+n6Nsn4mmYcgqnR+5A8Ut2JnVTJzYZ/lUeIJY3MPjH+7PDAtWb1HltA/iim3A
36
36
  28fDHFSeSGWneCQs80GLobdt
37
37
  -----END CERTIFICATE-----
38
- date: 2022-01-24 00:00:00.000000000 Z
38
+ date: 2022-01-28 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: nokogiri
@@ -83,20 +83,20 @@ dependencies:
83
83
  requirements:
84
84
  - - "~>"
85
85
  - !ruby/object:Gem::Version
86
- version: '1.1'
86
+ version: '1.2'
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 1.1.4
89
+ version: 1.2.1
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '1.1'
96
+ version: '1.2'
97
97
  - - ">="
98
98
  - !ruby/object:Gem::Version
99
- version: 1.1.4
99
+ version: 1.2.1
100
100
  description:
101
101
  email: digital.robertson@gmail.com
102
102
  executables: []
metadata.gz.sig CHANGED
Binary file