Skip to content

Commit

Permalink
0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gkostin1966 committed Apr 14, 2022
1 parent 0907a44 commit 483cf71
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 32 deletions.
43 changes: 21 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PATH
remote: .
specs:
handle_rest (0.0.1)
faraday
faraday-retry
handle_rest (0.0.2)
faraday (~> 0.9)
faraday_middleware (~> 0.14.0)

GEM
remote: https://rubygems.org/
Expand All @@ -13,22 +13,21 @@ GEM
diff-lcs (1.5.0)
docile (1.4.0)
dotenv (2.7.6)
faraday (2.2.0)
faraday-net_http (~> 2.0)
ruby2_keywords (>= 0.0.4)
faraday-net_http (2.0.1)
faraday-retry (1.0.3)
json (2.6.1)
faraday (0.17.5)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.14.0)
faraday (>= 0.7.4, < 1.0)
method_source (1.0.0)
parallel (1.21.0)
parser (3.1.1.0)
multipart-post (2.1.1)
parallel (1.22.1)
parser (3.1.2.0)
ast (~> 2.4.1)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.2.1)
regexp_parser (2.3.0)
rexml (3.2.5)
rspec (3.11.0)
rspec-core (~> 3.11.0)
Expand All @@ -39,11 +38,11 @@ GEM
rspec-expectations (3.11.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.0)
rspec-mocks (3.11.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
rubocop (1.26.0)
rubocop (1.27.0)
parallel (~> 1.10)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
Expand All @@ -52,7 +51,7 @@ GEM
rubocop-ast (>= 1.16.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.16.0)
rubocop-ast (1.17.0)
parser (>= 3.1.1.0)
rubocop-performance (1.13.3)
rubocop (>= 1.7.0, < 2.0)
Expand All @@ -62,14 +61,14 @@ GEM
rubocop-rspec (2.9.0)
rubocop (~> 1.19)
ruby-progressbar (1.11.0)
ruby2_keywords (0.0.5)
simplecov (0.16.1)
simplecov (0.21.2)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
standard (1.8.0)
rubocop (= 1.26.0)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
standard (1.10.0)
rubocop (= 1.27.0)
rubocop-performance (= 1.13.3)
unicode-display_width (2.1.0)
webrick (1.7.0)
Expand Down
16 changes: 12 additions & 4 deletions handle_rest.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "handle_rest"
s.version = "0.0.1"
s.version = "0.0.2"
s.summary = "Ruby interface to CNRI Handle REST API"

s.description = %( Ruby interface to the CNRI Handle REST API.
Expand All @@ -14,9 +14,17 @@ Gem::Specification.new do |s|
s.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
s.homepage = "https://github.com/mlibrary/handle_rest"
s.license = "APACHE2"
s.add_dependency "faraday"
s.add_dependency "faraday-retry"
s.required_ruby_version = ">= 2.1"
# Bundler could not find compatible versions for gem "faraday":
# In Gemfile:
# faraday (~> 2)
#
# hyrax (= 2.9.5) was resolved to 2.9.5, which depends on
# signet was resolved to 0.12.0, which depends on
# faraday (~> 0.9)
s.add_dependency "faraday", "~> 0.9"
# NOTE: This is the last minor release in the v0.x series, next release will be 1.0 to match Faraday v1.0 release and from then on only fixes will be applied to v0.14.x!
s.add_dependency "faraday_middleware", "~> 0.14.0"
s.required_ruby_version = ">= 2.6"

s.add_development_dependency "bundler"
s.add_development_dependency "rake"
Expand Down
4 changes: 2 additions & 2 deletions lib/handle_rest/handle_service.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "faraday"
require "faraday/retry"
require "faraday_middleware"

module HandleRest
# Handle Service
Expand All @@ -21,7 +21,7 @@ class HandleService
def initialize(url:, user:, password:, ssl_verify: true)
@conn = Faraday.new(url: url,
ssl: {verify: ssl_verify}) do |faraday|
faraday.request :authorization, :basic, CGI.escape(user), password
faraday.request :basic_auth, CGI.escape(user), password
faraday.request :json # encode req bodies as JSON and automatically set the Content-Type header
faraday.request :retry # retry transient failures
faraday.response :json # decode response bodies as JSON
Expand Down
8 changes: 4 additions & 4 deletions lib/handle_rest/value_line.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ def value=(v)
def permissions=(ps)
if ps.nil?
ps = case @value.type
when "HS_PUBKEY", "HS_SECKEY"
PermissionSet.from_s("1100")
else
PermissionSet.from_s("1110")
when "HS_PUBKEY", "HS_SECKEY"
PermissionSet.from_s("1100")
else
PermissionSet.from_s("1110")
end
end
raise "permission set must be a kind of HandleRest::PermissionSet" unless ps.is_a?(HandleRest::PermissionSet)
Expand Down

0 comments on commit 483cf71

Please sign in to comment.