yobi-http 0.4.2 → 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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/exe/yobi +11 -1
  4. data/lib/yobi.rb +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4937fd5c0a8ecbbca85c767683dcfd5aa8adbd71416a7fb862b8b0ea4d72c196
4
- data.tar.gz: c0f77512aba7be131c905c1ddbb2d2acbcbaf38e81e22861514a44a1d2996717
3
+ metadata.gz: 8300927c161636f736c477436c29cc441b79847df717a899a465fd0f129cec13
4
+ data.tar.gz: d6d693cabeea337129547854608fa394a23b870d89f4f60e3d975960a7bcf1cb
5
5
  SHA512:
6
- metadata.gz: fc404dcb020fba256ea7651af582a4be53a8b7c4314185e2958ff6357e68a33347ce8a26cd938debec05b276b55b97124aee84edd147ac843fe22da0623bdfd5
7
- data.tar.gz: 5234507ed293ac70c14d2733a60c91378637edefeb0e125cb3f6d187e485f34e8187c1015a94c2d2aade130ce875f5fd15249be87cb372fae3ca356ecb4a069f
6
+ metadata.gz: df1eda58dbc36deb0719785872684adc9fbfa43f033e3ded3ff737792e4bf763a3dd98ab0452db1da4f96ce3fdf4450f73d865e13a061b67eef907c4510d2700
7
+ data.tar.gz: 16d5746464e6619d3dee0725b04b0c0cfd723860f2bd952ba0500f4bc1c238e262aaf521f75d2f92310ef0440bdeadc10ee1f704fc1581f00c06780acd99d054
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.6.0]
4
+
5
+ - Add output to file feature
6
+
3
7
  ## [0.4.2]
8
+
4
9
  - Fix prevent request connection in offline mode
5
10
 
6
11
  ## [0.4.1]
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
@@ -168,5 +172,11 @@ Net::HTTP.start(URI(url).host, URI(url).port, use_ssl: URI(url).scheme == "https
168
172
  end
169
173
 
170
174
  view = Yobi.view(:output)
171
- puts TTY::Markdown.parse(ERB.new(view).result(binding), color: :always)
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
172
182
  end
data/lib/yobi.rb CHANGED
@@ -8,7 +8,7 @@ module Yobi
8
8
  class Error < StandardError; end
9
9
 
10
10
  # Yobi gem version
11
- VERSION = "0.4.2"
11
+ VERSION = "0.6.0"
12
12
 
13
13
 
14
14
  def self.name
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yobi-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Vinciguerra