Closed bitboxer closed 10 years ago
My proposal:
In your Rakefile:
require "rubygems"
require "exogenesis"
Output.fancy
Exogenesis.register([Dotfile.new, OhMyZSH.new])
And than
bundle exec rake exogenesis:install
Yep, I like the idea of Exogenesis.register :+1: The following solution would be a little bit more rspec-esque (= more "best practice"?):
require "rubygems"
require "exogenesis/raketask"
Exogenesis.board([Dotfile.new, OhMyZSH.new])
Exogenesis::RakeTask.new(:setup) do |setup|
# Configuration....
end
What do you think? And what do you think of Exogenesis.board
instead of register
? We're in space!
:+1: for board
.
For the setup: what exactly do you want to do in there?
This would add the RakeTask setup
calling setup on all but this makes no sense... It doesn't help at all. Sorry for that :laughing:
What do you think about this solution:
require "rubygems"
require "exogenesis"
# Configure the output style
Exogenesis.fancy_output # calls Output.fancy
# Configure the package managers
Exogenesis.board([
Dotfile.new,
OhMyZSH.new("moonglum"),
Homebrew.new(packages["brews"]),
Vundle.new,
Rvm.new(packages["rubies"])
])
# Add the Rake tasks `setup`, `install` and `update`
Exogenesis.init_rake_tasks(:setup, :install, :update)
I'm also thinking about putting all the exogenesis classes into an exogenesis module (as its standard with gems). Then we could write some thing like this:
require "rubygems"
require "exogenesis"
include Exogenesis
# Configure the output style
fancy_output # calls Output.fancy
# Configure the package managers
board([
Dotfile.new,
OhMyZSH.new("moonglum"),
Homebrew.new(packages["brews"]),
Vundle.new,
Rvm.new(packages["rubies"])
])
# Add the Rake tasks `setup`, `install` and `update`
init_rake_tasks(:setup, :install, :update)
Why should we need to add the Rake tasks manually? Can't they just be automatically added as rake exogenesis:setup
?
Not exactly sure what you mean. Do you mean why we need a init_rake_task
? The reason for that is that if you require exogenesis
it should not add anything to your Raketask, because the user may not have rake
because he or she created a setup.rb
without any Rake.
Do you mean why I want to give arguments to the init_rake_tasks
? Because a user may not want to install all tasks, but only a few. We could however have the option to give no arguments, which would then just install all tasks.
No, I mean that gems can provide their own Rake tasks that you can use in your app. There is no need for manual registering those tasks.
I see no point in only using "setup" and not "uninstall"
Ok, now I understand :wink: Sounds like a nice idea, because it won't get in the way of people using other tools than Rake. Let's do it.
Since you said in #22 that we should use Thor, we should close this one. I prefer Thor, too!
Yep.
Instead of letting everyone add their own Rake Tasks, I think it would be better to have the rake tasks defined in exogenesis. What you you think?