lib/imgurr/command.rb
# Public: Upload an image to Imgur
#
# Returns nothing
Upload an image to Imgur
Returns nothing
Upload an image to Imgur Returns nothing
def upload(major)
        unless File.exist?(major)
          puts "File #{major} not found."
          return
        end
        major = File.absolute_path(major)
        response, success = ImgurAPI.upload(major)
        puts response unless success
        if success
          response = "![#{options[:title].nil? ? 'Screenshot' : options[:title]}](#{response})" if options[:markdown]
          response = build_HTML_response(response) if options[:html]
          puts "Copied #{Platform.copy(response)} to clipboard"
        end
        storage.save
      end
def upload ( major ) unless File . exist? ( major ) puts "File #{major} not found." return end major = File . absolute_path ( major ) response , success = ImgurAPI . upload ( major ) puts response unless success if success response = "![#{options[:title].nil? ? 'Screenshot' : options[:title]}](#{response})" if options [ :markdown ] response = build_HTML_response ( response ) if options [ :html ] puts "Copied #{Platform.copy(response)} to clipboard" end storage . save end
Public: Upload an image to Imgur
Returns nothing
Public : Upload an image to Imgur Returns nothing
major
<not_specific>