curlyq 0.0.4 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.irbrc +4 -0
- data/CHANGELOG.md +36 -0
- data/Gemfile.lock +30 -7
- data/README.md +260 -17
- data/Rakefile +32 -4
- data/bin/curlyq +114 -52
- data/curlyq.gemspec +7 -3
- data/lib/curly/array.rb +80 -55
- data/lib/curly/curl/html.rb +71 -54
- data/lib/curly/hash.rb +59 -7
- data/lib/curly/version.rb +1 -1
- data/src/_README.md +239 -1
- data/test/curlyq_extract_test.rb +43 -0
- data/test/curlyq_headlinks_test.rb +32 -0
- data/test/curlyq_html_test.rb +25 -0
- data/test/curlyq_images_test.rb +27 -0
- data/test/curlyq_json_test.rb +33 -0
- data/test/curlyq_links_test.rb +20 -0
- data/test/curlyq_scrape_test.rb +22 -0
- data/test/curlyq_tags_test.rb +31 -0
- data/test/helpers/curlyq-helpers.rb +29 -0
- data/test/helpers/fake_std_out.rb +30 -0
- data/test/helpers/threaded_tests.rb +182 -0
- data/test/test_helper.rb +7 -2
- metadata +101 -9
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
require 'helpers/curlyq-helpers'
|
7
|
+
require 'test_helper'
|
8
|
+
|
9
|
+
# Tests for tags command
|
10
|
+
class CurlyQTagsTest < Test::Unit::TestCase
|
11
|
+
include CurlyQHelpers
|
12
|
+
|
13
|
+
def setup
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_extract_inclusive
|
17
|
+
result = curlyq('extract', '-i', '-b', 'Adding', '-a', 'accessing the source.', 'https://stackoverflow.com/questions/52428409/get-fully-rendered-html-using-selenium-webdriver-and-python')
|
18
|
+
json = JSON.parse(result)
|
19
|
+
|
20
|
+
assert_match(/^Adding <code>time.sleep\(10\)<\/code>.*?accessing the source.$/, json[0], 'Match should be found and include the before and after strings')
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_extract_exclusive
|
24
|
+
result = curlyq('extract', '-b', 'Adding', '-a', 'accessing the source.', 'https://stackoverflow.com/questions/52428409/get-fully-rendered-html-using-selenium-webdriver-and-python')
|
25
|
+
json = JSON.parse(result)
|
26
|
+
|
27
|
+
assert_match(/^ <code>time.sleep\(10\)<\/code>.*?when I was $/, json[0], 'Match should be found and not include the before and after strings')
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_extract_regex_inclusive
|
31
|
+
result = curlyq('extract', '-ri', '-b', '.dding <', '-a', 'accessing.*?source.', 'https://stackoverflow.com/questions/52428409/get-fully-rendered-html-using-selenium-webdriver-and-python')
|
32
|
+
json = JSON.parse(result)
|
33
|
+
|
34
|
+
assert_match(/^Adding <code>time.sleep\(10\)<\/code>.*?accessing the source.$/, json[0], 'Match should be found and include the before and after strings')
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_extract_regex_exclusive
|
38
|
+
result = curlyq('extract', '-r', '-b', '.dding <', '-a', 'accessing.*?source.', 'https://stackoverflow.com/questions/52428409/get-fully-rendered-html-using-selenium-webdriver-and-python')
|
39
|
+
json = JSON.parse(result)
|
40
|
+
|
41
|
+
assert_match(/^code>time.sleep\(10\)<\/code>.*?when I was $/, json[0], 'Match should be found and not include the before and after strings')
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
require 'helpers/curlyq-helpers'
|
7
|
+
require 'test_helper'
|
8
|
+
|
9
|
+
# Tests for tags command
|
10
|
+
class CurlyQHeadlinksTest < Test::Unit::TestCase
|
11
|
+
include CurlyQHelpers
|
12
|
+
|
13
|
+
def setup
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_headlinks_query
|
17
|
+
result = curlyq('headlinks', '-q', '[rel=stylesheet]', 'https://brettterpstra.com')
|
18
|
+
json = JSON.parse(result)
|
19
|
+
|
20
|
+
assert_match(/stylesheet/, json['rel'], 'Should have retrieved a single result with rel stylesheet')
|
21
|
+
assert_match(/screen\.\d+\.css$/, json['href'], 'Stylesheet should be correct primary stylesheet')
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_headlinks
|
25
|
+
result = curlyq('headlinks', 'https://brettterpstra.com')
|
26
|
+
json = JSON.parse(result)
|
27
|
+
|
28
|
+
assert_equal(Array, json.class, 'Should have an array of results')
|
29
|
+
assert(json.count > 1, 'Should have more than one link')
|
30
|
+
# assert(json[0].count.positive?)
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
require 'helpers/curlyq-helpers'
|
7
|
+
require 'test_helper'
|
8
|
+
|
9
|
+
# Tests for tags command
|
10
|
+
class CurlyQHtmlTest < Test::Unit::TestCase
|
11
|
+
include CurlyQHelpers
|
12
|
+
|
13
|
+
def test_html_search_query
|
14
|
+
result = curlyq('html', '-s', '#main article .aligncenter', '-q', 'images[1]', 'https://brettterpstra.com')
|
15
|
+
json = JSON.parse(result)
|
16
|
+
|
17
|
+
assert_match(/aligncenter/, json[0]['class'], 'Should have found an image with class "aligncenter"')
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_html_query
|
21
|
+
result = curlyq('html', '-q', 'meta.title', 'https://brettterpstra.com/2024/01/10/introducing-curlyq-a-pipeline-oriented-curl-helper/')
|
22
|
+
|
23
|
+
assert_match(/Introducing CurlyQ/, result, 'Should have retrived the page title')
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
require 'helpers/curlyq-helpers'
|
7
|
+
require 'test_helper'
|
8
|
+
|
9
|
+
# Tests for tags command
|
10
|
+
class CurlyQImagesTest < Test::Unit::TestCase
|
11
|
+
include CurlyQHelpers
|
12
|
+
|
13
|
+
def test_images_query
|
14
|
+
result = curlyq('images', '-t', 'img', '-q', '[alt$=screenshot]', 'https://brettterpstra.com/2024/01/08/keyboard-maestro-giveaway/')
|
15
|
+
json = JSON.parse(result)
|
16
|
+
|
17
|
+
assert(json.count == 1, 'Should have found 1 image')
|
18
|
+
assert_match(/Keyboard Maestro screenshot/, json[0]['alt'], 'Should match Keyboard Meastro screenshot')
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_images_type
|
22
|
+
result = curlyq('images', '-t', 'srcset', 'https://brettterpstra.com/')
|
23
|
+
json = JSON.parse(result)
|
24
|
+
|
25
|
+
assert(json.count.positive?, 'Should have found at least 1 image')
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
require 'helpers/curlyq-helpers'
|
7
|
+
require 'test_helper'
|
8
|
+
|
9
|
+
# Tests for tags command
|
10
|
+
class CurlyQJsonTest < Test::Unit::TestCase
|
11
|
+
include CurlyQHelpers
|
12
|
+
|
13
|
+
def setup
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_json
|
17
|
+
result = curlyq('json', 'https://brettterpstra.com/scripts/giveaways_wrapper.cgi?v=203495&giveaway=hazel2023&action=count')
|
18
|
+
json = JSON.parse(result)
|
19
|
+
|
20
|
+
assert_equal(json.class, Hash, 'Single result should be a hash')
|
21
|
+
assert_equal(286, json['json']['total'], 'json.total should match 286')
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_query
|
25
|
+
result1 = curlyq('json', '-q', 'total', 'https://brettterpstra.com/scripts/giveaways_wrapper.cgi?v=203495&giveaway=hazel2023&action=count')
|
26
|
+
result2 = curlyq('json', '-q', 'json.total', 'https://brettterpstra.com/scripts/giveaways_wrapper.cgi?v=203495&giveaway=hazel2023&action=count')
|
27
|
+
json1 = JSON.parse(result1)
|
28
|
+
json2 = JSON.parse(result2)
|
29
|
+
|
30
|
+
assert_equal(286, json1, 'Should be 286')
|
31
|
+
assert_equal(286, json2, 'Including json in dot path should yeild same result')
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
require 'helpers/curlyq-helpers'
|
7
|
+
require 'test_helper'
|
8
|
+
|
9
|
+
# Tests for tags command
|
10
|
+
class CurlyQLinksTest < Test::Unit::TestCase
|
11
|
+
include CurlyQHelpers
|
12
|
+
|
13
|
+
def test_links
|
14
|
+
result = curlyq('links', '-q', '[content*=twitter]', 'https://stackoverflow.com/questions/52428409/get-fully-rendered-html-using-selenium-webdriver-and-python')
|
15
|
+
json = JSON.parse(result)
|
16
|
+
|
17
|
+
assert(json.count.positive?, 'Should be at least 1 match')
|
18
|
+
assert_match(/twitter.com/, json[0]['href'], 'Should be a link to Twitter')
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
require 'helpers/curlyq-helpers'
|
7
|
+
require 'test_helper'
|
8
|
+
|
9
|
+
# Tests for tags command
|
10
|
+
class CurlyQScrapeTest < Test::Unit::TestCase
|
11
|
+
include CurlyQHelpers
|
12
|
+
|
13
|
+
def setup
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_scrape
|
17
|
+
result = curlyq('scrape', '-b', 'firefox', '-q', 'links[rel=me&content*=mastodon][0]', 'https://brettterpstra.com/2024/01/10/introducing-curlyq-a-pipeline-oriented-curl-helper/')
|
18
|
+
json = JSON.parse(result)
|
19
|
+
|
20
|
+
assert_match(/Mastodon/, json['content'], 'Should have retrieved a Mastodon link')
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
require 'helpers/curlyq-helpers'
|
7
|
+
require 'test_helper'
|
8
|
+
|
9
|
+
# Tests for tags command
|
10
|
+
class CurlyQTagsTest < Test::Unit::TestCase
|
11
|
+
include CurlyQHelpers
|
12
|
+
|
13
|
+
def setup
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_tags
|
17
|
+
result = curlyq('tags', '--search', '#main .post h3', '-q', 'attrs[id*=what]', 'https://brettterpstra.com/2024/01/10/introducing-curlyq-a-pipeline-oriented-curl-helper/')
|
18
|
+
json = JSON.parse(result)
|
19
|
+
|
20
|
+
assert_equal(json.count, 1, 'Should have 1 result')
|
21
|
+
assert_match(/whats-next/, json[0]['attrs']['id'], 'Should have matched #whats-next')
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_clean
|
25
|
+
result = curlyq('tags', '--search', '#main section.related', '--clean', 'https://brettterpstra.com/2024/01/10/introducing-curlyq-a-pipeline-oriented-curl-helper/')
|
26
|
+
json = JSON.parse(result)
|
27
|
+
|
28
|
+
assert_equal(json.count, 1, 'Should have 1 result')
|
29
|
+
assert_match(%r{Last.fm</h5></a></li>}, json[0]['source'], 'Should have matched #whats-next')
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'open3'
|
2
|
+
require 'time'
|
3
|
+
$LOAD_PATH.unshift File.join(__dir__, '..', '..', 'lib')
|
4
|
+
require 'curly'
|
5
|
+
|
6
|
+
module CurlyQHelpers
|
7
|
+
CURLYQ_EXEC = File.join(File.dirname(__FILE__), '..', '..', 'bin', 'curlyq')
|
8
|
+
BUNDLE = '/Users/ttscoff/.asdf/shims/bundle'
|
9
|
+
|
10
|
+
def curlyq_with_env(env, *args, stdin: nil)
|
11
|
+
Dir.chdir(File.expand_path('~/Desktop/Code/curlyq'))
|
12
|
+
pread(env, BUNDLE, 'exec', 'bin/curlyq', *args, stdin: stdin)
|
13
|
+
end
|
14
|
+
|
15
|
+
def curlyq(*args)
|
16
|
+
curlyq_with_env({ 'GLI_DEBUG' => 'true' }, *args)
|
17
|
+
end
|
18
|
+
|
19
|
+
def pread(env, *cmd, stdin: nil)
|
20
|
+
out, err, status = Open3.capture3(env, *cmd, stdin_data: stdin)
|
21
|
+
unless status.success?
|
22
|
+
raise [
|
23
|
+
"Error (#{status}): #{cmd.inspect} failed", "STDOUT:", out.inspect, "STDERR:", err.inspect
|
24
|
+
].join("\n")
|
25
|
+
end
|
26
|
+
|
27
|
+
out
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
class FakeStdOut
|
2
|
+
attr_reader :strings
|
3
|
+
|
4
|
+
def initialize
|
5
|
+
@strings = []
|
6
|
+
end
|
7
|
+
|
8
|
+
def puts(string=nil)
|
9
|
+
@strings << string unless string.nil?
|
10
|
+
end
|
11
|
+
|
12
|
+
def write(x)
|
13
|
+
puts(x)
|
14
|
+
end
|
15
|
+
|
16
|
+
def printf(*args)
|
17
|
+
puts(Kernel.printf(*args))
|
18
|
+
end
|
19
|
+
|
20
|
+
# Returns true if the regexp matches anything in the output
|
21
|
+
def contained?(regexp)
|
22
|
+
strings.find{ |x| x =~ regexp }
|
23
|
+
end
|
24
|
+
|
25
|
+
def flush; end
|
26
|
+
|
27
|
+
def to_s
|
28
|
+
@strings.join("\n")
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,182 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'tty-spinner'
|
4
|
+
require 'tty-progressbar'
|
5
|
+
require 'open3'
|
6
|
+
require 'shellwords'
|
7
|
+
require 'fileutils'
|
8
|
+
require 'pastel'
|
9
|
+
|
10
|
+
class ThreadedTests
|
11
|
+
def run(pattern: '*', max_threads: 8, max_tests: 0)
|
12
|
+
pastel = Pastel.new
|
13
|
+
|
14
|
+
start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
15
|
+
@results = File.expand_path('results.log')
|
16
|
+
|
17
|
+
max_threads = 1000 if max_threads.to_i == 0
|
18
|
+
|
19
|
+
shuffle = false
|
20
|
+
|
21
|
+
unless pattern =~ /shuffle/i
|
22
|
+
pattern = "test/curlyq_*#{pattern}*_test.rb"
|
23
|
+
else
|
24
|
+
pattern = "test/curlyq_*_test.rb"
|
25
|
+
shuffle = true
|
26
|
+
end
|
27
|
+
|
28
|
+
tests = Dir.glob(pattern)
|
29
|
+
|
30
|
+
tests.shuffle! if shuffle
|
31
|
+
|
32
|
+
if max_tests.to_i > 0
|
33
|
+
tests = tests.slice(0, max_tests.to_i - 1)
|
34
|
+
end
|
35
|
+
|
36
|
+
puts pastel.cyan("#{tests.count} test files")
|
37
|
+
|
38
|
+
banner = "Running tests [:bar] T/A (#{max_threads.to_s} threads)"
|
39
|
+
|
40
|
+
progress = TTY::ProgressBar::Multi.new(banner,
|
41
|
+
width: 12,
|
42
|
+
clear: true,
|
43
|
+
hide_cursor: true)
|
44
|
+
@children = []
|
45
|
+
tests.each do |t|
|
46
|
+
test_name = File.basename(t, '.rb').sub(/curlyq_(.*?)_test/, '\1')
|
47
|
+
new_sp = progress.register("[:bar] #{test_name}:status",
|
48
|
+
total: tests.count + 8,
|
49
|
+
width: 1,
|
50
|
+
head: ' ',
|
51
|
+
unknown: ' ',
|
52
|
+
hide_cursor: true,
|
53
|
+
clear: true)
|
54
|
+
status = ': waiting'
|
55
|
+
@children.push([test_name, new_sp, status])
|
56
|
+
end
|
57
|
+
|
58
|
+
@elapsed = 0.0
|
59
|
+
@test_total = 0
|
60
|
+
@assrt_total = 0
|
61
|
+
@error_out = []
|
62
|
+
@threads = []
|
63
|
+
@running_tests = []
|
64
|
+
|
65
|
+
begin
|
66
|
+
finish_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
67
|
+
while @children.count.positive?
|
68
|
+
|
69
|
+
slices = @children.slice!(0, max_threads)
|
70
|
+
slices.each { |c| c[1].start }
|
71
|
+
slices.each do |s|
|
72
|
+
@threads << Thread.new do
|
73
|
+
run_test(s)
|
74
|
+
finish_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
@threads.each { |t| t.join }
|
79
|
+
end
|
80
|
+
|
81
|
+
finish_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
82
|
+
|
83
|
+
progress.finish
|
84
|
+
rescue
|
85
|
+
progress.stop
|
86
|
+
ensure
|
87
|
+
msg = @running_tests.map { |t| t[1].format.sub(/^\[:bar\] (.*?):status/, "\\1#{t[2]}") }.join("\n")
|
88
|
+
|
89
|
+
output = []
|
90
|
+
output << if @error_out.count.positive?
|
91
|
+
pastel.red("#{@error_out.count} Issues")
|
92
|
+
else
|
93
|
+
pastel.green('Success')
|
94
|
+
end
|
95
|
+
output << pastel.green("#{@test_total} tests")
|
96
|
+
output << pastel.cyan("#{@assrt_total} assertions")
|
97
|
+
output << pastel.yellow("#{(finish_time - start_time).round(3)}s")
|
98
|
+
puts output.join(', ')
|
99
|
+
|
100
|
+
if @error_out.count.positive?
|
101
|
+
puts @error_out.join(pastel.white("\n----\n"))
|
102
|
+
Process.exit 1
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def run_test(s)
|
108
|
+
pastel = Pastel.new
|
109
|
+
|
110
|
+
bar = s[1]
|
111
|
+
s[2] = ": #{pastel.green('running')}"
|
112
|
+
bar.advance(status: s[2])
|
113
|
+
|
114
|
+
if @running_tests.count.positive?
|
115
|
+
@running_tests.each do |b|
|
116
|
+
prev_bar = b[1]
|
117
|
+
if prev_bar.complete?
|
118
|
+
prev_bar.reset
|
119
|
+
prev_bar.advance(status: b[2])
|
120
|
+
prev_bar.finish
|
121
|
+
else
|
122
|
+
prev_bar.update(head: ' ', unfinished: ' ')
|
123
|
+
prev_bar.advance(status: b[2])
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
@running_tests.push(s)
|
129
|
+
out, _err, status = Open3.capture3(ENV, 'rake', "test:#{s[0]}", stdin_data: nil)
|
130
|
+
time = out.match(/^Finished in (?<time>\d+\.\d+) seconds\./)
|
131
|
+
count = out.match(/^(?<tests>\d+) tests, (?<assrt>\d+) assertions, (?<fails>\d+) failures, (?<errs>\d+) errors/)
|
132
|
+
|
133
|
+
unless status.success? && !count['fails'].to_i.positive? && !count['errs'].to_i.positive?
|
134
|
+
s[2] = if count
|
135
|
+
": #{paste.red(count['fails'])} #{pastel.red('failures')}, #{pastel.red(count['errs'])} #{pastel.red('errors')}"
|
136
|
+
else
|
137
|
+
": #{pastel.red('Unknown Error')}"
|
138
|
+
end
|
139
|
+
bar.update(head: pastel.red('✖'))
|
140
|
+
bar.advance(head: pastel.red('✖'), status: s[2])
|
141
|
+
|
142
|
+
# errs = out.scan(/(?:Failure|Error): [\w_]+\((?:.*?)\):(?:.*?)(?=\n=======)/m)
|
143
|
+
@error_out.push(out)
|
144
|
+
bar.finish
|
145
|
+
|
146
|
+
next_test
|
147
|
+
Thread.exit
|
148
|
+
end
|
149
|
+
|
150
|
+
s[2] = [
|
151
|
+
': ',
|
152
|
+
pastel.green(count['tests']),
|
153
|
+
'/',
|
154
|
+
pastel.cyan(count['assrt']),
|
155
|
+
' ',
|
156
|
+
pastel.yellow(time['time'].to_f.round(3).to_s),
|
157
|
+
's'
|
158
|
+
].join('')
|
159
|
+
bar.update(head: pastel.green('✔'))
|
160
|
+
bar.advance(head: pastel.green('✔'), status: s[2])
|
161
|
+
@test_total += count['tests'].to_i
|
162
|
+
@assrt_total += count['assrt'].to_i
|
163
|
+
@elapsed += time['time'].to_f
|
164
|
+
|
165
|
+
bar.finish
|
166
|
+
|
167
|
+
next_test
|
168
|
+
end
|
169
|
+
|
170
|
+
def next_test
|
171
|
+
if @children.count.positive?
|
172
|
+
t = Thread.new do
|
173
|
+
s = @children.shift
|
174
|
+
# s[1].start
|
175
|
+
# s[1].advance(status: ": #{'running'.green}")
|
176
|
+
run_test(s)
|
177
|
+
end
|
178
|
+
|
179
|
+
t.join
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -1,4 +1,9 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'test/unit'
|
3
4
|
# Add test libraries you want to use here, e.g. mocha
|
4
|
-
|
5
|
+
|
6
|
+
class Test::Unit::TestCase
|
7
|
+
ENV['TZ'] = 'UTC'
|
8
|
+
# Add global extensions to the test case class here
|
9
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: curlyq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -16,42 +16,48 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0
|
19
|
+
version: '13.0'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 13.0.1
|
20
23
|
type: :development
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - "~>"
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0
|
29
|
+
version: '13.0'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 13.0.1
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rdoc
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
39
|
+
version: 6.3.1
|
34
40
|
type: :development
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
44
|
- - "~>"
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
46
|
+
version: 6.3.1
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
48
|
+
name: test-unit
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
45
51
|
- - "~>"
|
46
52
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
53
|
+
version: 3.4.4
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
58
|
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
60
|
+
version: 3.4.4
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: yard
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,6 +78,80 @@ dependencies:
|
|
72
78
|
- - ">="
|
73
79
|
- !ruby/object:Gem::Version
|
74
80
|
version: 0.9.26
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: tty-spinner
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - "~>"
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0.9'
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 0.9.3
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - "~>"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0.9'
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: 0.9.3
|
101
|
+
- !ruby/object:Gem::Dependency
|
102
|
+
name: tty-progressbar
|
103
|
+
requirement: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - "~>"
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0.18'
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.18.2
|
111
|
+
type: :development
|
112
|
+
prerelease: false
|
113
|
+
version_requirements: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0.18'
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: 0.18.2
|
121
|
+
- !ruby/object:Gem::Dependency
|
122
|
+
name: pastel
|
123
|
+
requirement: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - "~>"
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: 0.8.0
|
128
|
+
type: :development
|
129
|
+
prerelease: false
|
130
|
+
version_requirements: !ruby/object:Gem::Requirement
|
131
|
+
requirements:
|
132
|
+
- - "~>"
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: 0.8.0
|
135
|
+
- !ruby/object:Gem::Dependency
|
136
|
+
name: parallel_tests
|
137
|
+
requirement: !ruby/object:Gem::Requirement
|
138
|
+
requirements:
|
139
|
+
- - "~>"
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '3.7'
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: 3.7.3
|
145
|
+
type: :development
|
146
|
+
prerelease: false
|
147
|
+
version_requirements: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "~>"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '3.7'
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: 3.7.3
|
75
155
|
- !ruby/object:Gem::Dependency
|
76
156
|
name: gli
|
77
157
|
requirement: !ruby/object:Gem::Requirement
|
@@ -139,6 +219,7 @@ extra_rdoc_files:
|
|
139
219
|
files:
|
140
220
|
- ".github/FUNDING.yml"
|
141
221
|
- ".gitignore"
|
222
|
+
- ".irbrc"
|
142
223
|
- CHANGELOG.md
|
143
224
|
- Gemfile
|
144
225
|
- Gemfile.lock
|
@@ -158,7 +239,18 @@ files:
|
|
158
239
|
- lib/curly/string.rb
|
159
240
|
- lib/curly/version.rb
|
160
241
|
- src/_README.md
|
242
|
+
- test/curlyq_extract_test.rb
|
243
|
+
- test/curlyq_headlinks_test.rb
|
244
|
+
- test/curlyq_html_test.rb
|
245
|
+
- test/curlyq_images_test.rb
|
246
|
+
- test/curlyq_json_test.rb
|
247
|
+
- test/curlyq_links_test.rb
|
248
|
+
- test/curlyq_scrape_test.rb
|
249
|
+
- test/curlyq_tags_test.rb
|
161
250
|
- test/default_test.rb
|
251
|
+
- test/helpers/curlyq-helpers.rb
|
252
|
+
- test/helpers/fake_std_out.rb
|
253
|
+
- test/helpers/threaded_tests.rb
|
162
254
|
- test/test_helper.rb
|
163
255
|
homepage: https://brettterpstra.com
|
164
256
|
licenses:
|