Add a small web sample showing incremental authorization & use of APIs

This commit is contained in:
Steve Bazyl committed 2016-01-20 12:21:08 -08:00
1 parent 36a197d885
commit 87ed3e421b
19 files changed
+319 -1

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env ruby
$:.unshift(File.expand_path("../lib", __FILE__))
require 'thor'
require 'dotenv'
# Small script to allow executing samples from the command line.
# Each sample is loaded as a subcommand.
#
# Example usage:
#
# google-api-samples drive upload myfile.txt
#
#
class App < Thor
# Load all the samples and register them as subcommands
Dir.glob('./lib/samples/*.rb').each do |file|
require file
end
Samples.constants.each do |const|
desc const.downcase, "#{const} samples"
subcommand const.downcase, Samples.const_get(const)
end
end
Dotenv.load
App.start(ARGV)