#!/usr/bin/env ruby =begin Every body mentioned this way to have multiline comments. The =begin and =end must be at the beginning of the line or it will be a syntax error. =end puts "Hello world!" <<-DOC Also, you could create a docstring. which... DOC puts "Hello world!" "..is kinda ugly and creates a String instance, but I know one guy with a Smalltalk background, who does this." puts "Hello world!" ## # most # people # do # this __END__ But all forgot there is another option. Only at the end of a file, of course.
- This is how it looks (via screenshot) – otherwise it’s hard to interpret how the above comments will look. Click to Zoom-in:
Related Posts:
- Multi-Line Comments in Ruby?
- Get underlined text with Markdown
- What is the meaning of *nix?
- Get underlined text with Markdown
- What does the “map” method do in Ruby?
- How to write a switch statement in Ruby
- Rails 5 ActionController::InvalidAuthenticityToken error
- what does ? ? mean in ruby
- How to update Ruby Version 2.0.0 to the latest version in Mac OSX Yosemite?
- What does %w(array) mean?
- How to use “gets” and “gets.chomp” in Ruby
- Getting a substring in Ruby by x number of chars
- How to check whether a string contains a substring in Ruby
- Ruby: How to install a specific version of a ruby gem?
- ruby operator “=~” [duplicate]
- What is attr_accessor in Ruby?
- ActionController::UnknownFormat
- What does ||= (or-equals) mean in Ruby?
- How to read lines of a file in Ruby
- Array to Hash Ruby
- Ruby: undefined method `[]’ for nil:NilClass when trying to get Enumerator on an Array of Hashes
- How to map with index in Ruby?
- Ruby equivalent for Python’s “try”?
- What does “+=” (plus equals) mean?
- Rails 4 RoutingError: No Route Matches
- How to sum array of numbers in Ruby?
- Ruby array to string conversion
- How to check if a value exists in an array in Ruby
- undefined method (NoMethodError) ruby
- How to uninstall ruby installed by ruby-install
- PG::ConnectionBad – could not connect to server: Connection refused
- Rails syntax error : unexpected keyword_ensure, expecting end-of-input
- Removing all installed Gems and starting over
- Ruby `send` vs `call` method
- What is the meaning of “do | |” in Ruby?
- RVM is not a function, selecting rubies with ‘rvm use …’ will not work
- How to delete specific characters from a string in Ruby?
- Ruby: kind_of? vs. instance_of? vs. is_a?
- Rails: I installed Ruby, now “bundle install” doesn’t work
- How to do a newline in output
- Ruby: What is the easiest way to remove the first element from an array?
- Ruby String to Date Conversion
- p vs puts in Ruby
- Determining type of an object in ruby
- Fizz Buzz in Ruby for dummies
- How to Uninstall RVM? [duplicate]
- What is the “right” way to iterate through an array in Ruby?
- What is the difference between a Process’ pid, ppid, uid, euid, gid and egid?
- Equivalent of “continue” in Ruby
- What does the Ruby method ‘to_sym’ do?
- Difference between map and collect in Ruby?
- Creating and iterating a 2d array in Ruby
- What is the best way to convert an array to a hash in Ruby
- Ruby 2.0.0p0 IRB warning: “DL is deprecated, please use Fiddle”
- Getting error: dyld: Symbol not found: _clock_gettime
- Uninstall old versions of Ruby gems
- Uploading a file in Rails
- What is java interface equivalent in Ruby?
- Sort hash by key, return hash in Ruby
- Gem installation error: You have to install development tools first
- How to understand strptime vs. strftime
- How can I delete one element from an array by value
- How to break out from a ruby block?
- ERROR: While executing gem … (Gem::FilePermissionError)
- No such file or directory @ rb_sysopen ruby
- How to add to an existing hash in Ruby
- Ruby ‘require’ error: cannot load such file
- How to convert a string to lower or upper case in Ruby
- What is the canonical way to trim a string in Ruby without creating a new string?
- Difference between $stdout and STDOUT in Ruby
- No implicit conversion of String into Integer (TypeError)?
- setting comments off as default for pages and custom post types?
- Why do I get accidental comments without (the required) email address?
- What are the current recommended best-practices for comments.php?
- Can WordPress store comment cookies on two different computers?
- How to get last comments but not from admin (or other specific user role/capability)?
- Edit Comments Form in TwentyEleven
- Allow contributors to moderate comments comments on posts they write
- Why is comments_template() working without a comments.php file?
- How to load javascript file on homepage in WordPress in order?
- Turning off trackbacks & comments
- Using defer or async JavaScript attributes prevents pingbacks and trackbacks from being sent
- Why do I have to manually approve comments from one of my users who already has an approved comment?
- Customizing Comments on Posts
- How to get posts and comments amount per hour, per year and per month?
- Get comments only for certain specific users in template file
- How to style archive post titles… but only those posts who have comments?
- How can I include the user id inside of a shortcode php output?
- How to permanently delete pages I have already trashed?
- Showing recent post of category in page
- Comments not displaying after changing theme
- Show all people who commented on all posts by an author
-   not working in comments
- URLs to user page is broken
- How does add_action ‘comment_post’ work?
- show posts from one category with comments only
- Is there any wordpress plugin available to auto share comments? [closed]
- Getting thousands of spam comments
- Subdomain add comment redirect to 404 not found page iis server
- Add pending for reply comment in console WordPress