sinew 1.0.4 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.rubocop.yml +49 -0
- data/.travis.yml +4 -0
- data/.vscode/extensions.json +3 -0
- data/.vscode/settings.json +15 -0
- data/Gemfile +1 -1
- data/README.md +153 -12
- data/Rakefile +13 -14
- data/bin/sinew +40 -20
- data/lib/sinew.rb +10 -6
- data/lib/sinew/cache.rb +79 -0
- data/lib/sinew/core_ext.rb +59 -0
- data/lib/sinew/dsl.rb +98 -0
- data/lib/sinew/main.rb +80 -149
- data/lib/sinew/nokogiri_ext.rb +10 -9
- data/lib/sinew/output.rb +126 -0
- data/lib/sinew/request.rb +148 -0
- data/lib/sinew/response.rb +75 -0
- data/lib/sinew/runtime_options.rb +26 -0
- data/lib/sinew/version.rb +1 -1
- data/sample.sinew +5 -3
- data/sinew.gemspec +24 -19
- data/test/test.html +40 -34
- data/test/test_cache.rb +69 -0
- data/test/test_helper.rb +113 -0
- data/test/test_main.rb +36 -91
- data/test/test_nokogiri_ext.rb +14 -15
- data/test/test_output.rb +73 -0
- data/test/test_requests.rb +135 -0
- data/test/test_utf8.rb +39 -0
- metadata +103 -48
- data/lib/sinew/curler.rb +0 -173
- data/lib/sinew/text_util.rb +0 -101
- data/lib/sinew/util.rb +0 -236
- data/test/helper.rb +0 -64
- data/test/test_curler.rb +0 -70
- data/test/test_text_util.rb +0 -23
data/test/test_text_util.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
require "helper"
|
2
|
-
|
3
|
-
module Sinew
|
4
|
-
class TestTextUtil < TestCase
|
5
|
-
def test_tidy
|
6
|
-
tidy = TextUtil.html_tidy(HTML)
|
7
|
-
# tags removed?
|
8
|
-
assert(tidy !~ /script|meta/)
|
9
|
-
# squished?
|
10
|
-
assert(tidy !~ / /)
|
11
|
-
# comments removed?
|
12
|
-
assert(tidy !~ /<!--/)
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_clean
|
16
|
-
clean = TextUtil.html_clean(HTML)
|
17
|
-
# attributes removed
|
18
|
-
assert(clean !~ /will_be_removed/)
|
19
|
-
# attributes preserved
|
20
|
-
assert(clean =~ /will_be_preserved/)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|