curlyq 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dbd33a3d0d828e3574fa1dbf41a4237f52cd489a11ca00ab9146753b5a0d4fda
4
- data.tar.gz: 222d5f050317d2c7b12462d65155180fc8e2222d6b05c974f76fbfdc4a65371a
3
+ metadata.gz: 38b735c7b0ead432ad659482e59c4e9385e82fc71063eedda37440dac537e211
4
+ data.tar.gz: f3337ceb067ec0460c8d5ad6fee7b1d088ac07ba15833f550b5b6ea19afc9e4c
5
5
  SHA512:
6
- metadata.gz: 84b926cfda6623ea508582e4c0d03fe99fe0153e4ae40772509922fe0efe00917f28f6176c1144a0c7cfbb80f51591b6d7432143a6fe2b664f552cb65eb2caba
7
- data.tar.gz: b8a81553defeae0797d297937432a3271de65810e9cfaf2d4d4bbde12b54c645940d8674bf2995263f170151c4295a5a73c142851031e9d4f84fd3a66b3f6983
6
+ metadata.gz: ac88bdf60364d157efbefdaa425c8467bd93a65d70ff884f9a6322172a6b3d1858f474eb2ebf30708a9bef18deb8a0cba6358e46e7c9c5af6f9ff80099461701
7
+ data.tar.gz: e2b2894bd450158aba7f62f778a34ac29958a3eef25d13db0b3b37b539165f00d2ea39515be57eb169ba7af93a602f06af6a7dc4d768201c9c5a90ad949580ab
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 0.0.16
2
+
3
+ 2024-11-07 06:45
4
+
5
+ #### FIXED
6
+
7
+ - Encoding error
8
+
1
9
  ### 0.0.15
2
10
 
3
11
  2024-10-25 10:31
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- curlyq (0.0.15)
4
+ curlyq (0.0.16)
5
5
  gli (~> 2.21.0)
6
6
  nokogiri (~> 1.16.0)
7
7
  selenium-webdriver (~> 4.16.0)
@@ -13,16 +13,16 @@ GEM
13
13
  gli (2.21.5)
14
14
  nokogiri (1.16.7-arm64-darwin)
15
15
  racc (~> 1.4)
16
- parallel (1.23.0)
16
+ parallel (1.26.3)
17
17
  parallel_tests (3.13.0)
18
18
  parallel
19
19
  pastel (0.8.0)
20
20
  tty-color (~> 0.5)
21
- power_assert (2.0.3)
21
+ power_assert (2.0.4)
22
22
  racc (1.8.1)
23
- rake (13.1.0)
24
- rdoc (6.3.3)
25
- rexml (3.3.7)
23
+ rake (13.2.1)
24
+ rdoc (6.3.4.1)
25
+ rexml (3.3.9)
26
26
  rubyzip (2.3.2)
27
27
  selenium-webdriver (4.16.0)
28
28
  rexml (~> 3.2, >= 3.2.5)
@@ -42,12 +42,13 @@ GEM
42
42
  tty-spinner (0.9.3)
43
43
  tty-cursor (~> 0.7)
44
44
  tty-which (0.5.0)
45
- unicode-display_width (2.5.0)
46
- websocket (1.2.10)
47
- yard (0.9.34)
45
+ unicode-display_width (2.6.0)
46
+ websocket (1.2.11)
47
+ yard (0.9.37)
48
48
 
49
49
  PLATFORMS
50
50
  arm64-darwin-20
51
+ x86_64-darwin-20
51
52
 
52
53
  DEPENDENCIES
53
54
  curlyq!
data/README.md CHANGED
@@ -13,7 +13,7 @@ _If you find this useful, feel free to [buy me some coffee][donate]._
13
13
  [jq]: https://github.com/jqlang/jq "Command-line JSON processor"
14
14
  [yq]: https://github.com/mikefarah/yq "yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties processor"
15
15
 
16
- The current version of `curlyq` is 0.0.15.
16
+ The current version of `curlyq` is 0.0.16.
17
17
 
18
18
  CurlyQ is a utility that provides a simple interface for curl, with additional features for things like extracting images and links, finding elements by CSS selector or XPath, getting detailed header info, and more. It's designed to be part of a scripting pipeline, outputting everything as structured data (JSON or YAML). It also has rudimentary support for making calls to JSON endpoints easier, but it's expected that you'll use something like [jq] to parse the output.
19
19
 
@@ -46,7 +46,7 @@ SYNOPSIS
46
46
  curlyq [global options] command [command options] [arguments...]
47
47
 
48
48
  VERSION
49
- 0.0.15
49
+ 0.0.16
50
50
 
51
51
  GLOBAL OPTIONS
52
52
  --help - Show this message
@@ -731,10 +731,11 @@ module Curl
731
731
  ]
732
732
  headers = @headers.nil? ? '' : @headers.map { |h, v| %(-H "#{h}: #{v}") }.join(' ')
733
733
  compress = @compressed ? '--compressed' : ''
734
- @source = `#{@curl} -#{flags} #{compress} #{headers} '#{@url}' 2>/dev/null`
734
+ @source = `#{@curl} -#{flags} #{compress} #{headers} '#{@url}' 2>/dev/null`.strip.utf8
735
735
  agent = 0
736
+
736
737
  while @source.nil? || @source.empty?
737
- @source = `#{@curl} -#{flags} #{compress} -A "#{agents[agent]}" #{headers} '#{@url}' 2>/dev/null`
738
+ @source = `#{@curl} -#{flags} #{compress} -A "#{agents[agent]}" #{headers} '#{@url}' 2>/dev/null`.strip.utf8
738
739
  break if agent >= agents.count - 1
739
740
  end
740
741
 
data/lib/curly/string.rb CHANGED
@@ -6,6 +6,24 @@
6
6
  ## @return [String] cleaned string
7
7
  ##
8
8
  class ::String
9
+ ##
10
+ ## Discard invalid characters and output a UTF-8 String
11
+ ##
12
+ ## @return [String] UTF-8 encoded string
13
+ ##
14
+ def utf8
15
+ encode('utf-16', invalid: :replace).encode('utf-8')
16
+ end
17
+
18
+ ##
19
+ ## Destructive version of #utf8
20
+ ##
21
+ ## @return [String] UTF-8 encoded string, in place
22
+ ##
23
+ def utf8!
24
+ replace utf8
25
+ end
26
+
9
27
  ## Remove extra spaces and newlines, compress space
10
28
  ## between tags
11
29
  ##
data/lib/curly/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # Top level module for CurlyQ
2
2
  module Curly
3
3
  # Current version number
4
- VERSION = '0.0.15'
4
+ VERSION = '0.0.16'
5
5
  end
data/src/_README.md CHANGED
@@ -13,7 +13,7 @@ _If you find this useful, feel free to [buy me some coffee][donate]._
13
13
  [jq]: https://github.com/jqlang/jq "Command-line JSON processor"
14
14
  [yq]: https://github.com/mikefarah/yq "yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties processor"
15
15
 
16
- The current version of `curlyq` is <!--VER-->0.0.14<!--END VER-->.
16
+ The current version of `curlyq` is <!--VER-->0.0.15<!--END VER-->.
17
17
 
18
18
  CurlyQ is a utility that provides a simple interface for curl, with additional features for things like extracting images and links, finding elements by CSS selector or XPath, getting detailed header info, and more. It's designed to be part of a scripting pipeline, outputting everything as structured data (JSON or YAML). It also has rudimentary support for making calls to JSON endpoints easier, but it's expected that you'll use something like [jq] to parse the output.
19
19
 
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.15
4
+ version: 0.0.16
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-10-25 00:00:00.000000000 Z
11
+ date: 2024-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake