There is no reason not to use application/front_site.dryml! But let me
illustrate what is happening up.
Let's say I have a views directory
app/views
books
users
taglibs
Instead I want to have
app/views
books
view_widgets
users
view_widgets
taglibs
site_widgets
Same sturucture change applies to subsites as well.
Then my script browses the directories and makes a
taglibs/front_site_widgets.dryml included in application/front_site.dryml.
Instead I want to have
app/views
books
view_widgets
users
view_widgets
taglibs
site_widgets
For each tag I am making, I drop the related file to related directory
simply. e.g.
app/views
books
view_widgets
card.dryml
users
view_widgets
form.dryl
taglibs
site_widgets
input_for_YetAnotherRichInput.dryml
page.dryml
This idea works for only polymorphic tags of course. Static tags cannot be
included at random order.
In summary, I wanted to have file per tag instead of grouping them all in
one dryml file. Then it is easier to browse and locate them in the IDE.
There were too many include statements to write and I wrote the include
statement generator.
(Note. Now I am using site_tags and view_tags directories instead of
*widgets)
So I am hunting those places
app/views (front tags)
app/views/subsite (subsite tags)
app/views/taglibs (application wide tags included before anything
else)
On Friday, January 30, 2015 at 5:13:20 PM UTC+1, Ignacio Huerta wrote:
>
> Sorry umuro, I'm a bit lost about your case. Can you describe a bit more
> what are you trying to achieve? Why can you not load the taglibs with
> the usual includes in application/front_site.dryml?
>
> Warm regards,
> Ignacio
>
> El 28-01-2015 a las 03:54, umuro escribió:
> > I am generating include directives. In my project every widget goes to a
> > file.
> >
> > scripts/generate_dryml_includes
> >
> > |
> > #!/usr/bin/env ruby
> >
> >
> > require'pathname'
> >
> >
> > defsubsite_widgets(subsite)
> > views_dir ='app/views'
> >
> > ifsubsite =='front'
> > subsite_views_dir =views_dir
> > else
> > subsite_views_dir =File.join views_dir,subsite.to_s
> > end
> >
> > widget_files =\
> > Dir[File.join subsite_views_dir,'widgets*/**/*.dryml']+\
> > Dir[File.join subsite_views_dir,'*/view_widgets*/**/*.dryml']
> > widgets =widget_files\
> > .map{|f|
> > File.join File.dirname(f),File.basename(f,'.dryml')}\
> > .map{|f|
> >
> >
> Pathname.new(f).relative_path_from(Pathname.new(subsite_views_dir)).to_s }
> >
> > ifsubsite=='taglibs'
> > library ='application'
> > else
> > library =subsite +'_site'
> > end
> >
> > target =File.join(views_dir,'taglibs',library +'_widgets.dryml')
> >
> > File.open(target,'w')do|s|
> > puts
> > puts target
> > puts '===='
> > widgets.each do|w|
> > cmd =%Q{<include src="#{w}"/>}
> > puts cmd
> > s.puts cmd
> > end
> > end
> >
> > end
> >
> >
> > subsite_widgets('taglibs')
> > subsite_widgets('front')
> > subsite_widgets('admin')
> > subsite_widgets('accounting')
> > |
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Hobo Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> > an email to [email protected] <javascript:>
> > <mailto:[email protected] <javascript:>>.
> > To post to this group, send email to [email protected]
> <javascript:>
> > <mailto:[email protected] <javascript:>>.
> > Visit this group at http://groups.google.com/group/hobousers.
> > For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.