New Upstream Snapshot - gist

Ready changes

Summary

Merged new upstream version: 6.0.0+git20220530.1.232b69c (was: 6.0.0).

Resulting package

Built on 2023-01-05T21:17 (took 13m52s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots gist

Lintian Result

Diff

diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index a7042c8..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-.rvmrc
-Gemfile.lock
-
-# OS X
-.DS_Store
-.yardoc
-doc
-*.gem
diff --git a/README.md b/README.md
index c55f322..24a44ce 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,11 @@ upload content to https://gist.github.com/.
 
     pkg install gist
 
+<200c>For Ubuntu/Debian
+
+    apt install gist
+
+Note: Debian renames the binary to `gist-paste` to avoid a name conflict.
 
 ## Command
 
diff --git a/bin/gist b/bin/gist
index 5618d08..f513187 100755
--- a/bin/gist
+++ b/bin/gist
@@ -173,7 +173,8 @@ begin
 
   if options.key? :read
     file_name = ARGV.first
-    Gist.read_gist(options[:read], file_name)
+    output = Gist.read_gist(options[:read], file_name)
+    puts output if output
     exit
   end
 
diff --git a/build/gist b/build/gist
index 0f65a4a..40fb605 100755
--- a/build/gist
+++ b/build/gist
@@ -52,7 +52,7 @@ module JSON
           /(?=\*/)      # single slash before this comment's end
          )*
            \*/               # the End of this comment
-           |[ \t\r\n]+       # whitespaces: space, horicontal tab, lf, cr
+           |[ \t\r\n]+       # whitespaces: space, horizontal tab, lf, cr
         )+
       )mx
 
@@ -72,7 +72,7 @@ module JSON
       #   (keys) in a JSON object. Otherwise strings are returned, which is also
       #   the default.
       # * *create_additions*: If set to false, the Parser doesn't create
-      #   additions even if a matchin class and create_id was found. This option
+      #   additions even if a matching class and create_id was found. This option
       #   defaults to true.
       # * *object_class*: Defaults to Hash
       # * *array_class*: Defaults to Array
diff --git a/debian/changelog b/debian/changelog
index 75e619b..8a40bbe 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+gist (6.0.0+git20220530.1.232b69c-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Thu, 05 Jan 2023 21:05:55 -0000
+
 gist (6.0.0-3) unstable; urgency=medium
 
   * Team upload.
diff --git a/debian/patches/disable-test-when-HTTP_PROXY-is-not-set.patch b/debian/patches/disable-test-when-HTTP_PROXY-is-not-set.patch
index 36bf9ac..8614c56 100644
--- a/debian/patches/disable-test-when-HTTP_PROXY-is-not-set.patch
+++ b/debian/patches/disable-test-when-HTTP_PROXY-is-not-set.patch
@@ -5,9 +5,11 @@ Description: Disable test when HTTP_PROXY isn't set.
  Hence disable this for now.
 Author: Utkarsh Gupta <utkarsh@debian.org>
 
---- a/spec/proxy_spec.rb
-+++ b/spec/proxy_spec.rb
-@@ -9,7 +9,7 @@
+Index: gist.git/spec/proxy_spec.rb
+===================================================================
+--- gist.git.orig/spec/proxy_spec.rb
++++ gist.git/spec/proxy_spec.rb
+@@ -9,7 +9,7 @@ describe '...' do
  
    FOO_URL = URI('http://ddg.gg/')
  
diff --git a/debian/patches/gemspec-no-git b/debian/patches/gemspec-no-git
index 2383ae9..bae6cdc 100644
--- a/debian/patches/gemspec-no-git
+++ b/debian/patches/gemspec-no-git
@@ -7,10 +7,10 @@ Forwarded: not-needed
  gist.gemspec | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/gist.gemspec b/gist.gemspec
-index 7708a38..dd5f711 100644
---- a/gist.gemspec
-+++ b/gist.gemspec
+Index: gist.git/gist.gemspec
+===================================================================
+--- gist.git.orig/gist.gemspec
++++ gist.git/gist.gemspec
 @@ -9,7 +9,7 @@ Gem::Specification.new do |s|
    s.email         = ['conrad.irwin@gmail.com', 'rkingist@sharpsaw.org']
    s.authors       = ['Conrad Irwin', '☈king']
diff --git a/debian/patches/mochafix b/debian/patches/mochafix
index 6f32588..72fb01b 100644
--- a/debian/patches/mochafix
+++ b/debian/patches/mochafix
@@ -8,10 +8,10 @@ Forwarded: https://github.com/defunkt/gist/issues/313
  spec/auth_token_file_spec.rb | 2 ++
  1 file changed, 2 insertions(+)
 
-diff --git a/spec/auth_token_file_spec.rb b/spec/auth_token_file_spec.rb
-index 0766069..bb85a45 100644
---- a/spec/auth_token_file_spec.rb
-+++ b/spec/auth_token_file_spec.rb
+Index: gist.git/spec/auth_token_file_spec.rb
+===================================================================
+--- gist.git.orig/spec/auth_token_file_spec.rb
++++ gist.git/spec/auth_token_file_spec.rb
 @@ -10,6 +10,7 @@ describe Gist::AuthTokenFile do
  
      context "with default GITHUB_URL" do
diff --git a/debian/patches/rename b/debian/patches/rename
index 922c38a..36c10ee 100644
--- a/debian/patches/rename
+++ b/debian/patches/rename
@@ -11,10 +11,10 @@ Bug-Debian: https://bugs.debian.org/722662
  gist.gemspec |  2 +-
  4 files changed, 66 insertions(+), 64 deletions(-)
 
-diff --git a/README.md b/README.md
-index c55f322..7ce6a65 100644
---- a/README.md
-+++ b/README.md
+Index: gist.git/README.md
+===================================================================
+--- gist.git.orig/README.md
++++ gist.git/README.md
 @@ -1,9 +1,9 @@
 -gist(1) -- upload code to https://gist.github.com
 -=================================================
@@ -28,7 +28,7 @@ index c55f322..7ce6a65 100644
  upload content to https://gist.github.com/.
  
  ## Installation
-@@ -30,61 +30,61 @@ upload content to https://gist.github.com/.
+@@ -35,61 +35,61 @@ Note: Debian renames the binary to `gist
  
  ‌To upload the contents of `a.rb` just:
  
@@ -109,7 +109,7 @@ index c55f322..7ce6a65 100644
  
  1. The Github device-code Oauth flow. This is the default for authenticating to github.com, and can be enabled for Github Enterprise by creating an Oauth app, and exporting the environment variable `GIST_CLIENT_ID` with the client id of the Oauth app.
  2. The (deprecated) username and password token exchange flow. This is the default for GitHub Enterprise, and can be used to log into github.com by exporting the environment variable `GIST_USE_USERNAME_AND_PASSWORD`.
-@@ -93,7 +93,7 @@ Before you use `gist` for the first time you will need to log in. There are two
+@@ -98,7 +98,7 @@ Before you use `gist` for the first time
  
  This flow allows you to obtain a token by logging into GitHub in the browser and typing a verification code. This is the preferred mechanism.
  
@@ -118,7 +118,7 @@ index c55f322..7ce6a65 100644
      Requesting login parameters...
      Please sign in at https://github.com/login/device
        and enter code: XXXX-XXXX
-@@ -105,7 +105,7 @@ The returned access_token is stored in `~/.gist` and used for all future gisting
+@@ -110,7 +110,7 @@ The returned access_token is stored in `
  
  This flow asks for your GitHub username and password (and 2FA code), and exchanges them for a token with the "gist" permission (your username and password are not stored). This mechanism is deprecated by GitHub, but may still work with GitHub Enterprise.
  
@@ -127,7 +127,7 @@ index c55f322..7ce6a65 100644
      Obtaining OAuth2 access_token from GitHub.
      GitHub username: ConradIrwin
      GitHub password:
-@@ -119,7 +119,7 @@ file.
+@@ -124,7 +124,7 @@ file.
  #### Password-less login
  
  If you have a complicated authorization requirement you can manually create a
@@ -136,7 +136,7 @@ index c55f322..7ce6a65 100644
  for GitHub Enterprise) into a file called `~/.gist`. You can create one from
  https://github.com/settings/tokens
  
-@@ -134,19 +134,19 @@ The `umask` ensures that the file is only accessible from your user account.
+@@ -139,19 +139,19 @@ The `umask` ensures that the file is onl
  
  ### GitHub Enterprise
  
@@ -159,7 +159,7 @@ index c55f322..7ce6a65 100644
  setting it to the public URL will not work. Use `unset GITHUB_URL`
  
  ### Token file format
-@@ -154,7 +154,7 @@ setting it to the public URL will not work. Use `unset GITHUB_URL`
+@@ -159,7 +159,7 @@ setting it to the public URL will not wo
  If you cannot use passwords, as most Enterprise installations do, you can generate the token via the web interface
  and then simply save the string in the correct file. Avoid line breaks or you might see:
  ```
@@ -168,7 +168,7 @@ index c55f322..7ce6a65 100644
  Error: Bad credentials
  ```
  
-@@ -180,7 +180,7 @@ NOTE: The access_token must have the `gist` scope and may also require the `user
+@@ -185,7 +185,7 @@ NOTE: The access_token must have the `gi
  
      Gist.multi_gist("a.rb" => "Foo.bar", "a.py" => "Foo.bar")
  
@@ -177,7 +177,7 @@ index c55f322..7ce6a65 100644
    to obtain one by calling:
  
      Gist.login!
-@@ -190,12 +190,12 @@ in `~/.gist`, where it can later be read by `Gist.gist`
+@@ -195,12 +195,12 @@ in `~/.gist`, where it can later be read
  
  ## Configuration
  
@@ -193,7 +193,7 @@ index c55f322..7ce6a65 100644
  environment variable:
  
      export BROWSER=google-chrome
-@@ -204,7 +204,7 @@ If clipboard or browser integration don't work on your platform, please file a b
+@@ -209,7 +209,7 @@ If clipboard or browser integration don'
  (more ideally) a pull request.
  
  If you need to use an HTTP proxy to access the internet, export the `HTTP_PROXY` or
@@ -202,10 +202,10 @@ index c55f322..7ce6a65 100644
  
  ## Meta-fu
  
-diff --git a/Rakefile b/Rakefile
-index 006f559..5f9b911 100644
---- a/Rakefile
-+++ b/Rakefile
+Index: gist.git/Rakefile
+===================================================================
+--- gist.git.orig/Rakefile
++++ gist.git/Rakefile
 @@ -14,7 +14,7 @@ task :man do
    File.write "README.md.ron", File.read("README.md").gsub("\u200c", "* ")
    sh 'ronn --roff --manual="Gist manual" README.md.ron'
@@ -215,10 +215,10 @@ index 006f559..5f9b911 100644
  end
  
  task :standalone do
-diff --git a/build/gist.1 b/build/gist.1
-index 850c556..6e52791 100644
---- a/build/gist.1
-+++ b/build/gist.1
+Index: gist.git/build/gist.1
+===================================================================
+--- gist.git.orig/build/gist.1
++++ gist.git/build/gist.1
 @@ -4,10 +4,10 @@
  .TH "GIST" "1" "August 2020" "" "Gist manual"
  .
@@ -339,7 +339,7 @@ index 850c556..6e52791 100644
  .
  .IP "1." 4
  The Github device\-code Oauth flow\. This is the default for authenticating to github\.com, and can be enabled for Github Enterprise by creating an Oauth app, and exporting the environment variable \fBGIST_CLIENT_ID\fR with the client id of the Oauth app\.
-@@ -144,7 +146,7 @@ This flow allows you to obtain a token by logging into GitHub in the browser and
+@@ -144,7 +146,7 @@ This flow allows you to obtain a token b
  .
  .nf
  
@@ -348,7 +348,7 @@ index 850c556..6e52791 100644
  Requesting login parameters\.\.\.
  Please sign in at https://github\.com/login/device
    and enter code: XXXX\-XXXX
-@@ -164,7 +166,7 @@ This flow asks for your GitHub username and password (and 2FA code), and exchang
+@@ -164,7 +166,7 @@ This flow asks for your GitHub username
  .
  .nf
  
@@ -357,7 +357,7 @@ index 850c556..6e52791 100644
  Obtaining OAuth2 access_token from GitHub\.
  GitHub username: ConradIrwin
  GitHub password:
-@@ -201,7 +203,7 @@ For example, one way to create this file would be to run:
+@@ -201,7 +203,7 @@ For example, one way to create this file
  The \fBumask\fR ensures that the file is only accessible from your user account\.
  .
  .SS "GitHub Enterprise"
@@ -366,7 +366,7 @@ index 850c556..6e52791 100644
  .
  .IP "" 4
  .
-@@ -214,16 +216,16 @@ export GITHUB_URL=http://github\.internal\.example\.com/
+@@ -214,16 +216,16 @@ export GITHUB_URL=http://github\.interna
  .IP "" 0
  .
  .P
@@ -386,7 +386,7 @@ index 850c556..6e52791 100644
  .
  .TP
  You can also use Gist as a library from inside your ruby code:
-@@ -267,7 +269,7 @@ If you want to upload multiple files in the same gist, you can:
+@@ -267,7 +269,7 @@ If you want to upload multiple files in
  Gist\.multi_gist("a\.rb" => "Foo\.bar", "a\.py" => "Foo\.bar")
  .
  .IP "\(bu" 4
@@ -395,7 +395,7 @@ index 850c556..6e52791 100644
  .
  .IP
  Gist\.login!
-@@ -280,13 +282,13 @@ This will take them through the process of obtaining an OAuth2 token, and storin
+@@ -280,13 +282,13 @@ This will take them through the process
  .SH "Configuration"
  .
  .IP "\(bu" 4
@@ -420,10 +420,10 @@ index 850c556..6e52791 100644
  .
  .SH "Meta\-fu"
  Thanks to @defunkt and @indirect for writing and maintaining versions 1 through 3\. Thanks to @rking and @ConradIrwin for maintaining version 4\.
-diff --git a/gist.gemspec b/gist.gemspec
-index 4d7a2f3..7708a38 100644
---- a/gist.gemspec
-+++ b/gist.gemspec
+Index: gist.git/gist.gemspec
+===================================================================
+--- gist.git.orig/gist.gemspec
++++ gist.git/gist.gemspec
 @@ -12,7 +12,7 @@ Gem::Specification.new do |s|
    s.files         = `git ls-files`.split("\n") - Dir.glob("build/*") - [".gitignore"]
    s.require_paths = ["lib"]
diff --git a/lib/gist.rb b/lib/gist.rb
index 3d3469e..dac1b33 100644
--- a/lib/gist.rb
+++ b/lib/gist.rb
@@ -103,7 +103,7 @@ module Gist
   # @option options [Boolean] :skip_empty (false) Skip gisting empty files.
   # @option options [Symbol] :output (:all) The type of return value you'd like:
   #   :html_url gives a String containing the url to the gist in a browser
-  #   :short_url gives a String contianing a  git.io url that redirects to html_url
+  #   :short_url gives a String containing a  git.io url that redirects to html_url
   #   :javascript gives a String containing a script tag suitable for embedding the gist
   #   :all gives a Hash containing the parsed json response from the server
   #
@@ -212,10 +212,13 @@ module Gist
     get_gist_pages(url, auth_token())
   end
 
-  def read_gist(id, file_name=nil)
+  def read_gist(id, file_name=nil, options={})
     url = "#{base_path}/gists/#{id}"
 
-    access_token = auth_token()
+    access_token = (options[:access_token] || auth_token())
+    if access_token.to_s != ''
+      url << "?access_token=" << CGI.escape(access_token)
+    end
 
     request = Net::HTTP::Get.new(url)
     request['Authorization'] = "token #{access_token}" if access_token.to_s != ''
@@ -232,7 +235,7 @@ module Gist
         file = files.values.first
       end
 
-      puts file["content"]
+      file["content"]
     else
       raise Error, "Gist with id of #{id} does not exist."
     end
diff --git a/vendor/json.rb b/vendor/json.rb
index 578791f..35e060b 100644
--- a/vendor/json.rb
+++ b/vendor/json.rb
@@ -1265,7 +1265,7 @@ module ::Kernel
     nil
   end
 
-  # Ouputs _objs_ to STDOUT as JSON strings in a pretty format, with
+  # Outputs _objs_ to STDOUT as JSON strings in a pretty format, with
   # indentation and over many lines.
   def jj(*objs)
     objs.each do |obj|

Debdiff

File lists identical (after any substitutions)

No differences were encountered in the control files

More details

Full run details