On Mon, 3 Jun 2019 at 02:16, Sam Ruby <ru...@intertwingly.net> wrote: > > On Sun, Jun 2, 2019 at 8:01 PM Shane Curcuru <a...@shanecurcuru.org> wrote: > > > > sebb wrote on 2019-6-2 7:30PM EDT: > > > On Mon, 3 Jun 2019 at 00:08, <curc...@apache.org> wrote: > > >> > > >> This is an automated email from the ASF dual-hosted git repository. > > >> > > >> curcuru pushed a commit to branch mail_ldap_notification > > >> in repository https://gitbox.apache.org/repos/asf/whimsy.git > > >> > > >> commit 5e74b3aac094e105af73c3c49ec09f49e33d9e31 > > >> Author: Shane Curcuru <a...@shanecurcuru.org> > > >> AuthorDate: Sun Jun 2 19:08:05 2019 -0400 > > >> > > >> Encapsulate sending mail from roster tool > > >> > > >> In progress; currently gives "ReferenceError: Can't find variable: > > >> __FILE__" > > > > > > I think that is because the file is converted to Javascript (*.js.rb) > > > __FILE__ is a Ruby construct. > > > > > > Is it intended that Javascript should send the email directly from the > > > browser client? > > > > It's simply encapsulating the same duplicated code in various > > roster/views/actions/*.json.rb files, like appgroup/committee/etc. > > While they each process the to/cc and such differently, the core > > mail.new.... deliver etc. code is the same, and it felt useful to put > > them all in the same place. > > > > I also hope to use ERB templates for the mail bodies, so it's easier to > > maintain, and add an X-mailer header. > > > > But obviously I'm not understanding some of the limitations the ruby2js > > steps put on the code (like not being able to def func(keyword: arg) ) > > yet. > > What's not obvious is that the contents of the views directory > *except* for the actions subdirectory are run on the client. If there > is a desire to factor out code from actions, it needs to be placed > outside of the views directory and required by main.rb.
Also the actions directory contains files named *.json.rb whereas the others are *.js.rb and *.html.rb > [just catching up on the mailing list after talking Shane through this > via slack] > > > -- > > > > - Shane > > Whimsy PMC > > The Apache Software Foundation > > - Sam Ruby