Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9e8aa22
chore: update ruby version
jonrandahl Jul 21, 2025
dd75b50
feat: update dependencies and ruby version
jonrandahl Jul 21, 2025
87129fc
chore: update target ruby version
jonrandahl Jul 21, 2025
d5f6605
refactor: simplify gem dependencies
jonrandahl Jul 28, 2025
380dcdd
chore: update gitignore for rails and ruby
jonrandahl Jul 28, 2025
e9ace0c
chore: add initial Gemfile.lock for dependencies
jonrandahl Jul 28, 2025
6c0df63
refactor: update HTTP client config
jonrandahl Jul 28, 2025
3bb5cbd
chore: update minitest dependencies
jonrandahl Jul 28, 2025
02a3bb3
chore: update rake dependency
jonrandahl Jul 28, 2025
6cfe06e
chore: update simplecov version
jonrandahl Jul 28, 2025
9c7457a
chore: update webmock to latest version
jonrandahl Jul 28, 2025
c984dbd
chore: update excon gem to version 1.2.8
jonrandahl Jul 28, 2025
a10cd56
chore: update mocha and add ruby2_keywords
jonrandahl Jul 28, 2025
0489f7f
chore: update Faraday dependencies
jonrandahl Jul 28, 2025
f6d265f
refactor: improve variable naming
jonrandahl Jul 28, 2025
01f307a
fix: improve URL construction logic
jonrandahl Jul 28, 2025
7e1ad3d
refactor: refine logger integration
jonrandahl Jul 28, 2025
14f5732
fix: improve json error handling
jonrandahl Jul 28, 2025
d8411cd
refactor: adjust logger configuration order
jonrandahl Jul 28, 2025
c025d99
refactor: enhance JSON parsing flexibility
jonrandahl Jul 28, 2025
ffa5916
fix: handle timeout errors in connection
jonrandahl Jul 28, 2025
cdfda5f
fix: clarify API return message
jonrandahl Jul 28, 2025
8872463
test: enhance dataset query validation
jonrandahl Jul 28, 2025
000c7de
fix: correct log message check and duration validation
jonrandahl Jul 28, 2025
1a142fc
fix: handle resource not found errors
jonrandahl Jul 28, 2025
e58f881
fix: update VCR recordings and add new API exception handling
jonrandahl Jul 28, 2025
9de1ea5
chore: update byebug gem configuration
jonrandahl Jul 28, 2025
068b25f
chore: increment minor version
jonrandahl Jul 28, 2025
9a46994
chore: update changelog for version 1.6.0
jonrandahl Jul 28, 2025
9d7b6e0
chore: update rubocop config pattern
jonrandahl Jul 28, 2025
4c7b803
chore: remove obsolete test files setting
jonrandahl Jul 28, 2025
a978dbc
refactor: improve code clarity and maintainability
jonrandahl Jul 28, 2025
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
85 changes: 69 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,71 @@
*.gem
# Created by https://www.toptal.com/developers/gitignore/api/rails,ruby
# Edit at https://www.toptal.com/developers/gitignore?templates=rails,ruby

### Rails ###
*.rbc
.bundle
.config
.yardoc
Gemfile.lock
InstalledFiles
_yardoc
coverage
doc/
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
capybara-*.html
.rspec
/db/*.sqlite3
/db/*.sqlite3-journal
/db/*.sqlite3-[0-9]*
/public/system
/coverage/
/spec/tmp
*.orig
rerun.txt
pickle-email-*.html

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# dotenv, dotenv-rails
.env
.env*.local

## Environment normalization:
/.bundle
/vendor/bundle

# Ignore Byebug command history file.
.byebug_history

# Ignore node_modules
node_modules/

# Ignore precompiled javascript packs
/public/packs
/public/packs-test
/public/assets

# Ignore yarn files
/yarn-error.log
yarn-debug.log*
.yarn-integrity

# Ignore uploaded files in development
/storage/*
!/storage/.keep
/public/uploads

### Ruby ###
*.gem
/.config
/InstalledFiles
/pkg/
/spec/reports/
/spec/examples.txt
/test/tmp/
/test/version_tmp/
/tmp/

## Documentation cache and generated files:
/doc/
/rdoc/

/.bundle/
/lib/bundler/man/

# End of https://www.toptal.com/developers/gitignore/api/rails,ruby
4 changes: 2 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
AllCops:
TargetRubyVersion: 2.6
TargetRubyVersion: 3.4
Exclude:
- config/unicorn.rb
- db/**
NewCops: enable

Layout/LineLength:
Max: 100
IgnoredPatterns: ['^(\s*#)']
AllowedPatterns: ['^(\s*#)']
Exclude:
- test/**/*

Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.8
3.4.4
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog for DS API rubygem

## 1.6.0 - 2025-07

- Update TargetRubyVersion to 3.4 for compatibility
- Refresh dependencies for better stability
- Refactor logging and error handling for clarity
- Enhance JSON parsing reliability
- Revise VCR setups with new HTTP client
- Expand .gitignore to cover more files
- Include Gemfile.lock for consistent dependencies

## 1.5.4 - 2025-04

- (Jon) Adds returned row count to logs when the count is a positive integer.
Expand Down
27 changes: 15 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in data-api.gemspec
gemspec

gem 'byebug', group: %i[development test], require: false

# Add development dependencies here though as they are not required to run the gem
group :development, :test do
gem 'bundler', '~> 2.4'
gem 'byebug', '~> 11.1.3'
gem 'excon', '~> 0.90.0'
gem 'json_expressions', '~> 0.9.0'
gem 'minitest', '~> 5.15.0'
gem 'minitest-rg', '~> 5.2.0'
gem 'minitest-vcr', '~> 1.4.0'
gem 'mocha', '~> 1.13.0'
gem 'rake', '~> 13.0.6'
gem 'rubocop', '~> 1.25.0'
gem 'simplecov', '~> 0.21.2', require: false
gem 'webmock', '~> 3.14.0'
gem 'bundler'
gem 'excon'
gem 'json_expressions'
gem 'minitest'
gem 'minitest-rg'
gem 'minitest-vcr'
gem 'mocha'
gem 'mutex_m'
gem 'ostruct'
gem 'rake'
gem 'rubocop'
gem 'simplecov', require: false
gem 'webmock'
end
129 changes: 129 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
PATH
remote: .
specs:
data_services_api (1.6.0)
faraday (~> 2.13)
faraday-encoding (~> 0.0.6)
faraday-follow_redirects (~> 0.3.0)
faraday-retry (~> 2.0)
json (~> 2.0)
yajl-ruby (~> 1.4)

GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.3)
base64 (0.3.0)
bigdecimal (3.2.2)
byebug (12.0.0)
crack (1.0.0)
bigdecimal
rexml
docile (1.4.1)
excon (1.2.8)
logger
faraday (2.13.4)
faraday-net_http (>= 2.0, < 3.5)
json
logger
faraday-encoding (0.0.6)
faraday
faraday-follow_redirects (0.3.0)
faraday (>= 1, < 3)
faraday-net_http (3.4.1)
net-http (>= 0.5.0)
faraday-retry (2.3.2)
faraday (~> 2.0)
hashdiff (1.2.0)
json (2.13.2)
json_expressions (0.9.0)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
logger (1.7.0)
minispec-metadata (2.0.0)
minitest
minitest (5.25.5)
minitest-rg (5.3.0)
minitest (~> 5.0)
minitest-vcr (1.4.0)
minispec-metadata (~> 2.0)
minitest (>= 4.7.5)
vcr (>= 2.9)
mocha (2.7.1)
ruby2_keywords (>= 0.0.5)
mutex_m (0.3.0)
net-http (0.6.0)
uri
ostruct (0.6.3)
parallel (1.27.0)
parser (3.3.9.0)
ast (~> 2.4.1)
racc
prism (1.4.0)
public_suffix (6.0.2)
racc (1.8.1)
rainbow (3.1.1)
rake (13.3.0)
regexp_parser (2.10.0)
rexml (3.4.1)
rubocop (1.79.0)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.46.0, < 2.0)
ruby-progressbar (~> 1.7)
tsort (>= 0.2.0)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.46.0)
parser (>= 3.3.7.2)
prism (~> 1.4)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.13.2)
simplecov_json_formatter (0.1.4)
tsort (0.2.0)
unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uri (1.0.3)
vcr (6.3.1)
base64
webmock (3.25.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
yajl-ruby (1.4.3)

PLATFORMS
ruby
x86_64-darwin-24

DEPENDENCIES
bundler
byebug
data_services_api!
excon
json_expressions
minitest
minitest-rg
minitest-vcr
mocha
mutex_m
ostruct
rake
rubocop
simplecov
webmock

BUNDLED WITH
2.7.0
12 changes: 7 additions & 5 deletions data_services_api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@ Gem::Specification.new do |spec|
spec.description = 'Ruby wrapper for Epimorphics Data Services API'
spec.homepage = 'https://github.com/epimorphics/data-API-ruby'
spec.license = 'MIT'
spec.required_ruby_version = '>= 2.6'
spec.required_ruby_version = '>= 3.4'

spec.files = `git ls-files -z`.split("\x0")
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']

spec.metadata['rubygems_mfa_required'] = 'true'

spec.add_dependency 'faraday_middleware', '~> 1.2.0'
spec.add_dependency 'json', '~> 2.6.1'
spec.add_dependency 'yajl-ruby', '~> 1.4.1'
spec.add_dependency 'faraday', '~> 2.13'
spec.add_dependency 'faraday-encoding', '~> 0.0.6'
spec.add_dependency 'faraday-follow_redirects', '~> 0.3.0'
spec.add_dependency 'faraday-retry', '~> 2.0'
spec.add_dependency 'json', '~> 2.0'
spec.add_dependency 'yajl-ruby', '~> 1.4'
end
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,56 @@ http_interactions:
encoding: UTF-8
string: '{"meta":{"@id":"http://localhost//landregistry/id/ukhpi?_limit=1&_sort=-refMonth&mineq-refMonth=2019-01&refRegion=http%3A%2F%2Flandregistry.data.gov.uk%2Fid%2Fregion%2Funited-kingdom","publisher":"","license":"","licenseName":"","comment":"","version":"0.1","hasFormat":["http://localhost//landregistry/id/ukhpi.rdf?_limit=1&_sort=-refMonth&mineq-refMonth=2019-01&refRegion=http%3A%2F%2Flandregistry.data.gov.uk%2Fid%2Fregion%2Funited-kingdom","http://localhost//landregistry/id/ukhpi.html?_limit=1&_sort=-refMonth&mineq-refMonth=2019-01&refRegion=http%3A%2F%2Flandregistry.data.gov.uk%2Fid%2Fregion%2Funited-kingdom","http://localhost//landregistry/id/ukhpi.geojson?_limit=1&_sort=-refMonth&mineq-refMonth=2019-01&refRegion=http%3A%2F%2Flandregistry.data.gov.uk%2Fid%2Fregion%2Funited-kingdom","http://localhost//landregistry/id/ukhpi.csv?_limit=1&_sort=-refMonth&mineq-refMonth=2019-01&refRegion=http%3A%2F%2Flandregistry.data.gov.uk%2Fid%2Fregion%2Funited-kingdom","http://localhost//landregistry/id/ukhpi.ttl?_limit=1&_sort=-refMonth&mineq-refMonth=2019-01&refRegion=http%3A%2F%2Flandregistry.data.gov.uk%2Fid%2Fregion%2Funited-kingdom","http://localhost//landregistry/id/ukhpi.json?_limit=1&_sort=-refMonth&mineq-refMonth=2019-01&refRegion=http%3A%2F%2Flandregistry.data.gov.uk%2Fid%2Fregion%2Funited-kingdom"],"limit":1},"items":[{"@id":"http://landregistry.data.gov.uk/data/ukhpi/region/united-kingdom/month/2021-10","refRegion":{"@id":"http://landregistry.data.gov.uk/id/region/united-kingdom"},"refMonth":"2021-10","averagePrice":268349,"averagePriceSA":264786,"housePriceIndex":140.74,"housePriceIndexSA":138.87,"percentageAnnualChange":10.17,"percentageChange":-1.11,"averagePriceDetached":425121,"housePriceIndexDetached":147.75,"percentageChangeDetached":0.75,"percentageAnnualChangeDetached":13.99,"averagePriceSemiDetached":256537,"housePriceIndexSemiDetached":143.49,"percentageChangeSemiDetached":-1.64,"percentageAnnualChangeSemiDetached":10.39,"averagePriceTerraced":216481,"housePriceIndexTerraced":140.62,"percentageChangeTerraced":-2.88,"percentageAnnualChangeTerraced":8.79,"averagePriceFlatMaisonette":222381,"housePriceIndexFlatMaisonette":128.40,"percentageChangeFlatMaisonette":-0.17,"percentageAnnualChangeFlatMaisonette":6.63,"refPeriodStart":"2021-10-01","refPeriodDuration":1}]}'
recorded_at: Tue, 25 Jan 2022 17:56:23 GMT
recorded_with: VCR 6.0.0
- request:
method: get
uri: https://hmlr-dev-pres.epimorphics.net/landregistry/id/ukhpi?_limit=1&_sort=-refMonth&mineq-refMonth=2019-01&refRegion=http://landregistry.data.gov.uk/id/region/united-kingdom
body:
encoding: US-ASCII
string: ''
headers:
User-Agent:
- Faraday v2.13.4
Accept:
- application/json
Accept-Encoding:
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
response:
status:
code: 200
message: OK
headers:
Cache-Control:
- no-cache
Content-Type:
- text/html; charset=utf-8
Date:
- Mon, 28 Jul 2025 11:54:20 GMT
Referrer-Policy:
- strict-origin-when-cross-origin
Server:
- nginx/1.27.5
X-Cache-Status:
- MISS
X-Content-Type-Options:
- nosniff
X-Download-Options:
- noopen
X-Frame-Options:
- SAMEORIGIN
X-Permitted-Cross-Domain-Policies:
- none
X-Request-Id:
- 59aa874f2328dbf87c3c7ddb6bd79140
X-Runtime:
- '0.003676'
X-Xss-Protection:
- 1; mode=block
Content-Length:
- '0'
Connection:
- keep-alive
body:
encoding: UTF-8
string: ''
recorded_at: Mon, 28 Jul 2025 11:54:20 GMT
recorded_with: VCR 6.3.1
Loading