how to download files from tumblr using ruby How to Download Audio from Tumblr. This article was co-authored by our trained team of editors and researchers who validated it for accuracy and comprehensiveness. wikiHow's Content Management Team carefully monitors the work from our editorial staff to ensure that each article is backed by trusted research and meets our high quality standards. This article has been viewed 27,430 times. Ever want to save audio you heard on Tumblr? This wikiHow shows you how to download audio from Tumblr with extensions and the Inspect Elements feature in most Web browsers. RDoc - Ruby Documentation System ¶ ↑ RDoc produces HTML and command-line documentation for Ruby projects. RDoc includes the and ri tools for generating and displaying documentation from the command-line. Generating Documentation ¶ ↑ Once installed, you can create documentation using the rdoc command. For an up-to-date option summary, type. A typical use might be to generate documentation for a package of Ruby source (such as RDoc itself). This command generates documentation for all the Ruby and source files in and below the current directory. These will be stored in a documentation tree starting in the subdirectory doc . You can this slightly more useful for your readers by having the index page contain the documentation for the primary file. In our case, we could type. You'll find information on the various formatting tricks you can use in comment blocks in the documentation this generates. RDoc uses file extensions to determine how to process each file. File names ending .rb and .rbw are assumed to be Ruby source. Files ending .c are parsed as C files. All other files are assumed to contain just Markup-style markup (with or without leading '#' comment markers). If directory names are passed to RDoc, they are scanned recursively for C and Ruby source files only. To generate documentation using see RDoc::Task. To generate documentation programmatically: Writing Documentation ¶ ↑ To write documentation for RDoc place a comment above the class, module, method, constant, or attribute you want documented: The default comment markup format is the RDoc::Markup format. TomDoc, Markdown and RD format comments are also supported. You can set the default comment format for your entire project by creating a .rdoc_options file. See Saved Options at RDoc::Options for instructions on creating one. You can also set the comment format for a single file through the :markup: directive, but this is only recommended if you wish to switch markup formats. See Other directives at RDoc::Markup. Comments can contain directives that tell RDoc information that it cannot otherwise discover through parsing. See Directives at RDoc::Markup to control what is or is not documented, to define method arguments or to break up methods in a class by topic. See RDoc::Parser::Ruby for directives used to teach RDoc about metaprogrammed methods. See RDoc::Parser::C for documenting C extensions with RDoc. To determine how well your project is documented run rdoc -C lib to get a documentation coverage report. rdoc -C1 lib includes parameter names in the documentation coverage report. See Bugs at CONTRIBUTING for information on filing a bug report. It's OK to file a bug report for anything you're having a problem with. If you can't figure out how to make RDoc produce the output you like that is probably a documentation bug. License ¶ ↑ RDoc is Copyright © 2001-2003 Dave Thomas, The Pragmatic Programmers. Portions © 2007-2011 Eric Hodel. Portions copyright others, see individual files and LEGAL.rdoc for details. RDoc is free software, and may be redistributed under the terms specified in LICENSE.rdoc. Warranty ¶ ↑ This software is provided “as is” and without any express or implied warranties, including, without limitation, the implied warranties of merchantability and fitness for a particular purpose. Quickstart: Azure Blob Storage client library for Ruby. Learn how to use Ruby to create, download, and list blobs in a container in Microsoft Azure Blob Storage. Prerequisites. To access Azure Storage, you'll need an Azure subscription. If you don't already have a subscription, create a free account before you begin. All access to Azure Storage takes place through a storage account. For this quickstart, create a storage account using the Azure portal, Azure PowerShell, or Azure CLI. For help creating a storage account, see Create a storage account. Make sure you have the following additional prerequisites installed: Download the sample application. The sample application used in this quickstart is a basic Ruby application. Use Git to download a copy of the application to your development environment. This command clones the repository to your local machine: Navigate to the storage-blobs-ruby-quickstart folder, and open the example.rb file in your code editor. Copy your credentials from the Azure portal. The sample application needs to authorize access to your storage account. Provide your storage account credentials to the application in the form of a connection string. To view your storage account credentials: In to the Azure portal go to your storage account. In the Settings section of the storage account overview, select Access keys to display your account access keys and connection string. Note the name of your storage account, which you'll need for authorization. Find the Key value under key1 , and select Copy to copy the account key. Configure your storage connection string. Provide your storage account name and account key to create a BlobService instance for your application. The following code in the example.rb file instantiates a new BlobService object. Replace the accountname and accountkey values with your account name and key. Run the sample. The sample creates a container in Blob Storage, creates a new blob in the container, lists the blobs in the container, and downloads the blob to a local file. Run the sample. Here is an example of the output from running the application: When you press Enter to continue, the sample program deletes the storage container and the local file. Before you continue, check your Documents folder for the downloaded file. You can also use Azure Storage Explorer to view the files in your storage account. Azure Storage Explorer is a free cross-platform tool that allows you to access your storage account information. After you've verified the files, press the Enter key to delete the test files and end the demo. Open the example.rb file to look at the code. Understand the sample code. Next, we walk through the sample code so you can understand how it works. Get references to the storage objects. The first thing to do is create instances of the objects used to access and manage Blob Storage. These objects build on each other. Each is used by the next one in the list. Create an instance of the Azure storage BlobService object to set up connection credentials. Create the Container object, which represents the container you're accessing. Containers are used to organize your blobs like you use folders on your computer to organize your files. Once you have the container object, you can create a Block blob object that points to a specific blob in which you're interested. Use the Block object to create, download, and copy blobs. Container names must be lowercase. For more information about container and blob names, see Naming and Referencing Containers, Blobs, and Metadata. The following example code: Creates a new container Sets permissions on the container so the blobs are public. The container is called quickstartblobs with a unique ID appended. Create a blob in the container. Blob Storage supports block blobs, append blobs, and page blobs. To create a blob, call the create_block_blob method passing in the data for the blob. The following example creates a blob called QuickStart_ with a unique ID and a .txt file extension in the container created earlier. Block blobs can be as large as 4.7 TB, and can be anything from spreadsheets to large video files. Page blobs are primarily used for the VHD files that back IaaS virtual machines. Append blobs are commonly used for logging, such as when you want to write to a file and then keep adding more information. List the blobs in a container. Get a list of files in the container using the list_blobs method. The following code retrieves the list of blobs, then displays their names. Download a blob. Download a blob to your local disk using the get_blob method. The following code downloads the blob created in a previous section. Clean up resources. If a blob is no longer needed, use delete_blob to remove it. Delete an entire container using the delete_container method. Deleting a container also deletes any blobs stored in the container. Resources for developing Ruby applications with blobs. See these additional resources for Ruby development: View and download the Ruby client library source code for Azure Storage on GitHub. Explore Azure samples written using the Ruby client library. Next steps. In this quickstart, you learned how to transfer files between Azure Blob Storage and a local disk by using Ruby. To learn more about working with Blob Storage, continue to the Storage account overview. For more information about the Storage Explorer and Blobs, see Manage Azure Blob Storage resources with Storage Explorer. How to download files from tumblr using ruby. Use of common RubyGems commands. The gem command allows you to interact with RubyGems. Ruby 1.9 and newer ships with RubyGems built-in but you may need to upgrade for bug fixes or new features. To upgrade RubyGems or install it for the first time (if you need to use Ruby 1.9) visit the download page. If you want to see how to require files from a gem, skip ahead to What is a gem. Finding Gems. The search command lets you find remote gems by name. You can use regular expression characters in your query: If you see a gem you want more information on you can add the details option. You’ll want to do this with a small number of gems, though, as listing gems with details requires downloading more files: You can also search for gems on .org such as this search for rake. Installing Gems. The install command downloads and installs the gem and any necessary dependencies then builds documentation for the installed gems. Here the drip command depends upon the rbtree gem which has an extension. Ruby installs the dependency rbtree and builds its extension, installs the drip gem, then builds documentation for the installed gems. You can disable documentation generation using the --no-doc argument when installing gems. Requiring code. RubyGems modifies your Ruby load path, which controls how your Ruby code is found by the require statement. When you require a gem, really you’re just placing that gem’s lib directory onto your $LOAD_PATH . Let’s try this out in irb and get some help from the pretty_print library included with Ruby. Tip: Passing -r to irb will automatically require a library when irb is loaded. By default you have just a few system directories on the load path and the Ruby standard libraries. To add the awesome_print directories to the load path, you can require one of its files: Note: For Ruby 1.8 you must require 'rubygems' before requiring any gems. Once you’ve required ap , RubyGems automatically places its lib directory on the $LOAD_PATH . That’s basically it for what’s in a gem. Drop Ruby code into lib , name a Ruby file the same as your gem (for the gem “freewill” the file should be freewill.rb , see also name your gem) and it’s loadable by RubyGems. The lib directory itself normally contains only one .rb file and a directory with the same name as the gem which contains the rest of the files. Listing Installed Gems. The list command shows your locally installed gems: (Ruby ships with some gems by default, bigdecimal, io-console, json, minitest, psych, rake, rdoc, test-unit for ruby 2.0.0). Uninstalling Gems. The uninstall command removes the gems you have installed. If you uninstall a dependency of a gem RubyGems will ask you for confirmation. Viewing Documentation. You can view the documentation for your installed gems with ri : Fetching and Unpacking Gems. If you wish to audit a gem’s contents without installing it you can use the fetch command to download the .gem file then extract its contents with the unpack command. You can also unpack a gem you have installed, modify a few files, then use the modified gem in place of the installed one: The -I argument adds your unpacked rake to the ruby $LOAD_PATH which prevents RubyGems from loading the gem version (or the default version). The -S argument finds rake in the shell’s $PATH so you don’t have to type out the full path. Further Reading. This guide only shows the basics of using the gem command. For information on what’s inside a gem and how to use one you’ve installed see the next section, What is a gem. For a complete reference of gem commands see the Command Reference. Ruby ri Tool. If you have a good internet connection, then you would probably refer to the Ruby documentation online. However, for those with a slower connection or not having an internet access, the Ruby ri and RDoc tools are very useful. ri (Ruby Index) and RDoc (Ruby Documentation) are a closely related pair of tools for providing documentation about Ruby programs. ri is a command-line tool; the RDoc system includes the command-line tool rdoc . ri and rdoc are standalone programs; you run them from the command line. RDoc is a documentation system. If you put comments in your program files (Ruby or C) in the prescribed RDoc format, rdoc scans your files, extracts the comments, organizes them intelligently (indexed according to what they comment on), and creates nicely formatted documentation from them. You can see RDoc markup in many of the C files in the Ruby source tree and many of the Ruby files in the Ruby installation. The Ruby ri tool is used to view the Ruby documentation off-line. Open a command window and invoke ri followed by the name of a Ruby class, module or method. ri will display documentation for you. You may specify a method name without a qualifying class or module name, but this will just show you a list of all methods by that name (unless the method is unique). Normally, you can separate a class or module name from a method name with a period. If a class defines a class method and an instance method by the same name, you must instead use :: to refer to a class method or # to refer to the instance method. Here are some example invocations of ri: