Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WEBSITE-899][WEBSITE-946][WEBSITE-950] Extract components to separate gems. #63

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ gemspec

# Include coveralls for CI coverage reports
gem 'coveralls', require: false

gem 'parliament-grom-decorators', path: '../parliament-grom-decorators'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these are being used for testing we will need to either add them as development dependencies or look at how they are needed within the app.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also breaking tests

gem 'parliament-ntriple', path: '../parliament-ntriple'
1 change: 0 additions & 1 deletion lib/parliament.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
require 'parliament/request'
require 'parliament/response'
require 'parliament/utils'
require 'parliament/decorator'
require 'parliament/builder'

require 'parliament/network_error'
Expand Down
1 change: 0 additions & 1 deletion lib/parliament/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ module Parliament
# @since 0.7.0
module Builder
require 'parliament/builder/base_response_builder'
require 'parliament/builder/ntriple_response_builder'
end
end
13 changes: 11 additions & 2 deletions lib/parliament/builder/base_response_builder.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
module Parliament
module Builder
# API response builder, allowing the user to return the body of an HTTPResponse.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be 'Base response builder'? It's not technically API specific

# @since 0.7.5
class BaseResponseBuilder
def initialize(response)
# Creates a new BaseReponseBuilder.
# @param [HTTPResponse] response an HTTP response containing n-triple data.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it need to contain ntriple data?

# @param [Module] decorators the decorator modules to provide alias methods to the resulting objects.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be more like:

'A namespace which contains modules used to decorate the objects we receive'?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Infact, is this even needed? Our base response doesn't actually use the decorators?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing the code below perhaps we need to mention why it's not used and that it is for API completeness?

def initialize(response:, decorators: nil)
@response = response
@decorators = decorators
end

# Builds a Parliament::Response::BaseResponse.
#
# @return [Parliament::Response::Base::Response] a Parliament::Response::BaseResponse containing the HTTPResponse.
def build
@response
Parliament::Response::BaseResponse.new(@response)
end
end
end
Expand Down
25 changes: 0 additions & 25 deletions lib/parliament/builder/ntriple_response_builder.rb

This file was deleted.

27 changes: 0 additions & 27 deletions lib/parliament/decorator.rb

This file was deleted.

27 changes: 0 additions & 27 deletions lib/parliament/decorator/constituency_area.rb

This file was deleted.

92 changes: 0 additions & 92 deletions lib/parliament/decorator/constituency_group.rb

This file was deleted.

48 changes: 0 additions & 48 deletions lib/parliament/decorator/contact_point.rb

This file was deleted.

13 changes: 0 additions & 13 deletions lib/parliament/decorator/gender.rb

This file was deleted.

13 changes: 0 additions & 13 deletions lib/parliament/decorator/gender_identity.rb

This file was deleted.

41 changes: 0 additions & 41 deletions lib/parliament/decorator/house.rb

This file was deleted.

48 changes: 0 additions & 48 deletions lib/parliament/decorator/house_incumbency.rb

This file was deleted.

Loading