-
Notifications
You must be signed in to change notification settings - Fork 629
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1734 from masatake/tambeta-ruby-assign-blocks
Ruby: assign blocks (originally submitted by @tambeta)
- Loading branch information
Showing
3 changed files
with
139 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Bar input.rb /^c = class Bar$/;" c | ||
Foo input.rb /^m = module Foo$/;" m | ||
Quux input.rb /^m += module Quux$/;" m | ||
Zook input.rb /^c ||= class Zook$/;" c | ||
method_a input.rb /^ x = def method_a$/;" f class:Bar | ||
method_b input.rb /^ def method_b$/;" f class:Bar | ||
method_c input.rb /^ def method_c$/;" f class:Bar | ||
method_d input.rb /^ def method_d$/;" f class:Bar | ||
method_e input.rb /^ def method_e$/;" f class:Bar | ||
method_f input.rb /^ def method_f$/;" f class:Bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
m = module Foo | ||
end | ||
|
||
m += module Quux | ||
end | ||
|
||
c = class Bar | ||
x = def method_a | ||
if 1 | ||
else | ||
end | ||
end | ||
|
||
def method_b | ||
x = while 1 do | ||
break | ||
end | ||
end | ||
|
||
def method_c | ||
x = if 1 | ||
else | ||
end | ||
end | ||
|
||
def method_d | ||
x += if 1 | ||
else | ||
end | ||
end | ||
|
||
def method_e | ||
x ||= if 1 | ||
else | ||
end | ||
end | ||
|
||
def method_f | ||
end | ||
end | ||
|
||
c ||= class Zook | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters