rtomayko/replicate — pull request #21 by iangreenleaf (2012-11-20 00:58:37+00:00)
Title: Make load_script available to scripts?

Here's what I'm trying to do: I want to keep our replicate scripts DRY, so I have a number of scripts like `users.rb` and `recent_messages.rb` that each do one thing. However, I'd also like to have a `seed.rb` script that combines the most important of these scripts to bring a database from clean slate to useful with one click.

The way I'm trying to do it is to use `load_script` in my seed script:

```ruby
root = File.dirname(__FILE__)
load_script File.join root, 'users.rb'
load_script File.join root, 'recent_messages.rb'
```

Is this the best way to go about it? If so, we should make replicate's `load_script` method available to the context invoked by... `load_script`.

Or is there some other way of accomplishing this that I haven't thought of?