Skip to content

Commit

Permalink
Merge pull request #3 from splittingred/ARCH-225
Browse files Browse the repository at this point in the history
ARCH-225: Make endpoints auto-mount, rename to Gruf::Service
  • Loading branch information
splittingred authored Apr 27, 2017
2 parents b870bd4 + df368f4 commit 2b20bb4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Changelog for the gruf gem. This includes internal history before the gem was made.

h3. 0.10.0

- Rename Gruf::Endpoint to Gruf::Service
- Make services auto-mount to server upon declaration

h3. 0.9.2

- Support mount command on services to allow automatic setup on the server
Expand Down
2 changes: 1 addition & 1 deletion lib/gruf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
require_relative 'gruf/configuration'
require_relative 'gruf/authentication'
require_relative 'gruf/hooks/registry'
require_relative 'gruf/endpoint'
require_relative 'gruf/service'
require_relative 'gruf/timer'
require_relative 'gruf/response'
require_relative 'gruf/error'
Expand Down
4 changes: 3 additions & 1 deletion lib/gruf/endpoint.rb → lib/gruf/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module Gruf
##
# Module for gRPC endpoints
#
module Endpoint
module Service
extend ActiveSupport::Concern

included do
Expand Down Expand Up @@ -73,6 +73,8 @@ def self.rpc_handler_names
def self.mount
Gruf.services << self.name.constantize
end

mount
end

##
Expand Down
2 changes: 1 addition & 1 deletion lib/gruf/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
module Gruf
VERSION = '0.9.2'.freeze
VERSION = '0.10.0'.freeze
end
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
require 'spec_helper'

describe Gruf::Endpoint do
describe Gruf::Service do
let(:endpoint) { ThingService.new }
let(:id) { 1 }
let(:req) { ::Rpc::GetThingRequest.new(id: id) }
Expand Down
3 changes: 1 addition & 2 deletions spec/support/grpc_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ class Service
end

class ThingService < Rpc::ThingService::Service
include Gruf::Endpoint
mount
include Gruf::Service

def get_thing(req, _call)
::Rpc::GetThingResponse.new(id: req.id)
Expand Down

0 comments on commit 2b20bb4

Please sign in to comment.