yobi-http 0.4.1 → 0.6.0
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
- data/CHANGELOG.md +8 -0
- data/exe/yobi +17 -1
- data/lib/yobi.rb +1 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8300927c161636f736c477436c29cc441b79847df717a899a465fd0f129cec13
|
|
4
|
+
data.tar.gz: d6d693cabeea337129547854608fa394a23b870d89f4f60e3d975960a7bcf1cb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: df1eda58dbc36deb0719785872684adc9fbfa43f033e3ded3ff737792e4bf763a3dd98ab0452db1da4f96ce3fdf4450f73d865e13a061b67eef907c4510d2700
|
|
7
|
+
data.tar.gz: 16d5746464e6619d3dee0725b04b0c0cfd723860f2bd952ba0500f4bc1c238e262aaf521f75d2f92310ef0440bdeadc10ee1f704fc1581f00c06780acd99d054
|
data/CHANGELOG.md
CHANGED
data/exe/yobi
CHANGED
|
@@ -60,6 +60,10 @@ parser = OptionParser.new do |opts|
|
|
|
60
60
|
@options[:offline] = true
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
+
opts.on("-o", "--output FILE", "Write output to a file instead of STDOUT") do |file|
|
|
64
|
+
@options[:output] = file
|
|
65
|
+
end
|
|
66
|
+
|
|
63
67
|
opts.on("-v", "--verbose", "Print detailed request and response information") do
|
|
64
68
|
@options[:verbose] = true
|
|
65
69
|
end
|
|
@@ -107,6 +111,12 @@ end
|
|
|
107
111
|
|
|
108
112
|
pp [method, url, data, headers, @options, ARGV] if ENV["YOBI_DEBUG"]
|
|
109
113
|
|
|
114
|
+
if @options[:offline]
|
|
115
|
+
Net::HTTP.class_eval do
|
|
116
|
+
def connect; end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
110
120
|
Net::HTTP.start(URI(url).host, URI(url).port, use_ssl: URI(url).scheme == "https") do |http|
|
|
111
121
|
options = @options
|
|
112
122
|
request_class = Net::HTTP.const_get(method.capitalize)
|
|
@@ -162,5 +172,11 @@ Net::HTTP.start(URI(url).host, URI(url).port, use_ssl: URI(url).scheme == "https
|
|
|
162
172
|
end
|
|
163
173
|
|
|
164
174
|
view = Yobi.view(:output)
|
|
165
|
-
|
|
175
|
+
|
|
176
|
+
if options[:output]
|
|
177
|
+
file = File.expand_path(options[:output], Dir.pwd)
|
|
178
|
+
File.write(file, ERB.new(view).result(binding), mode: "w")
|
|
179
|
+
else
|
|
180
|
+
puts TTY::Markdown.parse(ERB.new(view).result(binding), color: :always)
|
|
181
|
+
end
|
|
166
182
|
end
|
data/lib/yobi.rb
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
$LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
|
|
4
|
-
|
|
5
3
|
require "yobi/http"
|
|
6
4
|
|
|
7
5
|
# Yobi Http CLI client namespace
|
|
@@ -10,7 +8,7 @@ module Yobi
|
|
|
10
8
|
class Error < StandardError; end
|
|
11
9
|
|
|
12
10
|
# Yobi gem version
|
|
13
|
-
VERSION = "0.
|
|
11
|
+
VERSION = "0.6.0"
|
|
14
12
|
|
|
15
13
|
|
|
16
14
|
def self.name
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yobi-http
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel Vinciguerra
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-02-
|
|
10
|
+
date: 2026-02-16 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: tty-markdown
|