pry-docmore 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. data/docmores.yaml +618 -0
  2. data/lib/pry-docmore.rb +7 -6
  3. metadata +4 -98
  4. data/pry-docmore.wiki/Home.md +0 -96
  5. data/pry-docmore.wiki/Ruby Global $! (DollarBang).md +0 -15
  6. data/pry-docmore.wiki/Ruby Global $/" (DollarQuote).md" +0 -4
  7. data/pry-docmore.wiki/Ruby Global $$ (DollarDollar).md +0 -12
  8. data/pry-docmore.wiki/Ruby Global $& (DollarAmpersand).md +0 -16
  9. data/pry-docmore.wiki/Ruby Global $' (DollarTick).md +0 -16
  10. data/pry-docmore.wiki/Ruby Global $* (DollarStar).md +0 -1
  11. data/pry-docmore.wiki/Ruby Global $+ (DollarPlus).md +0 -9
  12. data/pry-docmore.wiki/Ruby Global $, (DollarComma).md +0 -1
  13. data/pry-docmore.wiki/Ruby Global $-0 (DollarDashZero).md +0 -1
  14. data/pry-docmore.wiki/Ruby Global $-F (DollarDashF).md +0 -1
  15. data/pry-docmore.wiki/Ruby Global $-I (DollarDashI).md +0 -1
  16. data/pry-docmore.wiki/Ruby Global $-K (DollarDashK).md +0 -1
  17. data/pry-docmore.wiki/Ruby Global $-W (DollarDashW).md +0 -1
  18. data/pry-docmore.wiki/Ruby Global $-a (DollarDasha).md +0 -1
  19. data/pry-docmore.wiki/Ruby Global $-d (DollarDashd).md +0 -1
  20. data/pry-docmore.wiki/Ruby Global $-i (DollarDashi).md +0 -1
  21. data/pry-docmore.wiki/Ruby Global $-l (DollarDashl).md +0 -1
  22. data/pry-docmore.wiki/Ruby Global $-p (DollarDashp).md +0 -1
  23. data/pry-docmore.wiki/Ruby Global $-v (DollarDashv).md +0 -1
  24. data/pry-docmore.wiki/Ruby Global $-w (DollarDashw).md +0 -1
  25. data/pry-docmore.wiki/Ruby Global $. (DollarDot).md +0 -1
  26. data/pry-docmore.wiki/Ruby Global $0 (DollarZero).md +0 -2
  27. data/pry-docmore.wiki/Ruby Global $1 (DollarOne).md +0 -1
  28. data/pry-docmore.wiki/Ruby Global $2 (DollarTwo).md +0 -1
  29. data/pry-docmore.wiki/Ruby Global $3 (DollarThree).md +0 -1
  30. data/pry-docmore.wiki/Ruby Global $4 (DollarFour).md +0 -1
  31. data/pry-docmore.wiki/Ruby Global $5 (DollarFive).md +0 -1
  32. data/pry-docmore.wiki/Ruby Global $6 (DollarSix).md +0 -1
  33. data/pry-docmore.wiki/Ruby Global $7 (DollarSeven).md +0 -1
  34. data/pry-docmore.wiki/Ruby Global $8 (DollarEight).md +0 -1
  35. data/pry-docmore.wiki/Ruby Global $9 (DollarNine).md +0 -1
  36. data/pry-docmore.wiki/Ruby Global $: (DollarColon).md +0 -3
  37. data/pry-docmore.wiki/Ruby Global $; (DollarSemicolon).md +0 -1
  38. data/pry-docmore.wiki/Ruby Global $< (DollarLessthan).md +0 -1
  39. data/pry-docmore.wiki/Ruby Global $= (DollarEquals).md +0 -2
  40. data/pry-docmore.wiki/Ruby Global $> (DollarGreaterthan).md +0 -1
  41. data/pry-docmore.wiki/Ruby Global $? (Dollar?).md +0 -11
  42. data/pry-docmore.wiki/Ruby Global $@ (DollarAt).md +0 -2
  43. data/pry-docmore.wiki/Ruby Global $DEBUG (DollarDEBUG).md +0 -1
  44. data/pry-docmore.wiki/Ruby Global $FILENAME (DollarFILENAME).md +0 -1
  45. data/pry-docmore.wiki/Ruby Global $KCODE (DollarKCODE).md +0 -1
  46. data/pry-docmore.wiki/Ruby Global $LOADED_FEATURES (DollarLOADEDUnderscoreFEATURES).md +0 -1
  47. data/pry-docmore.wiki/Ruby Global $LOAD_PATH (DollarLOADUnderscorePATH).md +0 -1
  48. data/pry-docmore.wiki/Ruby Global $PROGRAM_NAME (DollarPROGRAMUnderscoreNAME).md +0 -1
  49. data/pry-docmore.wiki/Ruby Global $SAFE (DollarSAFE).md +0 -4
  50. data/pry-docmore.wiki/Ruby Global $VERBOSE (DollarVERBOSE).md +0 -1
  51. data/pry-docmore.wiki/Ruby Global $// (DollarBackslash).md" +0 -1
  52. data/pry-docmore.wiki/Ruby Global $_ (DollarUnderscore).md +0 -1
  53. data/pry-docmore.wiki/Ruby Global $` (DollarBacktick).md +0 -16
  54. data/pry-docmore.wiki/Ruby Global $stderr (Dollarstderr).md +0 -1
  55. data/pry-docmore.wiki/Ruby Global $stdin (Dollarstdin).md +0 -1
  56. data/pry-docmore.wiki/Ruby Global $stdout (Dollarstdout).md +0 -1
  57. data/pry-docmore.wiki/Ruby Global $~ (DollarSquiggle).md +0 -1
  58. data/pry-docmore.wiki/Ruby Global $/342/201/204 (DollarSlash).md" +0 -3
  59. data/pry-docmore.wiki/Ruby Keyword: BEGIN.md +0 -14
  60. data/pry-docmore.wiki/Ruby Keyword: END.md +0 -10
  61. data/pry-docmore.wiki/Ruby Keyword: __ENCODING__.md +0 -8
  62. data/pry-docmore.wiki/Ruby Keyword: __FILE__.md +0 -5
  63. data/pry-docmore.wiki/Ruby Keyword: __LINE__.md +0 -12
  64. data/pry-docmore.wiki/Ruby Keyword: alias.md +0 -38
  65. data/pry-docmore.wiki/Ruby Keyword: and.md +0 -29
  66. data/pry-docmore.wiki/Ruby Keyword: begin.md +0 -24
  67. data/pry-docmore.wiki/Ruby Keyword: break.md +0 -22
  68. data/pry-docmore.wiki/Ruby Keyword: case.md +0 -25
  69. data/pry-docmore.wiki/Ruby Keyword: class.md +0 -4
  70. data/pry-docmore.wiki/Ruby Keyword: def.md +0 -14
  71. data/pry-docmore.wiki/Ruby Keyword: defined?.md +0 -29
  72. data/pry-docmore.wiki/Ruby Keyword: do.md +0 -3
  73. data/pry-docmore.wiki/Ruby Keyword: else.md +0 -4
  74. data/pry-docmore.wiki/Ruby Keyword: elsif.md +0 -3
  75. data/pry-docmore.wiki/Ruby Keyword: end.md +0 -2
  76. data/pry-docmore.wiki/Ruby Keyword: ensure.md +0 -1
  77. data/pry-docmore.wiki/Ruby Keyword: false.md +0 -9
  78. data/pry-docmore.wiki/Ruby Keyword: for.md +0 -14
  79. data/pry-docmore.wiki/Ruby Keyword: if.md +0 -5
  80. data/pry-docmore.wiki/Ruby Keyword: in.md +0 -3
  81. data/pry-docmore.wiki/Ruby Keyword: module.md +0 -31
  82. data/pry-docmore.wiki/Ruby Keyword: next.md +0 -15
  83. data/pry-docmore.wiki/Ruby Keyword: nil.md +0 -3
  84. data/pry-docmore.wiki/Ruby Keyword: not.md +0 -10
  85. data/pry-docmore.wiki/Ruby Keyword: or.md +0 -22
  86. data/pry-docmore.wiki/Ruby Keyword: redo.md +0 -16
  87. data/pry-docmore.wiki/Ruby Keyword: rescue.md +0 -55
  88. data/pry-docmore.wiki/Ruby Keyword: retry.md +0 -20
  89. data/pry-docmore.wiki/Ruby Keyword: return.md +0 -38
  90. data/pry-docmore.wiki/Ruby Keyword: self.md +0 -15
  91. data/pry-docmore.wiki/Ruby Keyword: super.md +0 -34
  92. data/pry-docmore.wiki/Ruby Keyword: then.md +0 -17
  93. data/pry-docmore.wiki/Ruby Keyword: true.md +0 -7
  94. data/pry-docmore.wiki/Ruby Keyword: undef.md +0 -5
  95. data/pry-docmore.wiki/Ruby Keyword: unless.md +0 -4
  96. data/pry-docmore.wiki/Ruby Keyword: until.md +0 -6
  97. data/pry-docmore.wiki/Ruby Keyword: when.md +0 -1
  98. data/pry-docmore.wiki/Ruby Keyword: while.md +0 -6
  99. data/pry-docmore.wiki/Ruby Keyword: yield.md +0 -16
@@ -1,22 +0,0 @@
1
- Boolean disjunction.
2
-
3
- Evaluates to true if either its left or right side are true.
4
-
5
- Remember that the 'or' operator is lower precedence operator than '||', so
6
-
7
- an_expression or another_expression
8
- is roughly equivalent to:
9
- (an_expression) || (another_expression)
10
-
11
- Truth table
12
-
13
- true or true ⇒ true
14
- false or true ⇒ true
15
- false or false ⇒ false
16
-
17
- Precedence
18
-
19
- true or false ? 'yes' : 'no' ⇒ true
20
- true || false ? 'yes' : 'no' ⇒ "yes"
21
-
22
- See http://phrogz.net/ProgrammingRuby/language.html#table_18.4
@@ -1,16 +0,0 @@
1
- Jump back to the top of the inner-most block. E.g.:
2
-
3
- 2.times do |i|
4
- 3.times do |j|
5
- print i,j
6
- j += 1
7
- redo if 1 == j
8
- end
9
- end
10
- puts
11
-
12
- Prints:
13
-
14
- 0001010210111112
15
-
16
- # TODO: Pick a better example
@@ -1,55 +0,0 @@
1
- Catch exceptions.
2
-
3
- Usage:
4
-
5
- begin
6
- 1/0
7
- rescue => e
8
- puts "No division by zero ever bothered me."
9
- end
10
-
11
- Or
12
-
13
- def foo
14
- 1/0
15
- rescue
16
- puts "Yep, works on 'def's, too."
17
- end
18
-
19
- This is the basic exception heirarchy:
20
-
21
- Exception
22
- NoMemoryError
23
- ScriptError:
24
- LoadError
25
- NotImplementedError
26
- SyntaxError
27
- SignalException
28
- Interrupt
29
- StandardError
30
- ArgumentError
31
- IOError
32
- EOFError
33
- IndexError
34
- LocalJumpError
35
- NameError
36
- NoMethodError
37
- RangeError
38
- FloatDomainError
39
- RegexpError
40
- RuntimeError
41
- SecurityError
42
- SystemCallError
43
- SystemStackError
44
- ThreadError
45
- TypeError
46
- ZeroDivisionError
47
- SystemExit
48
- fatal
49
-
50
- More in Avdi Grimm's book, Exceptional Ruby: http://pragprog.com/book/ager/exceptional-ruby
51
- # TODO:
52
- # Explain the args syntax
53
- # Talk about Standard
54
-
55
- See: ensure, else, retry
@@ -1,20 +0,0 @@
1
- Re-run the block that raised an Exception.
2
-
3
- For example:
4
-
5
- tries = 3
6
- begin
7
- puts "Try ##{tries}."
8
- 1/0
9
- rescue => e
10
- tries -= 1
11
- retry unless tries.zero?
12
- end
13
-
14
- This will output:
15
-
16
- Try #3.
17
- Try #2.
18
- Try #1.
19
-
20
- See also: begin, rescue, else, ensure
@@ -1,38 +0,0 @@
1
- Leave the current method, making the given value.
2
-
3
- Keep in mind that the last statement in a Ruby method is its implied value, so
4
- these are equivalent:
5
-
6
- def f x
7
- if 0 == x % 3
8
- return true
9
- else
10
- return false
11
- end
12
- end
13
-
14
- def f x
15
- if 0 == x % 3
16
- true
17
- else
18
- false
19
- end
20
- end
21
-
22
- …but, then, you might as well go all the way with it, as this is equivalent:
23
-
24
- def f x
25
- 0 == x % 3
26
- end
27
-
28
- So, usually, it's only useful as an "early return" in Ruby, such as:
29
-
30
- return if arg > 3
31
- # rest of method here
32
-
33
- Note that you can return out of lambdas but not proc's, e.g.:
34
-
35
- -> { return 3 }.()
36
- # ⇒ 3
37
- proc { return 3 }.()
38
- # ⇒ LocalJumpError: unexpected return
@@ -1,15 +0,0 @@
1
- An ever-present variable in Ruby. At the very top level, it is the "(main)"
2
- self, but everywhere else its value is very important to know.
3
-
4
- Within a method, it is the instance that received the method.
5
-
6
- Within a class defintion, it is the class itself. This explains why:
7
-
8
- class Foo
9
- def self.hi; 'hi' end # this is equivalent to:
10
- def Foo.hi; 'hi' end # this.
11
- end
12
-
13
- # TODO:
14
- # Explain eigenclasses
15
- # …?
@@ -1,34 +0,0 @@
1
- Call the current method, but using the superclass's implementation. Can be
2
- useful so that subclasses can 'decorate' their parent class's functionality.
3
-
4
- A subtle syntax issue is that, when this is called with no arguments, all
5
- arguments are passed up.
6
-
7
- For example:
8
-
9
- class Dad
10
- def f *args; p args end
11
- end
12
- class Kid < Dad
13
- def f *args; super end
14
- end
15
- Kid.new.f 1, 2
16
-
17
- Outputs:
18
-
19
- [1, 2]
20
-
21
- The way to stop this behavior is to use something Ruby almost never requires:
22
- empty parens:
23
-
24
- class Dad
25
- def f *args; p args end
26
- end
27
- class Kid < Dad
28
- def f *args; super() end
29
- end
30
- Kid.new.f 1, 2
31
-
32
- Outputs:
33
-
34
- []
@@ -1,17 +0,0 @@
1
- A keyword that is generally needless. For example, these all work:
2
-
3
- if 3 then
4
- puts 'hi'
5
- end
6
- if 3
7
- puts 'hi'
8
- end
9
-
10
- if 3 then 'yes' else 'no' end
11
- if 3; 'yes' else 'no' end
12
- 3 ? 'yes' : 'no'
13
-
14
- case x
15
- when 3 then puts 'yo' end
16
- when 4; puts 'yo' end
17
- end
@@ -1,7 +0,0 @@
1
- not false. Everything in Ruby (except `false` and `nil`) are true.
2
-
3
- if 0
4
- puts "Ruby."
5
- else
6
- puts "Perl."
7
- end
@@ -1,5 +0,0 @@
1
- Opposite of `def` — removes a method definition.
2
-
3
- def foo; end
4
- undef foo
5
- foo ⇒ NameError: undefined local variable or method `foo' for main:Object`
@@ -1,4 +0,0 @@
1
- Equivalent to `if not`, but with very clear precedence. Especially popular in
2
- the "Yoda if" form:
3
-
4
- fail "Oh no!" unless valid?
@@ -1,6 +0,0 @@
1
- Negated `while`.
2
-
3
- puts 'Guess a letter.'
4
- until 'y' == $stdin.readline.chomp
5
- puts 'Guess again.'
6
- end
@@ -1 +0,0 @@
1
- Specific condition of a `case` statement. (See: case)
@@ -1,6 +0,0 @@
1
- Loop as long as the condition holds.
2
-
3
- puts 'Guess a letter.'
4
- while 'y' == $stdin.readline.chomp
5
- puts 'Anything but that one.'
6
- end
@@ -1,16 +0,0 @@
1
- Run the block passed to a method.
2
-
3
- def foo
4
- p 1
5
- yield 2
6
- p 3
7
- end
8
- foo do |i|
9
- p i
10
- end
11
-
12
- Prints:
13
-
14
- 1
15
- 2
16
- 3