curltoruby 0.1.0 → 0.1.1
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/curltoruby.rb +8 -5
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 27dbf745f7a52fa725978a437ba7698194c007202e4303f08d0d9532bddf6fd6
|
|
4
|
+
data.tar.gz: e54077d0845d97ae9f7018d709cd48017fa6db898e8b6a13bd6b5d43317a34f7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5739a05c78f6c2889f9c7621ebab2e8fbb1bd83bbd4aae26989f0fffa049abf39188a7767c19a70013db04b3470d4072a61b2fe0033ce552c2b29d086e927a22
|
|
7
|
+
data.tar.gz: 1c29979c91685f49ad417dcd408df9697022693117bf65100286275f9d5dc226c820ab81a993df94de821252c264071a228bd0f652e13c67ab1f9c6974faa3f7
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/lib/curltoruby.rb
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# file: curltoruby.rb
|
|
4
4
|
|
|
5
|
-
# description: Inspired by jhawthorn's curl-to-ruby.
|
|
6
|
-
# see https://jhawthorn.github.io/curl-to-ruby/
|
|
5
|
+
# description: Inspired by jhawthorn's curl-to-ruby. see https://jhawthorn.github.io/curl-to-ruby/
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
require 'lineparser'
|
|
@@ -12,9 +11,11 @@ require 'clipboard'
|
|
|
12
11
|
|
|
13
12
|
class CurlToRuby
|
|
14
13
|
|
|
15
|
-
def initialize(s)
|
|
14
|
+
def initialize(s, debug: false)
|
|
15
|
+
|
|
16
|
+
@debug = debug
|
|
16
17
|
@h = parse(s)
|
|
17
|
-
|
|
18
|
+
|
|
18
19
|
end
|
|
19
20
|
|
|
20
21
|
def to_h()
|
|
@@ -23,8 +24,10 @@ class CurlToRuby
|
|
|
23
24
|
|
|
24
25
|
def to_s()
|
|
25
26
|
|
|
27
|
+
@s = build_code(@h)
|
|
26
28
|
Clipboard.copy @s
|
|
27
29
|
puts 'copied to clipboard'
|
|
30
|
+
|
|
28
31
|
@s
|
|
29
32
|
|
|
30
33
|
end
|
|
@@ -67,7 +70,7 @@ EOF
|
|
|
67
70
|
|
|
68
71
|
def parse(raws)
|
|
69
72
|
|
|
70
|
-
s = raws.gsub(/^\s+/,'')
|
|
73
|
+
s = raws.gsub(/^\s+/,'').gsub(/(-H|--data-raw)/, "\n" + '\0')
|
|
71
74
|
|
|
72
75
|
patterns = [
|
|
73
76
|
[:root, /(?<=curl ')([^']+)/, :url],
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: curltoruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
|
35
35
|
DTFw0mmzJ61f/aZOWaYGhrg0GiDGz7H+D02hgfE5TEiNPDVqtX9gMTOLxxlRKU38
|
|
36
36
|
BxRpOlBnkLtQ7mXTeu2CADfP
|
|
37
37
|
-----END CERTIFICATE-----
|
|
38
|
-
date: 2022-05-
|
|
38
|
+
date: 2022-05-19 00:00:00.000000000 Z
|
|
39
39
|
dependencies:
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: lineparser
|
metadata.gz.sig
CHANGED
|
Binary file
|