Skip to content

Commit

Permalink
Merge pull request cheat#51 from luathn/add-ruby-gem-cheatsheets
Browse files Browse the repository at this point in the history
Add ruby and gem cheatsheet
  • Loading branch information
chrisallenlane authored Nov 10, 2020
2 parents b1b2aaa + 83a354a commit 9c8ade7
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
29 changes: 29 additions & 0 deletions gem
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
tags: [ packaging, ruby ]
---
# To search for a package:
gem search <package>

# To install a package:
gem install <package>

# To install a package in user space:
gem install --user-install <package>

# To install specific version of a package:
gem install <package> -v <version>

# To uninstall a package:
gem uninstall <package>

# To upgrade a package:
gem update <package>

# To show details of a package:
gem info <package>

# To list local packages:
gem list --local

# To show help on command:
gem help <command>
19 changes: 19 additions & 0 deletions ruby
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Ruby - Interpreted object-oriented scripting language
# Main page: https://www.ruby-lang.org/
# Help and documentation: https://ruby-doc.org/

# To serve the current directory:
ruby -run -e httpd . -p <port>

# To execute a script file:
ruby <file>

# To execute one line of script:
ruby -e 'command'

# To check script file syntax:
ruby -c <file>

# To specify $LOAD_PATH directory:
ruby -Idirectory
ruby -Ispec spec/test_spec.rb

0 comments on commit 9c8ade7

Please sign in to comment.