gist 6.0.0 → 6.1.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 (6) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -0
  3. data/bin/gist +2 -1
  4. data/lib/gist.rb +6 -6
  5. data/vendor/json.rb +3 -3
  6. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78e3d009d0e3e3a535d20e8d7e0582705c6ea61308958c3f59a4d4a2e365fa3c
4
- data.tar.gz: 23df778298090151ce7e2b8f3dbb8f97786bc7d576f218be1aeb454123090e91
3
+ metadata.gz: a81ce3967b1095ead6ba1ca877a9c3f6de348de6a30b0f3d43489bbde1e82d2f
4
+ data.tar.gz: adc00b10a3514227ecfe8250a0a22af8df929e3cbffec78d33b0ec3cbf52dc2c
5
5
  SHA512:
6
- metadata.gz: 70506cc45562b725085e2f10d5627a3ac4c700fa6e599e39a6625629fbd2c63903b2d42a4a95d9642f0ac01893bd8de27d72acb7e4622eaa44ab4ea96b08840c
7
- data.tar.gz: b3476f46cb844603a169e3a67fae3bb37e5399494ddec6c78178f4bb664a90cda642c5be780ea007d12e96cc96312f695b86827872bc4947603c092a4e3d6774
6
+ metadata.gz: 450ee25c8f289acb02aa085ffe140801ed32ead7679f98d2e426315e2586c63224304dc4660820a80d75c3c6b011794cc53b6815d8754bddf4ba592b950197e7
7
+ data.tar.gz: 5831bd45e6d92a280e91ff4c7b28b635920480de9c663d473b37d3510cb5fe881d47583b976a5d7531e54df00cfdfa42ffe44ccb3be55ffb0f4829b38a2068ab
data/README.md CHANGED
@@ -25,6 +25,11 @@ upload content to https://gist.github.com/.
25
25
 
26
26
  pkg install gist
27
27
 
28
+ ‌For Ubuntu/Debian
29
+
30
+ apt install gist
31
+
32
+ Note: Debian renames the binary to `gist-paste` to avoid a name conflict.
28
33
 
29
34
  ## Command
30
35
 
data/bin/gist CHANGED
@@ -173,7 +173,8 @@ begin
173
173
 
174
174
  if options.key? :read
175
175
  file_name = ARGV.first
176
- Gist.read_gist(options[:read], file_name)
176
+ output = Gist.read_gist(options[:read], file_name)
177
+ puts output if output
177
178
  exit
178
179
  end
179
180
 
data/lib/gist.rb CHANGED
@@ -12,7 +12,7 @@ end
12
12
  module Gist
13
13
  extend self
14
14
 
15
- VERSION = '6.0.0'
15
+ VERSION = '6.1.0'
16
16
 
17
17
  # A list of clipboard commands with copy and paste support.
18
18
  CLIPBOARD_COMMANDS = {
@@ -103,7 +103,7 @@ module Gist
103
103
  # @option options [Boolean] :skip_empty (false) Skip gisting empty files.
104
104
  # @option options [Symbol] :output (:all) The type of return value you'd like:
105
105
  # :html_url gives a String containing the url to the gist in a browser
106
- # :short_url gives a String contianing a git.io url that redirects to html_url
106
+ # :short_url gives a String containing a git.io url that redirects to html_url
107
107
  # :javascript gives a String containing a script tag suitable for embedding the gist
108
108
  # :all gives a Hash containing the parsed json response from the server
109
109
  #
@@ -212,10 +212,10 @@ module Gist
212
212
  get_gist_pages(url, auth_token())
213
213
  end
214
214
 
215
- def read_gist(id, file_name=nil)
215
+ def read_gist(id, file_name=nil, options={})
216
216
  url = "#{base_path}/gists/#{id}"
217
217
 
218
- access_token = auth_token()
218
+ access_token = (options[:access_token] || auth_token())
219
219
 
220
220
  request = Net::HTTP::Get.new(url)
221
221
  request['Authorization'] = "token #{access_token}" if access_token.to_s != ''
@@ -232,7 +232,7 @@ module Gist
232
232
  file = files.values.first
233
233
  end
234
234
 
235
- puts file["content"]
235
+ file["content"]
236
236
  else
237
237
  raise Error, "Gist with id of #{id} does not exist."
238
238
  end
@@ -464,7 +464,7 @@ module Gist
464
464
  end
465
465
  if uri.scheme == "https"
466
466
  connection.use_ssl = true
467
- connection.verify_mode = OpenSSL::SSL::VERIFY_NONE
467
+ connection.verify_mode = OpenSSL::SSL::VERIFY_PEER
468
468
  end
469
469
  connection.open_timeout = 10
470
470
  connection.read_timeout = 10
data/vendor/json.rb CHANGED
@@ -44,7 +44,7 @@ module JSON
44
44
  /(?=\*/) # single slash before this comment's end
45
45
  )*
46
46
  \*/ # the End of this comment
47
- |[ \t\r\n]+ # whitespaces: space, horicontal tab, lf, cr
47
+ |[ \t\r\n]+ # whitespaces: space, horizontal tab, lf, cr
48
48
  )+
49
49
  )mx
50
50
 
@@ -64,7 +64,7 @@ module JSON
64
64
  # (keys) in a JSON object. Otherwise strings are returned, which is also
65
65
  # the default.
66
66
  # * *create_additions*: If set to false, the Parser doesn't create
67
- # additions even if a matchin class and create_id was found. This option
67
+ # additions even if a matching class and create_id was found. This option
68
68
  # defaults to true.
69
69
  # * *object_class*: Defaults to Hash
70
70
  # * *array_class*: Defaults to Array
@@ -1265,7 +1265,7 @@ module ::Kernel
1265
1265
  nil
1266
1266
  end
1267
1267
 
1268
- # Ouputs _objs_ to STDOUT as JSON strings in a pretty format, with
1268
+ # Outputs _objs_ to STDOUT as JSON strings in a pretty format, with
1269
1269
  # indentation and over many lines.
1270
1270
  def jj(*objs)
1271
1271
  objs.each do |obj|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gist
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Conrad Irwin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-08-27 00:00:00.000000000 Z
12
+ date: 2026-06-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  - !ruby/object:Gem::Version
113
113
  version: '0'
114
114
  requirements: []
115
- rubygems_version: 3.0.3
115
+ rubygems_version: 3.0.3.1
116
116
  signing_key:
117
117
  specification_version: 4
118
118
  summary: Just allows you to upload gists