almapi 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: cf56d6e48dd4f9410762b2cfbad2031db729f11a6f1a5634df2949361f6ddbe3
4
- data.tar.gz: 7f249cd8b00caef078d19b6565ee9f25a1df9f1138e5b52c8398cfb8a4736dcf
3
+ metadata.gz: 92f368edda78eb8a33c2941d44e7c2e737b309e625c3fa4b56a76a09908356b4
4
+ data.tar.gz: e25f8932a1d6a39ded7d8b93f4fc0a1324d70b399607777cef0374e2fcfe9c00
5
5
  SHA512:
6
- metadata.gz: 67cf4d1030688685fc21897e4810eb5e6c2bb329cd9896a68456e7e53735ed6d5053aaea47df02b0749fe4f505d2b37c256cff2ed0232392ebb117177c66fd70
7
- data.tar.gz: 65bc9606f5c500cc580ddc35c4e6a64c99110cacb208786775295b3786151eb5ee90656db424a51d76533d2ad386154f39039c4686d2b04f75a4526d5d15b814
6
+ metadata.gz: cfb6cd7d7473be8574058a4f2e1409c5cb7a28eafcd4773e14c9ed7d2032497c4699bef03b7a86f903ca8a60c069974068a129325894570eeafa77104dd6f77c
7
+ data.tar.gz: 5101af4dc5f61e6e03c53bfd560f6d9fd1feb68d980b446a6bc96f857d4d2847ce326ad5b0d5510c0a3e1c97828f5e7a8215619a7fb8478f1dfe12e895b1681e
@@ -0,0 +1,113 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'faraday'
4
+ require 'faraday/follow_redirects'
5
+ # Class Almapi handles Alma's API call
6
+ class Almapi::Api
7
+
8
+ # Reads the key for API calls.
9
+ #
10
+ # @return [String] the API key
11
+ attr_reader :apikey
12
+
13
+ # Reads the URI base for API calls.
14
+ #
15
+ # @return [String] the URI base
16
+ attr_reader :uri_base
17
+
18
+ # Faraday object to handle API calls.
19
+ #
20
+ # @return [Object] the Faraday conn object
21
+ attr_reader :conn
22
+
23
+ # Initializes a new Almapi object and instance
24
+ # variable @apikey, @uri_base and @conn
25
+ # that is a Faraday connexion.
26
+ #
27
+ # @param apikey : API key to be used in API call
28
+ # @param uri_base : base URI for API call
29
+ def initialize(apikey, uri_base)
30
+ @apikey = apikey
31
+ @uri_base = uri_base
32
+ @conn =
33
+ Faraday.new do |f|
34
+ f.response :follow_redirects
35
+ end
36
+ end
37
+
38
+ # Handles a GET request creating the complete URI.
39
+ # It handles the general case, the case of barcode use for items and
40
+ # the case of analytics.
41
+ # If analytics, handles the resumption_token and limit is set to 1000
42
+ # which is the maximum.
43
+ #
44
+ # @param resource [String] mandatory : the part of the URI specifying the access point.
45
+ # <b>EXCEPT for analytics and barcode</b>, it must not include "?" for it adds "?apikey" automatically.
46
+ # If analytics, resource must include the report name.
47
+ # If barcode, resource must include the barcode value.
48
+ # @param resumption_token [String] : resumption token for an analytics call.
49
+ # @return [Response] : the resulting response
50
+ def get(resource, resumption_token = "")
51
+ url_api =
52
+ if resource.include?("analytics") # API call to Analytics entry point
53
+ "#{@uri_base}{resource}&limit=1000&apikey=#{@apikey}&#{resumption_token}"
54
+ elsif resource.include?("barcode") # API call to items entry point with barcode
55
+ "#{@uri_base}#{resource}&apikey=#{@apikey}"
56
+ else
57
+ "#{@uri_base}#{resource}?apikey=#{@apikey}" # All other cases
58
+ end
59
+
60
+ handle_response(@conn.get(url_api))
61
+
62
+ end
63
+
64
+ # Handles a POST request creating the complete URI.
65
+ #
66
+ # @param resource [String] mandatory : the part of the URI specifying the access point.
67
+ # Must not include "?" for it adds "?apikey" automatically.
68
+ # @param data [String] : an XML string containing data to post.
69
+ # @return [Response] : the resulting response
70
+ def post(resource, data)
71
+ url_api = "#{resource}?apikey=#{@apikey}"
72
+ handle_response(@conn.post(url_api, data.to_s, "Content-Type" => 'application/xml'))
73
+ end
74
+
75
+ # Handles a PUT request creating the complete URI.
76
+ #
77
+ # @param resource [String] mandatory : the part of the URI specifying the access point.
78
+ # Must not include "?" for it adds "?apikey" automatically.
79
+ # @param data [String] : an XML string containing data to put.
80
+ # @return [Response] : the resulting response. If error occurs, raises an AlmapiError
81
+ def put(resource, data)
82
+ url_api = "#{resource}?apikey=#{@apikey}"
83
+ handle_response(@conn.put(url_api, data.to_s, "Content-Type" => 'application/xml'))
84
+ end
85
+
86
+ # Handles a DELETE request creating the complete URI.
87
+ #
88
+ # @param resource [String] mandatory : the part of the URI specifying the access point.
89
+ # Must not include "?" for it adds "?apikey" automatically.
90
+ # @param data [String] : an XML string containing data to put.
91
+ # @return [Response] : the resulting response. If error occurs, raises an AlmapiError
92
+ def put(resource, data)
93
+ url_api = "#{resource}?apikey=#{@apikey}"
94
+ handle_response(@conn.put(url_api, data.to_s, "Content-Type" => 'application/xml'))
95
+ end
96
+
97
+ private
98
+ # [Private] handles the response and decides to raise AlmapiError if necessary
99
+ #
100
+ # @param response [Response] mandatory : the response of the API call
101
+ # @return [Response || AlmapiError] : the resulting response if the API call succeeded, else AlmapiError
102
+ def handle_response(response)
103
+ case response.status
104
+ when 200
105
+ # Success
106
+ return response
107
+ else
108
+ # Request has been correctly handled but cannot succeed
109
+ raise Almapi::AlmapiError.new("AlmapiError : #{response.status} -> #{response.body}")
110
+ end
111
+ end
112
+ end
113
+
@@ -0,0 +1,11 @@
1
+ # Class AlmapiError handles Alma's API call errors
2
+ class Almapi::AlmapiError < StandardError
3
+ # Initializes a new AlmapiError object
4
+ #
5
+ # @param msg [String] : error message
6
+ # @param exception_type [String] : exception type.
7
+ def initialize(msg="This is an AlmpiError", exception_type="AlmpiError")
8
+ @exception_type = exception_type
9
+ super(msg) # Calling initialize in StandardError
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Almapi
4
+ VERSION = "0.1.3"
5
+ end
data/lib/almapi.rb ADDED
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "./almapi/version"
4
+ require_relative './almapi/almapi_error'
5
+ require_relative './almapi/almapi'
6
+
7
+ # Module Almapi handles Alma's API call and errors
8
+ # @author jszenb
9
+ module Almapi
10
+
11
+ end
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: almapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - jszenb
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2024-04-04 00:00:00.000000000 Z
12
12
  dependencies:
@@ -115,17 +115,10 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
- - ".rspec"
119
- - ".rubocop-http---relaxed-ruby-style-rubocop-yml"
120
- - ".rubocop.yml"
121
- - CHANGELOG.md
122
- - CODE_OF_CONDUCT.md
123
- - Gemfile
124
- - Gemfile.lock
125
- - LICENSE.txt
126
- - README.md
127
- - Rakefile
128
- - sig/almapi.rbs
118
+ - lib/almapi.rb
119
+ - lib/almapi/almapi.rb
120
+ - lib/almapi/almapi_error.rb
121
+ - lib/almapi/version.rb
129
122
  homepage: https://rubygems.org/gems/almapi.
130
123
  licenses:
131
124
  - MIT
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
@@ -1,153 +0,0 @@
1
- # Relaxed.Ruby.Style
2
- ## Version 2.5
3
-
4
- Style/Alias:
5
- Enabled: false
6
- StyleGuide: https://relaxed.ruby.style/#stylealias
7
-
8
- Style/AsciiComments:
9
- Enabled: false
10
- StyleGuide: https://relaxed.ruby.style/#styleasciicomments
11
-
12
- Style/BeginBlock:
13
- Enabled: false
14
- StyleGuide: https://relaxed.ruby.style/#stylebeginblock
15
-
16
- Style/BlockDelimiters:
17
- Enabled: false
18
- StyleGuide: https://relaxed.ruby.style/#styleblockdelimiters
19
-
20
- Style/CommentAnnotation:
21
- Enabled: false
22
- StyleGuide: https://relaxed.ruby.style/#stylecommentannotation
23
-
24
- Style/Documentation:
25
- Enabled: false
26
- StyleGuide: https://relaxed.ruby.style/#styledocumentation
27
-
28
- Layout/DotPosition:
29
- Enabled: false
30
- StyleGuide: https://relaxed.ruby.style/#layoutdotposition
31
-
32
- Style/DoubleNegation:
33
- Enabled: false
34
- StyleGuide: https://relaxed.ruby.style/#styledoublenegation
35
-
36
- Style/EndBlock:
37
- Enabled: false
38
- StyleGuide: https://relaxed.ruby.style/#styleendblock
39
-
40
- Style/FormatString:
41
- Enabled: false
42
- StyleGuide: https://relaxed.ruby.style/#styleformatstring
43
-
44
- Style/IfUnlessModifier:
45
- Enabled: false
46
- StyleGuide: https://relaxed.ruby.style/#styleifunlessmodifier
47
-
48
- Style/Lambda:
49
- Enabled: false
50
- StyleGuide: https://relaxed.ruby.style/#stylelambda
51
-
52
- Style/ModuleFunction:
53
- Enabled: false
54
- StyleGuide: https://relaxed.ruby.style/#stylemodulefunction
55
-
56
- Style/MultilineBlockChain:
57
- Enabled: false
58
- StyleGuide: https://relaxed.ruby.style/#stylemultilineblockchain
59
-
60
- Style/NegatedIf:
61
- Enabled: false
62
- StyleGuide: https://relaxed.ruby.style/#stylenegatedif
63
-
64
- Style/NegatedWhile:
65
- Enabled: false
66
- StyleGuide: https://relaxed.ruby.style/#stylenegatedwhile
67
-
68
- Style/NumericPredicate:
69
- Enabled: false
70
- StyleGuide: https://relaxed.ruby.style/#stylenumericpredicate
71
-
72
- Style/ParallelAssignment:
73
- Enabled: false
74
- StyleGuide: https://relaxed.ruby.style/#styleparallelassignment
75
-
76
- Style/PercentLiteralDelimiters:
77
- Enabled: false
78
- StyleGuide: https://relaxed.ruby.style/#stylepercentliteraldelimiters
79
-
80
- Style/PerlBackrefs:
81
- Enabled: false
82
- StyleGuide: https://relaxed.ruby.style/#styleperlbackrefs
83
-
84
- Style/Semicolon:
85
- Enabled: false
86
- StyleGuide: https://relaxed.ruby.style/#stylesemicolon
87
-
88
- Style/SignalException:
89
- Enabled: false
90
- StyleGuide: https://relaxed.ruby.style/#stylesignalexception
91
-
92
- Style/SingleLineBlockParams:
93
- Enabled: false
94
- StyleGuide: https://relaxed.ruby.style/#stylesinglelineblockparams
95
-
96
- Style/SingleLineMethods:
97
- Enabled: false
98
- StyleGuide: https://relaxed.ruby.style/#stylesinglelinemethods
99
-
100
- Layout/SpaceBeforeBlockBraces:
101
- Enabled: false
102
- StyleGuide: https://relaxed.ruby.style/#layoutspacebeforeblockbraces
103
-
104
- Layout/SpaceInsideParens:
105
- Enabled: false
106
- StyleGuide: https://relaxed.ruby.style/#layoutspaceinsideparens
107
-
108
- Style/SpecialGlobalVars:
109
- Enabled: false
110
- StyleGuide: https://relaxed.ruby.style/#stylespecialglobalvars
111
-
112
- Style/StringLiterals:
113
- Enabled: false
114
- StyleGuide: https://relaxed.ruby.style/#stylestringliterals
115
-
116
- Style/TrailingCommaInArguments:
117
- Enabled: false
118
- StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarguments
119
-
120
- Style/TrailingCommaInArrayLiteral:
121
- Enabled: false
122
- StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarrayliteral
123
-
124
- Style/TrailingCommaInHashLiteral:
125
- Enabled: false
126
- StyleGuide: https://relaxed.ruby.style/#styletrailingcommainhashliteral
127
-
128
- Style/SymbolArray:
129
- Enabled: false
130
- StyleGuide: http://relaxed.ruby.style/#stylesymbolarray
131
-
132
- Style/WhileUntilModifier:
133
- Enabled: false
134
- StyleGuide: https://relaxed.ruby.style/#stylewhileuntilmodifier
135
-
136
- Style/WordArray:
137
- Enabled: false
138
- StyleGuide: https://relaxed.ruby.style/#stylewordarray
139
-
140
- Lint/AmbiguousRegexpLiteral:
141
- Enabled: false
142
- StyleGuide: https://relaxed.ruby.style/#lintambiguousregexpliteral
143
-
144
- Lint/AssignmentInCondition:
145
- Enabled: false
146
- StyleGuide: https://relaxed.ruby.style/#lintassignmentincondition
147
-
148
- Layout/LineLength:
149
- Enabled: false
150
-
151
- Metrics:
152
- Enabled: false
153
-
data/.rubocop.yml DELETED
@@ -1,75 +0,0 @@
1
- # Utiliser une version (peu) édulcorée des règles de base de rubocop
2
- inherit_from:
3
- - http://relaxed.ruby.style/rubocop.yml
4
-
5
- # Ajoute des règles de performance aux règles de base de Rubocop
6
- require:
7
- - rubocop-performance
8
-
9
- AllCops:
10
- # Chaque version de rubocop ajoute de nouvelles règles.
11
- # Ceci les active par défaut.
12
- NewCops: enable
13
- DisplayStyleGuide: true
14
- DisplayCopNames: true
15
- Exclude:
16
- - "bin/*"
17
- - "vendor/**/*"
18
-
19
- # Certains fichiers sont de gigantesques block.
20
- # Ne pas les compter.
21
- Metrics/BlockLength:
22
- Exclude:
23
- - "spec/**/*.rb"
24
- - "Guardfile"
25
- - "vendor/bundle"
26
- - "*.gemspec"
27
-
28
- # Les règles qui vont suivre sont des règles de style
29
- # permettant de split les lignes.
30
- Layout/DotPosition:
31
- Enabled: true
32
- EnforcedStyle: trailing
33
-
34
- Style/TrailingCommaInArrayLiteral:
35
- Enabled: true
36
- EnforcedStyleForMultiline: comma
37
-
38
- Style/TrailingCommaInHashLiteral:
39
- Enabled: true
40
- EnforcedStyleForMultiline: comma
41
-
42
- Layout/MultilineArrayLineBreaks:
43
- Enabled: true
44
-
45
- Layout/MultilineHashKeyLineBreaks:
46
- Enabled: true
47
-
48
- Layout/MultilineMethodArgumentLineBreaks:
49
- Enabled: true
50
-
51
- Layout/FirstArrayElementLineBreak:
52
- Enabled: true
53
-
54
- Layout/FirstHashElementLineBreak:
55
- Enabled: true
56
-
57
- Layout/FirstMethodArgumentLineBreak:
58
- Enabled: true
59
-
60
- Layout/MultilineAssignmentLayout:
61
- Enabled: true
62
-
63
- # Ajoute une limite maximum à la longueur d'une ligne
64
- Layout/LineLength:
65
- Enabled: true
66
- Max: 120
67
- # Cette option fait en sorte que Rubocop essaye d'ajouter
68
- # des retours à la ligne là où il faut.
69
- AutoCorrect: true
70
- Exclude:
71
- - Gemfile
72
- - Guardfile
73
-
74
- Gemspec/DevelopmentDependencies:
75
- EnforcedStyle: gemspec
data/CHANGELOG.md DELETED
@@ -1,13 +0,0 @@
1
- ## [Unreleased]
2
-
3
- ## [0.1.2] - 2024-04-04
4
-
5
- - Correct require_relative error (learning to create gem so may take a few versions :) .
6
-
7
- ## [0.1.1] - 2024-04-04
8
-
9
- - Correct require_relative error.
10
-
11
- ## [0.1.0] - 2024-03-29
12
-
13
- - Initial release
data/CODE_OF_CONDUCT.md DELETED
@@ -1,84 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
-
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
-
9
- ## Our Standards
10
-
11
- Examples of behavior that contributes to a positive environment for our community include:
12
-
13
- * Demonstrating empathy and kindness toward other people
14
- * Being respectful of differing opinions, viewpoints, and experiences
15
- * Giving and gracefully accepting constructive feedback
16
- * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- * Focusing on what is best not just for us as individuals, but for the overall community
18
-
19
- Examples of unacceptable behavior include:
20
-
21
- * The use of sexualized language or imagery, and sexual attention or
22
- advances of any kind
23
- * Trolling, insulting or derogatory comments, and personal or political attacks
24
- * Public or private harassment
25
- * Publishing others' private information, such as a physical or email
26
- address, without their explicit permission
27
- * Other conduct which could reasonably be considered inappropriate in a
28
- professional setting
29
-
30
- ## Enforcement Responsibilities
31
-
32
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
-
34
- Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
-
36
- ## Scope
37
-
38
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
-
40
- ## Enforcement
41
-
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at jerome.chiavassa-szenberg@campus-condorcet.fr. All complaints will be reviewed and investigated promptly and fairly.
43
-
44
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
-
46
- ## Enforcement Guidelines
47
-
48
- Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
-
50
- ### 1. Correction
51
-
52
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
-
54
- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
-
56
- ### 2. Warning
57
-
58
- **Community Impact**: A violation through a single incident or series of actions.
59
-
60
- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
-
62
- ### 3. Temporary Ban
63
-
64
- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
-
66
- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
-
68
- ### 4. Permanent Ban
69
-
70
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
-
72
- **Consequence**: A permanent ban from any sort of public interaction within the community.
73
-
74
- ## Attribution
75
-
76
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
- available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
-
79
- Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
-
81
- [homepage]: https://www.contributor-covenant.org
82
-
83
- For answers to common questions about this code of conduct, see the FAQ at
84
- https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- # Specify your gem's dependencies in almapi.gemspec
6
- gemspec
7
-
8
- gem "rake", "~> 13.0"
data/Gemfile.lock DELETED
@@ -1,80 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- almapi (0.1.2)
5
- faraday
6
- faraday-follow_redirects
7
- zeitwerk (~> 2)
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- ast (2.4.2)
13
- diff-lcs (1.5.1)
14
- faraday (2.9.0)
15
- faraday-net_http (>= 2.0, < 3.2)
16
- faraday-follow_redirects (0.3.0)
17
- faraday (>= 1, < 3)
18
- faraday-net_http (3.1.0)
19
- net-http
20
- json (2.7.1)
21
- language_server-protocol (3.17.0.3)
22
- net-http (0.4.1)
23
- uri
24
- parallel (1.24.0)
25
- parser (3.3.0.5)
26
- ast (~> 2.4.1)
27
- racc
28
- racc (1.7.3)
29
- rainbow (3.1.1)
30
- rake (13.1.0)
31
- regexp_parser (2.9.0)
32
- rexml (3.2.6)
33
- rspec (3.13.0)
34
- rspec-core (~> 3.13.0)
35
- rspec-expectations (~> 3.13.0)
36
- rspec-mocks (~> 3.13.0)
37
- rspec-core (3.13.0)
38
- rspec-support (~> 3.13.0)
39
- rspec-expectations (3.13.0)
40
- diff-lcs (>= 1.2.0, < 2.0)
41
- rspec-support (~> 3.13.0)
42
- rspec-mocks (3.13.0)
43
- diff-lcs (>= 1.2.0, < 2.0)
44
- rspec-support (~> 3.13.0)
45
- rspec-support (3.13.1)
46
- rubocop (1.62.1)
47
- json (~> 2.3)
48
- language_server-protocol (>= 3.17.0)
49
- parallel (~> 1.10)
50
- parser (>= 3.3.0.2)
51
- rainbow (>= 2.2.2, < 4.0)
52
- regexp_parser (>= 1.8, < 3.0)
53
- rexml (>= 3.2.5, < 4.0)
54
- rubocop-ast (>= 1.31.1, < 2.0)
55
- ruby-progressbar (~> 1.7)
56
- unicode-display_width (>= 2.4.0, < 3.0)
57
- rubocop-ast (1.31.2)
58
- parser (>= 3.3.0.4)
59
- rubocop-performance (1.20.2)
60
- rubocop (>= 1.48.1, < 2.0)
61
- rubocop-ast (>= 1.30.0, < 2.0)
62
- ruby-progressbar (1.13.0)
63
- unicode-display_width (2.5.0)
64
- uri (0.13.0)
65
- yard (0.9.36)
66
- zeitwerk (2.6.13)
67
-
68
- PLATFORMS
69
- x86_64-linux
70
-
71
- DEPENDENCIES
72
- almapi!
73
- rake (~> 13.0)
74
- rspec
75
- rubocop
76
- rubocop-performance
77
- yard
78
-
79
- BUNDLED WITH
80
- 2.4.10
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2024 jszenb
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/README.md DELETED
@@ -1,60 +0,0 @@
1
- # Almapi
2
-
3
- This gem is used to handle Alma'a API call.
4
-
5
- ## Installation
6
-
7
- Install the gem and add to the application's Gemfile by executing:
8
-
9
- $ bundle add almapi
10
-
11
- If bundler is not being used to manage dependencies, install the gem by executing:
12
-
13
- $ gem install almapi
14
-
15
- ## Usage
16
-
17
- Almapi provides an Alampi module which contains the Api class.
18
-
19
- An Api class object is created with two mandatory information: an key for Alma's API and a base URI for Alma's API.
20
-
21
- The Api class is providing the following methods:
22
- * delete: to handle DELETE method calls. Needs two mandatory parameters: resource and data
23
- * get: to handle GET method calls. Needs two mandatory parameters: resource and resumption_token
24
- * post: to handle PSOT method calls. Needs two mandatory parameters: resource and data
25
- * put: to handle PUT method calls. Needs two mandatory parameters: resource and data
26
-
27
- Here is a description of each parameter mentionned above:
28
- * resource: it is the part that completes the base uri to create a complete Alma's API call, with the various ids and necessary parameters but without the apikey parameter that will be added automatically.
29
- * data: the XML data needed by the called resource and method.
30
- * resumption_token: is parameter is not mandatory and is used only for analytics calls.
31
-
32
- ## Documentation
33
-
34
- Documentation is provided in `doc` folder (use `yard`).
35
-
36
- ## Development
37
-
38
- Put your Ruby code in the file `lib/almapi`. To experiment with that code, run `bin/console` for an interactive prompt.
39
-
40
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests (see below). You can also run `bin/console` for an interactive prompt that will allow you to experiment.
41
-
42
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
43
-
44
- ### Testing
45
-
46
- Tested using `rspec`.
47
-
48
- In spec directory, define a `almapi_spec_init.rb` with two string constants : APIKEY and URIBASE, giving an api key value and a uri base value.
49
-
50
- ## Contributing
51
-
52
- Bug reports and pull requests are welcome on GitHub at https://github.com/jszenb/almapi. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/jszenb/almapi/blob/master/CODE_OF_CONDUCT.md).
53
-
54
- ## License
55
-
56
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
57
-
58
- ## Code of Conduct
59
-
60
- Everyone interacting in the Almapi project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/jszenb/almapi/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile DELETED
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- require "rubocop/rake_task"
9
-
10
- RuboCop::RakeTask.new
11
-
12
- task default: %i[spec rubocop]
data/sig/almapi.rbs DELETED
@@ -1,4 +0,0 @@
1
- module Almapi
2
- VERSION: String
3
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
- end