I think I saw a script for processing ERb in SQL either on this list or the wiki. Can someone please give me a pointer. Thanks. Michael -- Michael Schuerig The more it stays the same, mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org The less it changes! http://www.schuerig.de/michael/ --Spinal Tap, The Majesty of Rock
Hey Michael- I saw that same blog post. It was on Robby Russell''s blog <http://www.robbyonrails.com/>. For some reason I can''t get the blog to come up right now but I definitely saw a post there a while ago about storing erb templates in the db and redering them inline. HTH- -Ezra Zygmuntowicz WebMaster Yakima Herald-Republic Newspaper ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org 509-577-7732 On Aug 10, 2005, at 4:10 AM, Michael Schuerig wrote:> > I think I saw a script for processing ERb in SQL either on this > list or > the wiki. Can someone please give me a pointer. > > Thanks. > Michael > > -- > Michael Schuerig The more it stays the same, > mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org The less it changes! > http://www.schuerig.de/michael/ --Spinal Tap, The Majesty of Rock > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On Wednesday 10 August 2005 16:28, Ezra Zygmuntowicz wrote:> I saw that same blog post. It was on Robby Russell''s blog > <http://www.robbyonrails.com/>. For some reason I can''t get the blog > to come up right now but I definitely saw a post there a while ago > about storing erb templates in the db and redering them inline.I can access the blog again, now. He''s concerned with a different problem though, namely storing templates in the DB. In contrast, I''d like to modularize my create_db.sql definitions with the help of ERb. Michael -- Michael Schuerig Life is just as deadly mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org As it looks http://www.schuerig.de/michael/ --Richard Thompson, Sibella
On Wed, Aug 10, 2005, Michael Schuerig wrote:> I think I saw a script for processing ERb in SQL either on this list or > the wiki. Can someone please give me a pointer.I''ve seen a few projects (particularly the Salted Login Generator) use the db_structure code to do this. http://rubyforge.org/projects/db-structure/ Hopefully that''s closer to what you want. Ben
On Aug 10, 2005, at 9:54 AM, Michael Schuerig wrote:> On Wednesday 10 August 2005 16:28, Ezra Zygmuntowicz wrote: > > >> I saw that same blog post. It was on Robby Russell''s blog >> <http://www.robbyonrails.com/>. For some reason I can''t get the blog >> to come up right now but I definitely saw a post there a while ago >> about storing erb templates in the db and redering them inline. >> > > I can access the blog again, now. He''s concerned with a different > problem though, namely storing templates in the DB. In contrast, I''d > like to modularize my create_db.sql definitions with the help of ERb. > > Michael > > -- > Michael Schuerig Life is just as deadly > mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org As it looks > http://www.schuerig.de/michael/ --Richard Thompson, Sibella > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >Michael- OK I misunderstood. But I know what you are talking about now. I htink this is what you are looking for: http://dev.rubyonrails.com/ changeset/1910 HTH- -Ezra Zygmuntowicz Yakima Herald-Republic WebMaster 509-577-7732 ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org
> Michael- > OK I misunderstood. But I know what you are talking about now. I > htink this is what you are looking for: http://dev.rubyonrails.com/ > changeset/1910Still not it. That''s for using ERB code in the database.yml file. Ben pointed to the right project it looks like. I thought it was something for Instiki and made some additions. Guess I should submit them as patches to the actual product... -- rick http://techno-weenie.net
On Wednesday 10 August 2005 19:14, Ben Bleything wrote:> On Wed, Aug 10, 2005, Michael Schuerig wrote: > > I think I saw a script for processing ERb in SQL either on this > > list or the wiki. Can someone please give me a pointer. > > I''ve seen a few projects (particularly the Salted Login Generator) > use the db_structure code to do this. > > http://rubyforge.org/projects/db-structure/ > > Hopefully that''s closer to what you want.Yes, it exactly is. Which is somewhat embarassing as I had it printed out before me. Don''t ask, why I didn''t get that I can of course use it to define my own variables. Sigh. I''d almost rewritten it myself. Anyway, on a more productive note, below is a rake task for combining and ERb processing stylesheets, another area that can do with some abstraction. Michael desc "Update stylesheets" task :update_stylesheets do require ''erb'' FileList[File.join(File.dirname(__FILE__), ''stylesheets/*/'')].each do |stylesheet_dir| name = stylesheet_dir.sub(/\/$/, '''') + ''.css'' puts "Updating #{name}..." src = FileList["#{stylesheet_dir}/*.css"].sort.inject('''') do | result, f| result << File.read(f) end File.open(name, ''w+'') do |out| out.puts ERB.new(src).result.gsub(/^\s+/, '''') end end end -- Michael Schuerig Most people would rather die than think. mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org In fact, they do. http://www.schuerig.de/michael/ --Bertrand Russell