[Archivesspace_Users_Group] archivesspace newbie questions

Majewski, Steven Dennis (sdm7g) sdm7g at eservices.virginia.edu
Wed Feb 10 11:28:20 EST 2016


Thanks for the pry-remote tip, Dave.

I’ve found that using ‘binding.pry’ from running backend:devserver does take input, but not reliably.
The symptoms look to me like it’s trying to take input from more than one thread: I can get a two letter
command like ‘cd’ or ‘ls’ to work, but something like ‘exit’ takes several tries as it does not receive
all of the characters.  Googling the issue finds some problems with jruby and/or MacOS readline implementation.
I was going to try to find a way to hack around it with commands in .pryrc , but pry-remote looks like it
may be the simpler solution.

I’m also using pry directly from the console on the backend, and pry with pry-rails in the frontend along with
rbenv. binding.pry and other pry functions (as well as awesome_print gem) work OK in that environment.

For that, I’ve copied most of the env settings from the ArchivesSpace jirb script, but I replace the rbenv
shims path with the actual path for rbenv installed jruby — otherwise some of the ./build/run scripts
endlessly loop when trying to run some tasks:

PATH=$(dirname $(rbenv which gem)):$PATH  # put actual programs ahead of shims...

then I run one of:

if [ "$1" = "backend" ]
then
shift
export BUNDLE_GEMFILE=$BACKEND_GEMFILE
bundle exec pry --no-pager -r backend/app/main.rb -r awesome_print
elif [ "$1" = "frontend" ]
then
shift
export BUNDLE_GEMFILE=$FRONTEND_GEMFILE
cd frontend
bundle exec rails console
fi


If I’m debugging one particular component rather than the whole system, sometimes it’s easier to just
issue commands from the console in pry rather than use binding.pry breakpoints.


— Steve Majewski


On Feb 9, 2016, at 11:28 PM, Mayo, Dave <dave_mayo at harvard.edu<mailto:dave_mayo at harvard.edu>> wrote:

Hi Esha,

As far as running bundler, I've found that running:

./build/run bundler -Dgemfile=../backend/Gemfile

from the archivesspace root directory gets the contents of that Gemfile installed properly.

I'm running my devserver via `.build/run backend:devserver`.  If you're doing the same, `binding.pry` STILL won't work, because the backend doesn't log directly to console, and whatever intermediate it's using (Ant? I think Ant) only does output.  What I DID get working was installing the pry-remote Gem, and then doing `binding.remote_pry` and connecting from another terminal.

Let me know if this works out for you, or if there's anything else I can possibly do to help.

- Dave Mayo
  Library Software Engineer
  Harvard University -> HUIT -> LTS


From:  Esha Datta <esha at nyu.edu<mailto:esha at nyu.edu>>
Reply-To:  "esha at nyu.edu<mailto:esha at nyu.edu>" <esha at nyu.edu<mailto:esha at nyu.edu>>, Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org<mailto:archivesspace_users_group at lyralists.lyrasis.org>>
Date:  Tuesday, February 9, 2016 at 8:04 PM
To:  "archivesspace_users_group at lyralists.lyrasis.org<mailto:archivesspace_users_group at lyralists.lyrasis.org>" <archivesspace_users_group at lyralists.lyrasis.org<mailto:archivesspace_users_group at lyralists.lyrasis.org>>
Subject:  [Archivesspace_Users_Group] archivesspace newbie questions


Hi,

I'm a developer with NYU's Bobst Library and am new to JRuby and ArchivesSpace. I have to write a plugin and am trying to use pry for stepping through some code. I have done some rails work before and tried to install pry by adding it to the backend/ Gemfile
and then running ./scripts/jruby -S bundle install. The command ran but didn't install pry. I then tried to install it by doing the following:
./scripts/jruby -S gem install pry
That installed pry but when I tried to use it in the backend by doing "binding.pry", I got an error saying it's an undefined method. If anyone has pointers as to how to use pry in this environment, I'd really appreciate it. Basically, I'm trying to figure
out what certain objects have and return in order to write the plugin.

Also, I will need to write tests for the plugin. Sorry, if I've missed documentation in how to write tests for the plugin and how to run them. If someone could point me to that, I'd really appreciate it.

Thanks for your time.

Esha

_______________________________________________
Archivesspace_Users_Group mailing list
Archivesspace_Users_Group at lyralists.lyrasis.org<mailto:Archivesspace_Users_Group at lyralists.lyrasis.org>
http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20160210/b8434007/attachment.html>


More information about the Archivesspace_Users_Group mailing list