Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Example of changing state by running two rake tasks from one invocation.
- #
- $stuff = {}
- desc "foo"
- task :foo do
- $stuff[:data] = "foo"
- puts "foo"
- end
- desc "bar"
- task :bar do
- more = ""
- if $stuff[:data]
- more = "you called #{$stuff[:data]} first"
- end
- puts "bar " + more
- end
- # rake foo # => foo
- # rake bar # => bar
- # rake foo bar # => bar you called foo first
Add Comment
Please, Sign In to add comment