ea-address_lookup 0.3.0 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b57bfc1eb09fcdd170481081f7c7c69cf9888564
4
- data.tar.gz: e9805598175f36cc5d3454791932167ac6168579
3
+ metadata.gz: 1b1345ea8c9c8d77175aebd9718ce3192468ba06
4
+ data.tar.gz: a4533becc341a750aeea6bbe8bfc26a6f182e4b3
5
5
  SHA512:
6
- metadata.gz: 51a51be32e5af468c845fd839943324150ad69987d2d3d7a5f93f27d5ac89aa433f01afe7fd739c3536e550366e152f38059289fa2e018ea288974e599f1299c
7
- data.tar.gz: ae2d01648bca7f2467b83a15634605741ba3b1febcfb33be823f6025059f6d765dd6d4bffa67f4325e4f601c0f6af8927db8266109dbf5e6e7db3b89f57a7bb8
6
+ metadata.gz: 7835a2ebc748e58158d0356aef2e4b5d97a585daa9cbc32c64334b8b9ccf0f036f446feb4a2c2c03258c6b425e6c7ac61d27df978ceee259ac2243d0a0163c78
7
+ data.tar.gz: a6a73fb95f5d28ca276ec27ea5c60015a0390b9798e92234d1c623939e5ca97f690d4b2f4c39096def4a2701130e6af88546d6a2a28f1bb64bf3aca834d8a860
data/.travis.yml CHANGED
@@ -1,47 +1,29 @@
1
1
  language: ruby
2
2
  cache: bundler
3
-
4
3
  rvm:
5
4
  - 2.3.1
6
-
7
5
  before_install:
8
6
  - gem install bundler -v 1.11.2
9
-
10
- bundler_args: --binstubs=./bundler_stubs
11
-
7
+ bundler_args: "--binstubs=./bundler_stubs"
12
8
  before_script:
13
-
14
9
  script:
15
10
  - bundle exec rake --trace before_commit:run_without_checks
16
- - git config --global user.email test@example.com # overcommit Author
17
- - git config --global user.name "Test Example" # overcommit Author
11
+ - git config --global user.email test@example.com
12
+ - git config --global user.name "Test Example"
18
13
  - BUNDLE_GEMFILE=.overcommit_gems.rb bundle exec overcommit --run
19
14
  - bundle exec rspec
20
-
21
- # Have this option to stop travis-ci building twice. Currently we have travis set to build both
22
- # PR's and pushes. However this means when we push to a PR we have to wait for Travis to finish
23
- # 2 builds. If we unticked 'pushes' when the PR was finally merged that would not be built. The
24
- # brute force approach would be to untick build PR's and just build all pushes. We instead have
25
- # gone with the approach outlined here http://stackoverflow.com/a/31882307
26
15
  branches:
27
16
  only:
28
17
  - master
29
-
30
- # This section was added as per https://docs.travis-ci.com/user/code-climate/
31
- # To protect our codeclimate stats rather than adding the Codeclimate API key for ea-area_lookup
32
- # in the open we used this guide https://docs.travis-ci.com/user/encryption-keys/ to encryt the
33
- # value. Essentially install travis gem, then run `travis encrypt <my_code_climate_api_key>`
34
18
  addons:
35
19
  code_climate:
36
20
  repo_token:
37
- secure: "NHoT4H5wYUhdGoByjcnViaLzHFkxKgSgZPCNtWtaCdrWXUwX8VLYYl6NPqvANMII0z81Fq8P0+Nzo0o0YfWAvXsimsuhXd4hdzMSKW+xp6G5KRmCaU8FfIjqGhf0yYs3jmTD6Bz2rv1uhZ080k39OXBE/pGR3pkd229lVxrVR91zYYnERqNGD7p78NDGCTPlyoYYNB+wMLq76p6Hl2dSZgwMQtDS/Qi95vG+3Zq2y3z+iarlXSxm2xqfYMgUTcoO3w1eL2P/I+y/SqKgqKEpNKTzicFySUUg5NEvQy/GQit6iArkemU3q364fp4RqkUzauDenEsE64Q6MNY/n7Pj+ZVUKvT3mFKr2OAQojrJko2vtM7QuxBKmaRvkA89JRJvXDTREqbB1gY9pmnAbxBQbRW25KRSucKRPIGhK+gfwjM01eINveR86KECyTOLkrVcWFihrXzrIxLzv37UQUh9UVE/+aca0QVivYa6jJOebPKeLxS3sPLco8clv4A1H7HfvAkzg9lzWC6cz/cSOmQWWvAcDsd+riMaq188fCGuPhHcGywzwH4qt/75b8vnOoOSZSxqNAvQfsf0np0V+N2ahiGqpBhTgPKD3B+Mhff2KN0WY0eejzUMdPdi6zNcjJySyvLBZ9Jrmb+Vf/X1DhEqg05n/V2lQCWzoeJw4zSyRyU="
38
-
21
+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/ea-address_lookup
47
- all_branches: true
data/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # Change log
2
+
3
+ ### 0.3.2
4
+
5
+ - Added gem version badge to readme
6
+ - Updated gemspec description
7
+ - Fixed automatic deployment to rubygems on new tag
8
+
9
+ ### 0.3.1
10
+
11
+ - Updated readme regarding RSpec mocks
12
+ - Added extra tests for rspec mocks
13
+ - Fixed issues with specs failing when an ISP returns a custom 404
data/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  [![Build Status](https://travis-ci.org/EnvironmentAgency/ea-address_lookup.svg?branch=master)](https://travis-ci.org/EnvironmentAgency/ea-address_lookup)
4
4
  [![Code Climate](https://codeclimate.com/github/EnvironmentAgency/ea-address_lookup/badges/gpa.svg)](https://codeclimate.com/github/EnvironmentAgency/ea-address_lookup)
5
5
  [![Test Coverage](https://codeclimate.com/github/EnvironmentAgency/ea-address_lookup/badges/coverage.svg)](https://codeclimate.com/github/EnvironmentAgency/ea-address_lookup/coverage)
6
+ [![Gem Version](https://badge.fury.io/rb/ea-address_lookup.svg)](https://badge.fury.io/rb/ea-address_lookup)
6
7
 
7
8
  This ruby gem provides address lookup functionality by postcode.
8
9
 
@@ -11,7 +12,7 @@ This ruby gem provides address lookup functionality by postcode.
11
12
  Add the gem to your Gemfile
12
13
 
13
14
  ```ruby
14
- gem 'ea-address_lookup'
15
+ gem "ea-address_lookup"
15
16
  ```
16
17
 
17
18
  Then execute:
@@ -20,6 +21,12 @@ Then execute:
20
21
  bundle install
21
22
  ```
22
23
 
24
+ You may also need to add this to your ruby code before using this gem:
25
+
26
+ ```ruby
27
+ require "ea/address_lookup"
28
+ ```
29
+
23
30
  ## Usage
24
31
 
25
32
  ### Rails
@@ -46,9 +53,19 @@ hash = EA::AddressLookup.find_by_uprn('12345678')
46
53
 
47
54
  ## Testing with RSpec
48
55
  A test helper is included that provides methods that will stub calls to
49
- EA::AddressLookup methods in RSpec tests. To enable them add this to
50
- the rspec configuration (for example, within a `RSpec.configure do |config|`
51
- block in a Rails app's `spec/rails_helper.rb`):
56
+ EA::AddressLookup methods in RSpec tests.
57
+
58
+ The available mock methods are:
59
+
60
+ ```
61
+ mock_ea_address_lookup_find_by_uprn
62
+ mock_failure_of_ea_address_lookup_find_by_uprn
63
+ mock_ea_address_lookup_find_by_postcode
64
+ mock_failure_of_ea_address_lookup_find_by_postcode
65
+ ```
66
+
67
+ To enable them add this to the rspec configuration (for example, within a
68
+ `RSpec.configure do |config|` block in a Rails app's `spec/rails_helper.rb`):
52
69
 
53
70
  ```ruby
54
71
  config.include EA::AddressLookup::TestHelper::RspecMocks
@@ -65,11 +82,15 @@ describe "postcode lookup" do
65
82
 
66
83
  it "some tests that use data returned by a postcode lookup" do
67
84
  ....
85
+ # Any EA::AddressLookup.find_by_postcode calls made in this spec will return the same
86
+ # mocked data, and no external requests will be made, so you don't need webmock/VCR.
87
+ # You can pass any postcode or uprn argument to the find_by_* methods, but they will
88
+ # always return the mocked data and will not echo back your input.
89
+ # See test_helper/address_lookup.yml to examine the mock data that will be returned.
68
90
  end
69
91
  end
70
92
  ```
71
93
 
72
-
73
94
  ## Contributing to this project
74
95
 
75
96
  If you have an idea you'd like to contribute please log an issue.
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["dst@environment-agency.gov.uk"]
11
11
 
12
12
  spec.summary = "Address lookup by postcode"
13
- spec.description = "Address lookup by postcode. Wraps calls to osplaces an api."
13
+ spec.description = "This gem is a wrapper around services which provide address lookup by postcode."
14
14
  spec.homepage = "https://github.com/EnvironmentAgency"
15
15
  spec.license = "The Open Government Licence (OGL) Version 3"
16
16
 
@@ -1,5 +1,5 @@
1
1
  module EA
2
2
  module AddressLookup
3
- VERSION = "0.3.0".freeze
3
+ VERSION = "0.3.2".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ea-address_lookup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Digital Services Team, EnvironmentAgency
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-26 00:00:00.000000000 Z
11
+ date: 2016-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -178,7 +178,8 @@ dependencies:
178
178
  - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
- description: Address lookup by postcode. Wraps calls to osplaces an api.
181
+ description: This gem is a wrapper around services which provide address lookup by
182
+ postcode.
182
183
  email:
183
184
  - dst@environment-agency.gov.uk
184
185
  executables: []
@@ -191,6 +192,7 @@ files:
191
192
  - ".ruby-version"
192
193
  - ".simplecov"
193
194
  - ".travis.yml"
195
+ - CHANGELOG.md
194
196
  - Gemfile
195
197
  - LICENSE
196
198
  - README.md