curlyq 0.0.6 → 0.0.7

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: 376f17c2844a60ca0932187b1fe2c4c3f487c0bc63fbb44abe3062036b8c394f
4
- data.tar.gz: 9b84f93db1c13dabc20f33b394506619c77272cccb4d2e85f70f6e74cb6238dd
3
+ metadata.gz: 92b27e3065435d17fd5d6129bd640481dee8acf66f9ed82b2b68ae6a7589f463
4
+ data.tar.gz: a5cd5299248fd01d8f12a80a1c9982de4f8e0160ea5033ab96b60677bb9ea2c8
5
5
  SHA512:
6
- metadata.gz: 909543c28f2192856e0168fdd7da20383892a0c8cde67503209bfbbf69831edd79bdd03884426af0e8a78743d3b7344ce4e70a175c059e4c1356eaf949199d01
7
- data.tar.gz: e242883b09cae56ba55df004afe9febba753cdd21d46639b328e0df73322eb18d37187ecdbfc47030ff84c0d46540b4ee7acabffd7aecf4a28facfc4af8e0a24
6
+ metadata.gz: 1348b97fdf89faf44cd0cfc0f2aecc05a679606f19fe57392d588209da26fc3a5c2407569173d41e1497bdf409d762adee0d2533089b5ce27854e298fe98cc13
7
+ data.tar.gz: c80ecd381e1d941d8e8e5ead0dd925682e26a2f8cc639f0202d5b5cd30f025582fc5d5a2665daca3e5e7d0f2099066d3ca3d9ad8ad00b07d2ee5673b122bae01
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 0.0.7
2
+
3
+ 2024-01-12 17:03
4
+
5
+ #### FIXED
6
+
7
+ - Revert back to offering single response (no array) in cases where there are single results (for some commands)
8
+
1
9
  ### 0.0.6
2
10
 
3
11
  2024-01-12 14:44
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- curlyq (0.0.6)
4
+ curlyq (0.0.7)
5
5
  gli (~> 2.21.0)
6
6
  nokogiri (~> 1.16.0)
7
7
  selenium-webdriver (~> 4.16.0)
data/README.md CHANGED
@@ -10,7 +10,7 @@ _If you find this useful, feel free to [buy me some coffee][donate]._
10
10
  [donate]: https://brettterpstra.com/donate
11
11
 
12
12
 
13
- The current version of `curlyq` is 0.0.6
13
+ The current version of `curlyq` is 0.0.7
14
14
  .
15
15
 
16
16
  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.
@@ -44,7 +44,7 @@ SYNOPSIS
44
44
  curlyq [global options] command [command options] [arguments...]
45
45
 
46
46
  VERSION
47
- 0.0.6
47
+ 0.0.7
48
48
 
49
49
  GLOBAL OPTIONS
50
50
  --help - Show this message
data/bin/curlyq CHANGED
@@ -144,7 +144,7 @@ command %i[html curl] do |c|
144
144
  end
145
145
  output.delete_if(&:nil?)
146
146
  output.delete_if(&:empty?)
147
- output = output[0] if output.count == 1
147
+ # output = output[0] if output.count == 1
148
148
  output.map! { |o| o[options[:raw].to_sym] } if options[:raw]
149
149
 
150
150
  print_out(output, global_options[:yaml], raw: options[:raw], pretty: global_options[:pretty])
@@ -240,7 +240,7 @@ command :json do |c|
240
240
  end
241
241
  end
242
242
 
243
- output = output[0] if output.count == 1
243
+ # output = output[0] if output.count == 1
244
244
 
245
245
  print_out(output, global_options[:yaml], pretty: global_options[:pretty])
246
246
  end
data/lib/curly/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Curly
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
data/src/_README.md CHANGED
@@ -10,7 +10,7 @@ _If you find this useful, feel free to [buy me some coffee][donate]._
10
10
  [donate]: https://brettterpstra.com/donate
11
11
  <!--END GITHUB-->
12
12
 
13
- The current version of `curlyq` is <!--VER-->0.0.4<!--END VER-->.
13
+ The current version of `curlyq` is <!--VER-->0.0.6<!--END VER-->.
14
14
 
15
15
  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.
16
16
 
@@ -12,7 +12,7 @@ class CurlyQHtmlTest < Test::Unit::TestCase
12
12
 
13
13
  def test_html_search_query
14
14
  result = curlyq('html', '-s', '#main article .aligncenter', '-q', 'images[1]', 'https://brettterpstra.com')
15
- json = JSON.parse(result)
15
+ json = JSON.parse(result)[0]
16
16
 
17
17
  assert_match(/aligncenter/, json[0]['class'], 'Should have found an image with class "aligncenter"')
18
18
  end
@@ -13,9 +13,9 @@ class CurlyQJsonTest < Test::Unit::TestCase
13
13
  def setup
14
14
  end
15
15
 
16
- def test_json
16
+ def test_json
17
17
  result = curlyq('json', 'https://brettterpstra.com/scripts/giveaways_wrapper.cgi?v=203495&giveaway=hazel2023&action=count')
18
- json = JSON.parse(result)
18
+ json = JSON.parse(result)[0]
19
19
 
20
20
  assert_equal(json.class, Hash, 'Single result should be a hash')
21
21
  assert_equal(286, json['json']['total'], 'json.total should match 286')
@@ -24,8 +24,8 @@ class CurlyQJsonTest < Test::Unit::TestCase
24
24
  def test_query
25
25
  result1 = curlyq('json', '-q', 'total', 'https://brettterpstra.com/scripts/giveaways_wrapper.cgi?v=203495&giveaway=hazel2023&action=count')
26
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)
27
+ json1 = JSON.parse(result1)[0]
28
+ json2 = JSON.parse(result2)[0]
29
29
 
30
30
  assert_equal(286, json1, 'Should be 286')
31
31
  assert_equal(286, json2, 'Including json in dot path should yeild same result')
@@ -132,7 +132,7 @@ class ThreadedTests
132
132
 
133
133
  unless status.success? && !count['fails'].to_i.positive? && !count['errs'].to_i.positive?
134
134
  s[2] = if count
135
- ": #{paste.red(count['fails'])} #{pastel.red('failures')}, #{pastel.red(count['errs'])} #{pastel.red('errors')}"
135
+ ": #{pastel.red(count['fails'])} #{pastel.red('failures')}, #{pastel.red(count['errs'])} #{pastel.red('errors')}"
136
136
  else
137
137
  ": #{pastel.red('Unknown Error')}"
138
138
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: curlyq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra