-
-
Save timoschilling/563c6df6bed0e1511375 to your computer and use it in GitHub Desktop.
demo simple rake
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require "./rake_lib" | |
| require "./test_task" | |
| exec ARGV.first.to_sym |
This file contains hidden or 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
| @tasks = {} | |
| def task name, &block | |
| @tasks[name] = block | |
| end | |
| def exec name | |
| @tasks[name].call | |
| end |
This file contains hidden or 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
| task :foo do | |
| puts "foo" | |
| end | |
| task :bar do | |
| puts "bar" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment