lagomorph 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 21c342f41f629631c3025cad9a585c6acbbf46b2
4
- data.tar.gz: 3db6f47942bedfdcab9db6344a16946d4d05ac2e
3
+ metadata.gz: efb0c9a699dbf5706bbc949351fa2a83dc5839c3
4
+ data.tar.gz: 658000870814c1e7dacbb99ef46384cd14ec9c00
5
5
  SHA512:
6
- metadata.gz: b84257d612a0decb888fc6f8e023c3557b9548410531471740a5ead10cef265c32c7c1002451921e9123dc48f23d52442021ae72747cca465e1a36fec9bf76d9
7
- data.tar.gz: 1fb54e86c8748858c2e51e7b3fd97f50b65611c2dce7c326a406aaf428cef643c193634bbc455871aebae15dd6c520ab8ea767885b56a2f9e4ff5b39049b2095
6
+ metadata.gz: b1dd615c1ad6946efadb54609c95ba9f7d15eb0db86e2c503acbaecee7f754d4e14bc8626d4a2ab285be6ee24698b2a430438bec6c1def75998a8f889f302986
7
+ data.tar.gz: c989d1041e28afff05bf0042e5e0f3890a670d43a5c1f9ea68a6a01e7a6ecc718d7a581cf40f9a0e86a11759eded68d6067063e746e1ee1f156556277828d32e
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- jruby-1.7.16
1
+ jruby-1.7.16.1
data/.travis.yml CHANGED
@@ -1,3 +1,12 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
+ - 2.1
5
+ - jruby-1.7.16
6
+ script: "cp spec/rabbitmq.yml.example spec/rabbitmq.yml && bundle exec rake coverage"
7
+ services:
8
+ - rabbitmq
9
+ notifications:
10
+ email:
11
+ - support@travellink.com.au
12
+ flowdock: e69dcafad1fea15c6b8c76e9ced965af
data/README.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Lagomorph
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/geokit.png)](http://badge.fury.io/rb/lagomorph)
4
+ [![Build Status](https://travis-ci.org/sealink/lagomorph.png?branch=master)](https://travis-ci.org/sealink/lagomorph)
5
+ [![Coverage Status](https://coveralls.io/repos/sealink/lagomorph/badge.png)](https://coveralls.io/r/sealink/lagomorph)
6
+ [![Dependency Status](https://gemnasium.com/sealink/lagomorph.png)](https://gemnasium.com/sealink/lagomorph)
7
+ [![Code Climate](https://codeclimate.com/github/sealink/lagomorph.png)](https://codeclimate.com/github/sealink/lagomorph)
8
+
3
9
  RPC Messaging pattern using RabbitMQ
4
10
 
5
11
  Lagomorph is a mammal of the order Lagomorpha, which comprises the hares, rabbits, and pikas.
@@ -77,7 +83,7 @@ Now to utilise this amazing service, we would use the rpc call client:
77
83
 
78
84
  ## Contributing
79
85
 
80
- 1. Fork it ( https://bitbucket.org/team-sealink/lagomorph/fork )
86
+ 1. Fork it ( https://github.com/sealink/lagomorph/fork )
81
87
  2. Create your feature branch (`git checkout -b my-new-feature`)
82
88
  3. Commit your changes (`git commit -am 'Add some feature'`)
83
89
  4. Push to the branch (`git push origin my-new-feature`)
data/Rakefile CHANGED
@@ -5,3 +5,8 @@ RSpec::Core::RakeTask.new(:spec)
5
5
 
6
6
  task :default => :spec
7
7
 
8
+ desc "Generate SimpleCov test coverage and open in your browser"
9
+ task :coverage do
10
+ ENV['COVERAGE'] = 'true'
11
+ Rake::Task['spec'].invoke
12
+ end
data/lagomorph.gemspec CHANGED
@@ -41,7 +41,10 @@ Gem::Specification.new do |spec|
41
41
  else # mri
42
42
  spec.add_development_dependency 'bunny'
43
43
  end
44
- spec.add_development_dependency "rake", "~> 10.0"
45
- spec.add_development_dependency "rspec"
44
+ spec.add_development_dependency 'rake', '~> 10.0'
45
+ spec.add_development_dependency 'rspec'
46
+ spec.add_development_dependency 'simplecov'
47
+ spec.add_development_dependency 'simplecov-rcov'
48
+ spec.add_development_dependency 'coveralls'
46
49
 
47
50
  end
data/lib/lagomorph.rb CHANGED
@@ -29,4 +29,5 @@ end
29
29
  require 'lagomorph/session'
30
30
  require 'lagomorph/subscriber'
31
31
  require 'lagomorph/supervisor'
32
+ require 'lagomorph/worker'
32
33
  require 'lagomorph/rpc_call'
@@ -21,7 +21,7 @@ module Lagomorph
21
21
 
22
22
  def process_request(request)
23
23
  method, params = parse_request(request)
24
- @worker_class.new.send(method, *params)
24
+ @worker_class.new(method, *params).work
25
25
  end
26
26
 
27
27
  def publish_response(channel, metadata, payload)
@@ -1,3 +1,3 @@
1
1
  module Lagomorph
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -0,0 +1,12 @@
1
+ module Lagomorph
2
+ class Worker
3
+ def initialize(method, *params)
4
+ @method = method
5
+ @params = params
6
+ end
7
+
8
+ def work
9
+ send(@method, *@params)
10
+ end
11
+ end
12
+ end
@@ -13,7 +13,7 @@ describe 'a Lagomorph RPC process' do
13
13
  )
14
14
  }
15
15
 
16
- class PongWorker
16
+ class PongWorker < Lagomorph::Worker
17
17
  def pong
18
18
  'pong'
19
19
  end
data/spec/spec_helper.rb CHANGED
@@ -1,2 +1,30 @@
1
1
  $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+
3
+ MINIMUM_COVERAGE = 93
4
+
5
+ if ENV['COVERAGE']
6
+ require 'simplecov'
7
+ require 'simplecov-rcov'
8
+ require 'coveralls'
9
+ Coveralls.wear!
10
+
11
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
12
+ SimpleCov::Formatter::RcovFormatter,
13
+ Coveralls::SimpleCov::Formatter
14
+ ]
15
+ SimpleCov.start do
16
+ add_filter '/vendor/'
17
+ add_filter '/spec/'
18
+ add_group 'lib', 'lib'
19
+ end
20
+ SimpleCov.at_exit do
21
+ SimpleCov.result.format!
22
+ percent = SimpleCov.result.covered_percent
23
+ unless percent >= MINIMUM_COVERAGE
24
+ puts "Coverage must be above #{MINIMUM_COVERAGE}%. It is #{"%.2f" % percent}%"
25
+ Kernel.exit(1)
26
+ end
27
+ end
28
+ end
29
+
2
30
  require 'lagomorph'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lagomorph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Berardi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-07 00:00:00.000000000 Z
12
+ date: 2014-11-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  requirement: !ruby/object:Gem::Requirement
@@ -81,6 +81,48 @@ dependencies:
81
81
  - - '>='
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ name: simplecov
91
+ prerelease: false
92
+ type: :development
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ name: simplecov-rcov
105
+ prerelease: false
106
+ type: :development
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ - !ruby/object:Gem::Dependency
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ name: coveralls
119
+ prerelease: false
120
+ type: :development
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
84
126
  description: "\n Lagomorph is a mammal of the order Lagomorpha, which comprises\
85
127
  \ the hares, rabbits, and pikas.\n\n It's also a gem that implements the RPC\
86
128
  \ pattern over AMPQ using RabbitMQ.\n In this case, it can work with either MRI\
@@ -111,6 +153,7 @@ files:
111
153
  - lib/lagomorph/subscriber.rb
112
154
  - lib/lagomorph/supervisor.rb
113
155
  - lib/lagomorph/version.rb
156
+ - lib/lagomorph/worker.rb
114
157
  - spec/lagomorph_spec.rb
115
158
  - spec/rabbitmq.yml.example
116
159
  - spec/spec_helper.rb