housecanary-ruby 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rubocop.yml +21 -0
- data/.gitignore +2 -0
- data/.irbrc +2 -0
- data/.rubocop.yml +5 -9
- data/Gemfile +4 -0
- data/Rakefile +3 -1
- data/bin/console +4 -3
- data/gemfiles/rubocop.gemfile +5 -0
- data/housecanary-ruby.gemspec +14 -12
- data/lib/housecanary/api/repository.rb +2 -2
- data/lib/housecanary/api/sale.rb +2 -2
- data/lib/housecanary/connection.rb +2 -2
- data/lib/housecanary/error.rb +1 -1
- data/lib/housecanary/response_parser.rb +1 -1
- data/lib/housecanary/utils.rb +8 -2
- data/lib/housecanary/version.rb +1 -1
- data/lib/housecanary.rb +2 -2
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbef5afbec2dae426a3bef49f0507b2ed90b58b6b61eaced622b77b44435fd44
|
4
|
+
data.tar.gz: e926db8a8327212d7016eef7598b635992898814339f369666d7d192752ef3ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cf54c7e3a01abc7eb35442ecde21749d36e1cbb0c31617645f11c2779ded204516808f64d84e10b9802b5da533a6cf122ec1d39e6a8b7aaed172e7342c9b34c
|
7
|
+
data.tar.gz: 3c582fdfd6ed1d196f9c782f527f8b3d657e0b1ad0bd16bc6d8a6060dbccd58e9988f342227d5867a7f14d46b0f43c95625ad4b58c611ed53182e90ca491479e
|
@@ -0,0 +1,21 @@
|
|
1
|
+
name: RuboCop
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
pull_request:
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
rubocop:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v3
|
14
|
+
- uses: ruby/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: 2.7
|
17
|
+
- name: Lint Ruby code with RuboCop
|
18
|
+
run: |
|
19
|
+
gem install bundler
|
20
|
+
bundle install --gemfile gemfiles/rubocop.gemfile --jobs 4 --retry 3
|
21
|
+
bundle exec --gemfile gemfiles/rubocop.gemfile rubocop
|
data/.irbrc
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,10 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
SupportedStyles:
|
4
|
-
- outdent
|
5
|
-
- indent
|
1
|
+
inherit_gem:
|
2
|
+
jetrockets-standard: config/gems.yml
|
6
3
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
Max: 120
|
4
|
+
AllCops:
|
5
|
+
TargetRubyVersion: 2.7
|
6
|
+
NewCops: enable
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'housecanary'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +11,5 @@ require "housecanary"
|
|
10
11
|
# require "pry"
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start
|
data/housecanary-ruby.gemspec
CHANGED
@@ -1,23 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
lib = File.expand_path('lib', __dir__)
|
2
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
5
|
require 'housecanary/version'
|
4
6
|
|
5
7
|
Gem::Specification.new do |spec|
|
6
|
-
spec.name
|
7
|
-
spec.version
|
8
|
-
spec.authors
|
9
|
-
spec.email
|
8
|
+
spec.name = 'housecanary-ruby'
|
9
|
+
spec.version = Housecanary::VERSION
|
10
|
+
spec.authors = ['Ilia Kriachkov']
|
11
|
+
spec.email = ['ilia.kriachkov@jetrockets.ru']
|
10
12
|
|
11
|
-
spec.summary
|
12
|
-
spec.description
|
13
|
-
spec.homepage
|
14
|
-
spec.license
|
13
|
+
spec.summary = 'Ruby wrapper for the HouseCanary Data & Analytics API.'
|
14
|
+
spec.description = 'Ruby wrapper for the HouseCanary Data & Analytics API. https://www.housecanary.com/real-estate-data-api'
|
15
|
+
spec.homepage = 'https://github.com/jetrockets/housecanary-ruby'
|
16
|
+
spec.license = 'MIT'
|
15
17
|
|
16
|
-
spec.bindir
|
17
|
-
spec.executables
|
18
|
-
spec.files
|
18
|
+
spec.bindir = 'bin'
|
19
|
+
spec.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
20
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
21
|
spec.require_paths = ['lib']
|
20
|
-
spec.required_ruby_version = '>= 2.
|
22
|
+
spec.required_ruby_version = '>= 2.7'
|
21
23
|
|
22
24
|
# a b c d e f g h i j k l m n o p q r s t u v w x y z
|
23
25
|
spec.add_dependency 'dry-auto_inject'
|
@@ -12,8 +12,8 @@ module Housecanary
|
|
12
12
|
SALES_HISTORY_PATH = 'property/sales_history'
|
13
13
|
|
14
14
|
def sales_history(params = {})
|
15
|
-
if response = perform_response(:get, SALES_HISTORY_PATH, params)
|
16
|
-
SalesHistory.new(response&.first&.fetch(
|
15
|
+
if (response = perform_response(:get, SALES_HISTORY_PATH, params))
|
16
|
+
SalesHistory.new(response&.first&.fetch(:'property/sales_history', nil))
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
data/lib/housecanary/api/sale.rb
CHANGED
@@ -4,7 +4,7 @@ require 'dry-initializer'
|
|
4
4
|
require 'http'
|
5
5
|
|
6
6
|
module Housecanary
|
7
|
-
class Connection
|
7
|
+
class Connection # :nodoc:
|
8
8
|
extend Dry::Initializer
|
9
9
|
BASE_URL = 'https://api.housecanary.com/v2/'
|
10
10
|
|
@@ -19,7 +19,7 @@ module Housecanary
|
|
19
19
|
ctx = OpenSSL::SSL::SSLContext.new
|
20
20
|
ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
21
21
|
|
22
|
-
HTTP.basic_auth(user: api_key, pass: api_secret).get(url(path), {
|
22
|
+
HTTP.basic_auth(user: api_key, pass: api_secret).get(url(path), {ssl_context: ctx}.merge(params))
|
23
23
|
end
|
24
24
|
|
25
25
|
private
|
data/lib/housecanary/error.rb
CHANGED
data/lib/housecanary/utils.rb
CHANGED
@@ -1,9 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Housecanary
|
4
|
-
module Utils
|
4
|
+
module Utils # :nodoc:
|
5
5
|
def deep_symbolize_keys(hash)
|
6
|
-
deep_transform_keys(hash) { |key|
|
6
|
+
deep_transform_keys(hash) { |key|
|
7
|
+
begin
|
8
|
+
key.to_sym
|
9
|
+
rescue
|
10
|
+
key
|
11
|
+
end
|
12
|
+
}
|
7
13
|
end
|
8
14
|
module_function :deep_symbolize_keys
|
9
15
|
|
data/lib/housecanary/version.rb
CHANGED
data/lib/housecanary.rb
CHANGED
@@ -8,7 +8,7 @@ require 'housecanary/version'
|
|
8
8
|
require 'housecanary/connection'
|
9
9
|
require 'housecanary/response_parser'
|
10
10
|
|
11
|
-
module Housecanary
|
11
|
+
module Housecanary # :nodoc:
|
12
12
|
@container = ::Dry::Container.new
|
13
13
|
AutoInject = ::Dry::AutoInject(@container)
|
14
14
|
|
@@ -33,7 +33,7 @@ module Housecanary #:nodoc:
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def register!
|
36
|
-
connection = ::Housecanary::Connection.new(configuration.to_h)
|
36
|
+
connection = ::Housecanary::Connection.new(**configuration.to_h)
|
37
37
|
parser_class = ::Housecanary::ResponseParser
|
38
38
|
container.register :connection, -> { connection }
|
39
39
|
container.register :response_parser, -> { parser_class }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: housecanary-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilia Kriachkov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-auto_inject
|
@@ -173,6 +173,7 @@ executables:
|
|
173
173
|
extensions: []
|
174
174
|
extra_rdoc_files: []
|
175
175
|
files:
|
176
|
+
- ".github/workflows/rubocop.yml"
|
176
177
|
- ".gitignore"
|
177
178
|
- ".irbrc"
|
178
179
|
- ".rspec"
|
@@ -185,6 +186,7 @@ files:
|
|
185
186
|
- Rakefile
|
186
187
|
- bin/console
|
187
188
|
- bin/setup
|
189
|
+
- gemfiles/rubocop.gemfile
|
188
190
|
- housecanary-ruby.gemspec
|
189
191
|
- lib/housecanary.rb
|
190
192
|
- lib/housecanary/api/helpers.rb
|
@@ -208,7 +210,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
208
210
|
requirements:
|
209
211
|
- - ">="
|
210
212
|
- !ruby/object:Gem::Version
|
211
|
-
version: '2.
|
213
|
+
version: '2.7'
|
212
214
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
213
215
|
requirements:
|
214
216
|
- - ">="
|