…after doing some googling I see that the rake task is something like:
desc “Configure Subversion for Rails”
task :configure_for_svn do
system “svn remove log/"
system “svn commit -m ‘removing all log files from subversion’”
system 'svn propset svn:ignore ".log” log/’
system “svn update log/”
system “svn commit -m ‘Ignoring all files in /log/ ending in .log’”
end
In this case I will face some problem, to update the roube.rb file
without replacing it, to add some map.connect to it?
Can I store the files somewhere on the internet also that would be
cool
Then Rails::Generator::NamedBase has a method to do this. I found it
while
making a generator to generate generators. I have yet to use this fun
resource but here is the code.
I believe it creates the route.rb file with the resources that are
passed
in, and tries to add it to the current routes. This is a method from the
generator base class. When you create a generator its one of the methods
you
have access to. I did not notice before the gsub_file is another method.
I
am using a frozen version of rails, but the file I found these in are in
the
vender/railites/lib/rails_generator/command.rb I was under the
impression
that you wanted to update the routes file and I believe that this is
what
this code does.
You can you reuse your code in RoR applications. Looking at the http://www.ruby-forum.com/topic/102607 post you can make a plugin (which
I
have not) or a generator. For a generator you can make template of files
and
then run ruby script/generate that_thing_you_made with_some options_too
How complicated are your files? Do they need to dynamic? SVN externals
could
work too.
You can you reuse your code in RoR applications. Looking at the http://www.ruby-forum.com/topic/102607 post you can make a plugin (which
I
have not) or a generator. For a generator you can make template of files
and
then run ruby script/generate that_thing_you_made with_some options_too
How complicated are your files? Do they need to dynamic? SVN externals
could
work too.
Thanks for your reply
my files is simple…
app/models/user.rb
app/controllers/user.rb
app/controllers/application.rb (few methods here) but they can be inside
/lib/ if this would not make it complicated.
app/views/user/
and /config/route.rb (also few routing)
last /db/migrate/001_create_users.rb/ (for creating the table)
This should be my plugin or what ever it can be called
Hope someone can help me through this…
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.