On Wed, May 13, 2020 at 1:03 PM Craig Russell <apache....@gmail.com> wrote:
>
> Thanks for the suggestion. I think I did it right. Could you please take a 
> look?

LGTM.

> Also, how do I test this on my own machine?

I would suggest either:

  1) Using https://github.com/apache/whimsy/blob/master/SETUPMYMAC.md,
and visiting http://whimsy.local/roster/

  2) Creating a virtual machine using VirtualBox, loading Ubuntu on
it, and running
      https://github.com/apache/whimsy/blob/master/UBUNTU.md

> [MacBook-Pro-10:~/apache/git/whimsy] clr% cd www/roster/
> [MacBook-Pro-10:whimsy/www/roster] clr% rake server
> bundle update
> /usr/local/Cellar/ruby/2.3.1/lib/ruby/2.3.0/digest.rb:16:in `const_missing': 
> library not found for class Digest::MD5 -- digest/md5 (LoadError)

It looks like that library was introduced in Ruby version 2.4:

https://ruby-doc.org/stdlib-2.4.0/libdoc/digest/rdoc/Digest/MD5.html

whimsy-vm4.apache.org runs Ruby 2.4.1.  That version or later would be fine.

If you do want to run this tool standalone, it will currently fail
with an error in "NSCFConstantString initialize" on Mac machines.  A
workaround would be to set

export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

>         from 
> /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.4/lib/bundler/source/rubygems/remote.rb:26:in
>  `cache_slug'
>         from 
> /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.4/lib/bundler/fetcher/compact_index.rb:107:in
>  `cache_path'
>         from 
> /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.4/lib/bundler/fetcher/compact_index.rb:83:in
>  `compact_index_client'
>         from 
> /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.4/lib/bundler/cli.rb:643:in 
> `warn_on_outdated_bundler'
>         from 
> /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.4/lib/bundler/cli.rb:24:in 
> `block in dispatch'
>         from 
> /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor.rb:384:in
>  `dispatch'
>         from 
> /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.4/lib/bundler/cli.rb:22:in 
> `dispatch'
>         from 
> /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/base.rb:466:in
>  `start'
>         from 
> /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.4/lib/bundler/cli.rb:13:in 
> `start'
>         from 
> /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.4/exe/bundle:30:in `block in 
> <top (required)>'
>         from 
> /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.4/lib/bundler/friendly_errors.rb:121:in
>  `with_friendly_errors'
>         from 
> /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.4/exe/bundle:22:in `<top 
> (required)>'
>         from /usr/local/bin/bundle:23:in `load'
>         from /usr/local/bin/bundle:23:in `<main>'
> rake aborted!
> Command failed with status (1): [bundle update...]
> /Users/clr/apache/git/whimsy/www/roster/Rakefile:9:in `block in <top 
> (required)>'
> /usr/local/lib/ruby/gems/2.3.0/gems/rake-12.3.0/exe/rake:27:in `<top 
> (required)>'
> Tasks: TOP => server => bundle => Gemfile.lock
> (See full trace by running task with --trace)

- Sam Ruby

> > On May 12, 2020, at 5:57 PM, Sam Ruby <ru...@intertwingly.net> wrote:
> >
> > On Tue, May 12, 2020 at 7:36 PM Craig Russell <apache....@gmail.com> wrote:
> >>
> >> https://github.com/apache/whimsy/pull/93
> >>
> >> I'm starting this project with a simple(r) task: allowing the roster 
> >> committer page to display any files related to the member's emeritus 
> >> status: files in documents/emeritus and 
> >> documents/emeritus-requests-received.
> >>
> >> I added a find method to the EmeritusRequestFiles and EmeritusFiles 
> >> classes. There should be a way to *not* copy and paste the details of 
> >> these methods, like a generic or static method.
> >
> > Looks like a job for inheritance.  Example:
> >
> > class Base
> >  def self.find(name)
> >    self.value[name]
> >  end
> > end
> >
> > class First < Base
> >  def self.value
> >    {text: 'first class'}
> >  end
> > end
> >
> > class Second < Base
> >  def self.value
> >    {text: 'second class'}
> >  end
> > end
> >
> > puts First.find(:text)
> > puts Second.find(:text)
> >
> >> Suggestions/comments are appreciated.
> >>
> >> Thanks,
> >> Craig
> >
> > - Sam Ruby
> >
> >>> On May 6, 2020, at 1:01 PM, Sam Ruby <ru...@intertwingly.net> wrote:
> >>>
> >>> On Wed, May 6, 2020 at 3:48 PM Craig Russell <apache....@gmail.com> wrote:
> >>>>
> >>>> I've been looking for where the roster post actions are handled. I have 
> >>>> the model for committer and the html in the browser.
> >>>>
> >>>> But where are post action:emeritus and action:active handled?
> >>>
> >>> All of the routes are defined here:
> >>>
> >>> https://github.com/apache/whimsy/blob/master/www/roster/main.rb
> >>>
> >>> Unless you have unusual needs, you can take advantage of the generic
> >>> route defined here:
> >>>
> >>> https://github.com/apache/whimsy/blob/1316a898d5e8c91e8a33d89565d12efc4842dd56/www/roster/main.rb#L343
> >>>
> >>> If you use that route, then /actions/emeritus will invoke a script by
> >>> that name in the whimsy/www/roster/views/actions directory, and will
> >>> take value returned by the last line, convert it to JSON and sent the
> >>> results back to the client.
> >>>
> >>>> Thanks,
> >>>> Craig
> >>>
> >>> - Sam Ruby
> >>>
> >>>> Craig L Russell
> >>>> c...@apache.org
> >>>>
> >>
> >> Craig L Russell
> >> c...@apache.org
> >>
>
> Craig L Russell
> c...@apache.org
>

Reply via email to