Skip to content

Commit

Permalink
Moved RegistrationService from dor-services.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinlittman committed Mar 13, 2019
1 parent a6fccdd commit 10eb5f6
Show file tree
Hide file tree
Showing 11 changed files with 1,159 additions and 28 deletions.
104 changes: 82 additions & 22 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2019-02-08 14:54:24 -0600 using RuboCop version 0.57.2.
# on 2019-03-13 10:55:45 -0400 using RuboCop version 0.57.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -21,6 +21,14 @@ Layout/EmptyLines:
- 'config/environments/development.rb'
- 'config/environments/production.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: empty_lines, no_empty_lines
Layout/EmptyLinesAroundBlockBody:
Exclude:
- 'spec/services/registration_service_spec.rb'

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: IndentationWidth.
Expand Down Expand Up @@ -56,6 +64,14 @@ Layout/SpaceInsideArrayLiteralBrackets:
Exclude:
- 'config/environments/production.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: final_newline, final_blank_line
Layout/TrailingBlankLines:
Exclude:
- 'spec/rails_helper.rb'

# Offense count: 12
# Cop supports --auto-correct.
# Configuration parameters: AllowInHeredoc.
Expand All @@ -71,10 +87,11 @@ Lint/AmbiguousBlockAssociation:
Exclude:
- 'config/deploy.rb'

# Offense count: 1
# Offense count: 2
Lint/HandleExceptions:
Exclude:
- 'lib/tasks/rspec.rake'
- 'spec/support/foxml_helper.rb'

# Offense count: 1
# Configuration parameters: MaximumRangeSize.
Expand All @@ -88,26 +105,34 @@ Lint/UriEscapeUnescape:
- 'app/controllers/sdr_controller.rb'
- 'spec/controllers/sdr_controller_spec.rb'

# Offense count: 10
# Offense count: 13
Metrics/AbcSize:
Max: 30
Max: 119

# Offense count: 1
# Offense count: 2
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 121
Max: 139

# Offense count: 6
# Offense count: 2
Metrics/CyclomaticComplexity:
Max: 24

# Offense count: 20
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 13
Max: 58

# Offense count: 2
Metrics/PerceivedComplexity:
Max: 24

# Offense count: 9
Naming/AccessorMethodName:
Exclude:
- 'app/models/dor/update_marc_record_service.rb'

# Offense count: 3
# Offense count: 4
# Configuration parameters: Blacklist.
# Blacklist: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
Naming/HeredocDelimiterNaming:
Expand All @@ -129,12 +154,13 @@ Naming/VariableName:
Exclude:
- 'spec/rails_helper.rb'

# Offense count: 10
# Offense count: 15
RSpec/AnyInstance:
Exclude:
- 'spec/controllers/objects_controller_spec.rb'
- 'spec/controllers/workflows_controller_spec.rb'
- 'spec/dor/update_marc_record_service_spec.rb'
- 'spec/services/registration_service_spec.rb'

# Offense count: 1
RSpec/BeforeAfterAll:
Expand All @@ -144,14 +170,15 @@ RSpec/BeforeAfterAll:
- 'spec/support/**/*.rb'
- 'spec/dor/update_marc_record_service_spec.rb'

# Offense count: 13
# Offense count: 18
# Configuration parameters: Prefixes.
# Prefixes: when, with, without
RSpec/ContextWording:
Exclude:
- 'spec/controllers/objects_controller_spec.rb'
- 'spec/controllers/sdr_controller_spec.rb'
- 'spec/dor/update_marc_record_service_spec.rb'
- 'spec/services/registration_service_spec.rb'

# Offense count: 1
RSpec/DescribeClass:
Expand Down Expand Up @@ -180,7 +207,7 @@ RSpec/EmptyLineAfterSubject:
Exclude:
- 'spec/models/symphony_reader_spec.rb'

# Offense count: 26
# Offense count: 31
# Configuration parameters: Max.
RSpec/ExampleLength:
Exclude:
Expand All @@ -190,22 +217,25 @@ RSpec/ExampleLength:
- 'spec/dor/goobi_spec.rb'
- 'spec/dor/service_item_spec.rb'
- 'spec/dor/update_marc_record_service_spec.rb'
- 'spec/services/registration_service_spec.rb'
- 'spec/services/release_tags_spec.rb'

# Offense count: 1
# Offense count: 4
RSpec/ExpectInHook:
Exclude:
- 'spec/dor/update_marc_record_service_spec.rb'
- 'spec/services/registration_service_spec.rb'

# Offense count: 77
# Offense count: 146
# Configuration parameters: AssignmentOnly.
RSpec/InstanceVariable:
Exclude:
- 'spec/dor/registration_response_spec.rb'
- 'spec/dor/service_item_spec.rb'
- 'spec/dor/update_marc_record_service_spec.rb'
- 'spec/services/registration_service_spec.rb'

# Offense count: 21
# Offense count: 26
# Configuration parameters: EnforcedStyle.
# SupportedStyles: have_received, receive
RSpec/MessageSpies:
Expand All @@ -215,12 +245,17 @@ RSpec/MessageSpies:
- 'spec/controllers/workflows_controller_spec.rb'
- 'spec/dor/goobi_spec.rb'
- 'spec/dor/update_marc_record_service_spec.rb'
- 'spec/services/registration_service_spec.rb'

# Offense count: 51
# Offense count: 57
# Configuration parameters: AggregateFailuresByDefault.
RSpec/MultipleExpectations:
Max: 5

# Offense count: 9
RSpec/NestedGroups:
Max: 5

# Offense count: 7
# Configuration parameters: Strict, EnforcedStyle.
# SupportedStyles: inflected, explicit
Expand Down Expand Up @@ -265,7 +300,20 @@ Rails/FilePath:
- 'config/environments/development.rb'
- 'spec/rails_helper.rb'

# Offense count: 11
# Offense count: 2
Style/CommentedKeyword:
Exclude:
- 'spec/services/registration_service_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
# SupportedStyles: assign_to_condition, assign_inside_condition
Style/ConditionalAssignment:
Exclude:
- 'spec/support/foxml_helper.rb'

# Offense count: 12
Style/Documentation:
Exclude:
- 'spec/**/*'
Expand All @@ -278,6 +326,7 @@ Style/Documentation:
- 'app/models/dor/registration_response.rb'
- 'app/models/dor/service_item.rb'
- 'app/models/dor/update_marc_record_service.rb'
- 'app/services/registration_service.rb'
- 'config/application.rb'
- 'config/initializers/okcomputer.rb'

Expand Down Expand Up @@ -306,7 +355,7 @@ Style/GuardClause:
Exclude:
- 'config/initializers/okcomputer.rb'

# Offense count: 42
# Offense count: 43
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
Expand All @@ -332,13 +381,14 @@ Style/IfUnlessModifier:
Style/NumericLiterals:
MinDigits: 11

# Offense count: 12
# Offense count: 13
# Cop supports --auto-correct.
# Configuration parameters: PreferredDelimiters.
Style/PercentLiteralDelimiters:
Exclude:
- 'app/controllers/sdr_controller.rb'
- 'app/models/dor/update_marc_record_service.rb'
- 'app/services/registration_service.rb'
- 'config/deploy.rb'
- 'config/deploy/prod.rb'
- 'config/deploy/stage.rb'
Expand All @@ -347,6 +397,12 @@ Style/PercentLiteralDelimiters:
- 'spec/dor/service_item_spec.rb'
- 'spec/dor/update_marc_record_service_spec.rb'

# Offense count: 2
# Cop supports --auto-correct.
Style/PerlBackrefs:
Exclude:
- 'app/services/registration_service.rb'

# Offense count: 13
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
Expand All @@ -362,13 +418,17 @@ Style/StringLiterals:

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: MinSize.
# Configuration parameters: EnforcedStyle, MinSize.
# SupportedStyles: percent, brackets
Style/SymbolArray:
EnforcedStyle: brackets
Exclude:
- 'app/controllers/versions_controller.rb'
- 'app/services/release_tags.rb'
- 'lib/tasks/rspec.rake'

# Offense count: 2
# Offense count: 3
# Cop supports --auto-correct.
Style/ZeroLengthPredicate:
Exclude:
- 'app/models/dor/update_marc_record_service.rb'
- 'app/services/registration_service.rb'
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ gem 'rest-client'
# Pin net-http-persistent to avoid a problem with exhausting file handles when running under load
gem 'net-http-persistent', '~> 2.9'
gem 'marc'
gem 'uuidtools', '~> 2.1.4'

# DLSS/domain-specific dependencies
gem 'dor-services', '~> 6.1'
Expand Down
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ DEPENDENCIES
simplecov
spring
spring-watcher-listen (~> 2.0.0)
uuidtools (~> 2.1.4)
webmock
workflow-archiver (~> 3.0)

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/objects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ObjectsController < ApplicationController
# Register new objects in DOR
def create
Rails.logger.info(params.inspect)
reg_response = Dor::RegistrationService.create_from_request(create_params)
reg_response = RegistrationService.create_from_request(create_params)
Rails.logger.info(reg_response)
pid = reg_response[:pid]

Expand Down

0 comments on commit 10eb5f6

Please sign in to comment.