Skip to content

Commit

Permalink
Merge pull request #2678 from mark-cooper/dev-pry-updates
Browse files Browse the repository at this point in the history
Some dev related pry updates
  • Loading branch information
ladyintertect committed Apr 25, 2022
2 parents a37fced + 26e893a commit 126b7f0
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 6 deletions.
5 changes: 5 additions & 0 deletions backend/app/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
ASpaceCoverage.start('backend_integration')
end

if ENV["ASPACE_ENV"] == "development"
Bundler.require(:development)
ASUtils.load_pry_aliases
end

require_relative 'lib/bootstrap'
ASpaceEnvironment.init

Expand Down
14 changes: 8 additions & 6 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@
<parallel>
<record name="backend_test_log.out" action="start" />
<java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../backend">
<jvmarg line="-Daspace.service=backend -Daspace.config.backend_url=http://localhost:${aspace.backend.port} -Daspace.config.ignore_schema_info_check=true ${default_java_options} ${env.JAVA_OPTS}"/>
<jvmarg line="-Daspace.service=backend -Daspace.config.backend_url=http://localhost:${aspace.backend.port} -Daspace.config.ignore_schema_info_check=true ${default_java_options} ${env.JAVA_OPTS} -Djruby.debug.fullTrace=true"/>
<env key="GEM_HOME" value="${gem_home}" />
<env key="GEM_PATH" value="" />
<env key="BUNDLE_PATH" value="${gem_home}" />
<env key="BUNDLE_GEMFILE" value="" />
<env key="ASPACE_ENV" value="development" />
<env key="ASPACE_INTEGRATION" value="${aspace.integration}" />
<env key="JRUBY_OPTS" value="--debug" />
<env key="APPCONFIG_DATA_DIRECTORY" value="${aspace.data_directory.dev}" />
<env key="APPCONFIG_DB_URL" value="${env.APPCONFIG_DB_URL}" />
<env key="APPCONFIG_SOLR_URL" value="${env.APPCONFIG_SOLR_URL}" />
Expand Down Expand Up @@ -584,13 +584,14 @@
<!-- INDEXER -->
<target name="indexer" depends="set-classpath" description="Run the search indexer">
<java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../indexer">
<jvmarg line="-Daspace.service=indexer -Daspace.config.backend_url=http://localhost:${aspace.backend.port}/ ${default_java_options} ${env.JAVA_OPTS}"/>
<jvmarg line="-Daspace.service=indexer -Daspace.config.backend_url=http://localhost:${aspace.backend.port}/ ${default_java_options} ${env.JAVA_OPTS} -Djruby.debug.fullTrace=true"/>
<env key="GEM_HOME" value="${gem_home}" />
<env key="GEM_PATH" value="" />
<env key="BUNDLE_PATH" value="${gem_home}" />
<env key="APPCONFIG_DATA_DIRECTORY" value="${aspace.data_directory.dev}" />
<env key="APPCONFIG_DB_URL" value="${env.APPCONFIG_DB_URL}" />
<env key="APPCONFIG_SOLR_URL" value="${env.APPCONFIG_SOLR_URL}" />
<env key="ASPACE_ENV" value="development" />
<arg line="app/main.rb" />
</java>
</target>
Expand Down Expand Up @@ -664,12 +665,12 @@
</condition>
<record name="frontend_test_log.out" action="start" />
<java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../frontend">
<jvmarg line="-Daspace.service=frontend -Daspace.config.backend_url=http://localhost:${aspace.backend.port} ${default_java_options} ${env.JAVA_OPTS}"/>
<jvmarg line="-Daspace.service=frontend -Daspace.config.backend_url=http://localhost:${aspace.backend.port} ${default_java_options} ${env.JAVA_OPTS} -Djruby.debug.fullTrace=true"/>
<env key="GEM_HOME" value="${gem_home}" />
<env key="GEM_PATH" value="" />
<env key="RAILS_ENV" value="${rails.env}" />
<env key="BUNDLE_PATH" value="${gem_home}" />
<env key="JRUBY_OPTS" value="--debug" />
<env key="ASPACE_ENV" value="development" />
<env key="ASPACE_INTEGRATION" value="${aspace.integration}" />
<env key="APPCONFIG_DATA_DIRECTORY" value="${aspace.data_directory.dev}" />
<env key="APPCONFIG_DB_URL" value="${env.APPCONFIG_DB_URL}" />
Expand Down Expand Up @@ -779,10 +780,11 @@

<target name="public:devserver" depends="set-classpath, public:clean, public:copy-shared-resources" description="Start an instance of the ArchivesSpacePublic development server">
<java classpath="${jruby_classpath}" classname="org.jruby.Main" fork="true" failonerror="true" dir="../public">
<jvmarg line="-Daspace.service=public -Daspace.config.backend_url=http://localhost:${aspace.backend.port}/ -Daspace.config.public_url=http://localhost:${aspace.public.port}/ ${default_java_options} ${env.JAVA_OPTS}"/>
<jvmarg line="-Daspace.service=public -Daspace.config.backend_url=http://localhost:${aspace.backend.port}/ -Daspace.config.public_url=http://localhost:${aspace.public.port}/ ${default_java_options} ${env.JAVA_OPTS} -Djruby.debug.fullTrace=true"/>
<env key="GEM_HOME" value="${gem_home}" />
<env key="GEM_PATH" value="" />
<env key="BUNDLE_PATH" value="${gem_home}" />
<env key="ASPACE_ENV" value="development" />
<env key="ASPACE_INTEGRATION" value="${aspace.integration}" />
<env key="APPCONFIG_DATA_DIRECTORY" value="${aspace.data_directory.dev}" />
<env key="APPCONFIG_DB_URL" value="${env.APPCONFIG_DB_URL}" />
Expand Down
9 changes: 9 additions & 0 deletions common/asutils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -419,4 +419,13 @@ def self.order_plugins(plugin_dirs)
ordered_plugins.index(plugin_name) or raise "Expected to find #{plugin_name} but didn't!"
}
end

def self.load_pry_aliases
if defined?(PryDebuggerJRuby)
Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'
Pry.commands.alias_command 'f', 'finish'
end
end
end
1 change: 1 addition & 0 deletions frontend/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
ASUtils.load_pry_aliases
end

module ArchivesSpace
Expand Down
1 change: 1 addition & 0 deletions public/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ group :development, :test do
gem 'pry', '~> 0.12.2'
gem 'pry-nav'
gem 'pry-rails'
gem 'pry-debugger-jruby', '>= 1.2.2'
gem 'mizuno-aspace'
end

Expand Down
5 changes: 5 additions & 0 deletions public/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ GEM
coderay (~> 1.1.0)
method_source (~> 0.9.0)
spoon (~> 0.0)
pry-debugger-jruby (1.2.2-java)
pry (>= 0.10, < 0.13)
ruby-debug-base (>= 0.10.4, < 0.12)
pry-nav (0.3.0)
pry (>= 0.9.10, < 0.13.0)
pry-rails (0.3.9)
Expand Down Expand Up @@ -227,6 +230,7 @@ GEM
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.6.0)
ruby-debug-base (0.11.0-java)
rubyzip (2.3.2)
sass (3.7.4)
sass-listen (~> 4.0.0)
Expand Down Expand Up @@ -313,6 +317,7 @@ DEPENDENCIES
net-http-persistent (= 2.8)
nokogiri (>= 1.10.8)
pry (~> 0.12.2)
pry-debugger-jruby (>= 1.2.2)
pry-nav
pry-rails
rails (= 5.2.5)
Expand Down
1 change: 1 addition & 0 deletions public/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
ASUtils.load_pry_aliases

module ArchivesSpacePublic
class Application < Rails::Application
Expand Down

0 comments on commit 126b7f0

Please sign in to comment.