rajaongkir_api 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 118a6f13eb2c4e45ad2cfc857064015dcff4b152d656ddf1c2c4dbf2326dc238
4
+ data.tar.gz: 7b661f9896c2e9483324e31e772021b19021357efd0a6d6836006c068ab675a1
5
+ SHA512:
6
+ metadata.gz: 3211ab21ad8b4ce367c8a60ff590b7d415f3cb721e5c8d63baeb941633786f21eab57c674415fe52c12d4f0b3fc7e30e5f52517783a605b397ad668c76cf5b7e
7
+ data.tar.gz: 7d7f749d9a773ba5d2a846cb00499262af85fe4c932a49ab5d3cdbfa6c356d42d9e58f2412f10cb531d25e320d72b72962347fd115490c656ba8f32a1c666249
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.7.1
6
+ before_install: gem install bundler -v 2.1.4
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at jsavigny@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [https://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: https://contributor-covenant.org
74
+ [version]: https://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in rajaongkir_api.gemspec
4
+ gemspec
5
+
6
+ gem "rake", "~> 12.0"
7
+ gem "rspec", "~> 3.0"
8
+ gem "webmock"
@@ -0,0 +1,51 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rajaongkir_api (0.1.0)
5
+ faraday (~> 1.0.0)
6
+ faraday_middleware (~> 1.0.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ addressable (2.7.0)
12
+ public_suffix (>= 2.0.2, < 5.0)
13
+ crack (0.4.4)
14
+ diff-lcs (1.4.4)
15
+ faraday (1.0.1)
16
+ multipart-post (>= 1.2, < 3)
17
+ faraday_middleware (1.0.0)
18
+ faraday (~> 1.0)
19
+ hashdiff (1.0.1)
20
+ multipart-post (2.1.1)
21
+ public_suffix (4.0.6)
22
+ rake (12.3.3)
23
+ rspec (3.9.0)
24
+ rspec-core (~> 3.9.0)
25
+ rspec-expectations (~> 3.9.0)
26
+ rspec-mocks (~> 3.9.0)
27
+ rspec-core (3.9.3)
28
+ rspec-support (~> 3.9.3)
29
+ rspec-expectations (3.9.2)
30
+ diff-lcs (>= 1.2.0, < 2.0)
31
+ rspec-support (~> 3.9.0)
32
+ rspec-mocks (3.9.1)
33
+ diff-lcs (>= 1.2.0, < 2.0)
34
+ rspec-support (~> 3.9.0)
35
+ rspec-support (3.9.3)
36
+ webmock (3.9.1)
37
+ addressable (>= 2.3.6)
38
+ crack (>= 0.3.2)
39
+ hashdiff (>= 0.4.0, < 2.0.0)
40
+
41
+ PLATFORMS
42
+ ruby
43
+
44
+ DEPENDENCIES
45
+ rajaongkir_api!
46
+ rake (~> 12.0)
47
+ rspec (~> 3.0)
48
+ webmock
49
+
50
+ BUNDLED WITH
51
+ 1.17.3
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 jsavigny
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.
@@ -0,0 +1,81 @@
1
+ # RajaongkirApi
2
+
3
+ RajaOngkir API (https://rajaongkir.com/dokumentasi) Wrapper for Ruby
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'rajaongkir_api'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle install
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install rajaongkir_api
20
+
21
+ ## Usage
22
+
23
+ ### Creating the client
24
+ ```ruby
25
+ api_key = 's0m3k3y' # API Key from RajaOngkir
26
+ options = {
27
+ host: 'https://api.rajaongkir.com',
28
+ type: 'starter',
29
+ timeout: 5,
30
+ open_timeout: 5
31
+ }
32
+ rajaongkir = Rajaongkir.new(api_key, options)
33
+ ```
34
+
35
+ ### Province (https://rajaongkir.com/dokumentasi/starter#province-ringkasan)
36
+
37
+ ```ruby
38
+ provinces = rajaongkir.province
39
+ # => <Rajaongkir::Response @results=[{"province_id"=>"1", "province"=>"Bali"}, {"province_id"=>"2", "province"=>"Bangka Belitung"}, {"province_id"=>"3", "province"=>"Banten"}, {"province_id"=>"4", "province"=>"Bengkulu"}, {"province_id"=>"5", "province"=>"DI Yogyakarta"}, {"province_id"=>"6", "province"=>"DKI Jakarta"}, {"province_id"=>"7", "province"=>"Gorontalo"}, {"province_id"=>"8", "province"=>"Jambi"}, {"province_id"=>"9", "province"=>"Jawa Barat"}, {"province_id"=>"10", "province"=>"Jawa Tengah"}, {"province_id"=>"11", "province"=>"Jawa Timur"}, {"province_id"=>"12", "province"=>"Kalimantan Barat"}, {"province_id"=>"13", "province"=>"Kalimantan Selatan"}, {"province_id"=>"14", "province"=>"Kalimantan Tengah"}, {"province_id"=>"15", "province"=>"Kalimantan Timur"}, {"province_id"=>"16", "province"=>"Kalimantan Utara"}, {"province_id"=>"17", "province"=>"Kepulauan Riau"}, {"province_id"=>"18", "province"=>"Lampung"}, {"province_id"=>"19", "province"=>"Maluku"}, {"province_id"=>"20", "province"=>"Maluku Utara"}, {"province_id"=>"21", "province"=>"Nanggroe Aceh Darussalam (NAD)"}, {"province_id"=>"22", "province"=>"Nusa Tenggara Barat (NTB)"}, {"province_id"=>"23", "province"=>"Nusa Tenggara Timur (NTT)"}, {"province_id"=>"24", "province"=>"Papua"}, {"province_id"=>"25", "province"=>"Papua Barat"}, {"province_id"=>"26", "province"=>"Riau"}, {"province_id"=>"27", "province"=>"Sulawesi Barat"}, {"province_id"=>"28", "province"=>"Sulawesi Selatan"}, {"province_id"=>"29", "province"=>"Sulawesi Tengah"}, {"province_id"=>"30", "province"=>"Sulawesi Tenggara"}, {"province_id"=>"31", "province"=>"Sulawesi Utara"}, {"province_id"=>"32", "province"=>"Sumatera Barat"}, {"province_id"=>"33", "province"=>"Sumatera Selatan"}, {"province_id"=>"34", "province"=>"Sumatera Utara"}]>
40
+
41
+ province = rajaongkir.province(province_id: 1)
42
+ # => #<Rajaongkir::Response @results={"province_id"=>"1", "province"=>"Bali"}>
43
+ ```
44
+
45
+ ### City (https://rajaongkir.com/dokumentasi/starter#city-ringkasan)
46
+
47
+ ```ruby
48
+ cities = rajaongkir.city
49
+
50
+ # => #<Rajaongkir::Response @results=[{"city_id"=>"1", "province_id"=>"21", "province"=>"Nanggroe Aceh Darussalam (NAD)", "type"=>"Kabupaten", "city_name"=>"Aceh Barat", "postal_code"=>"23681"}, {"city_id"=>"2", "province_id"=>"21", "province"=>"Nanggroe Aceh Darussalam (NAD)", "type"=>"Kabupaten", "city_name"=>"Aceh Barat Daya", "postal_code"=>"23764"}, {"city_id"=>"3", "province_id"=>"21", "province"=>"Nanggroe Aceh Darussalam (NAD)", "type"=>"Kabupaten", "city_name"=>"Aceh Besar", "postal_code"=>"23951"}, {"city_id"=>"4", "province_id"=>"21", "province"=>"Nanggroe Aceh Darussalam (NAD)", "type"=>"Kabupaten", "city_name"=>"Aceh Jaya", "postal_code"=>"23654"}, {"city_id"=>"5", "province_id"=>"21", "province"=>"Nanggroe Aceh Darussalam (NAD)", "type"=>"Kabupaten", "city_name"=>"Aceh Selatan", "postal_code"=>"23719"}, {"city_id"=>"6", "province_id"=>"21", "province"=>"Nanggroe Aceh Darussalam (NAD)", "type"=>"Kabupaten", "city_name"=>"Aceh Singkil", "postal_code"=>"24785"}, {"city_id"=>"7", "province_id"=>"21", "province"=>"Nanggroe Aceh Darussalam (NAD)", "type"=>"Kabupaten", "city_name"=>"Aceh Tamiang", "postal_code"=>"24476"} ...]
51
+
52
+ city = rajaongkir.city(city_id: 1)
53
+ # => #<Rajaongkir::Response @results={"city_id"=>"1", "province_id"=>"21", "province"=>"Nanggroe Aceh Darussalam (NAD)", "type"=>"Kabupaten", "city_name"=>"Aceh Barat", "postal_code"=>"23681"}>
54
+ ```
55
+
56
+ ### Cost (https://rajaongkir.com/dokumentasi/starter#cost-ringkasan)
57
+
58
+ ```ruby
59
+ cost = rajaongkir.cost(origin: 1, destination: 2, weight: 1, courier: 'jne')
60
+
61
+ # => #<Rajaongkir::Response @results=[{"code"=>"jne", "name"=>"Jalur Nugraha Ekakurir (JNE)", "costs"=>[{"service"=>"OKE", "description"=>"Ongkos Kirim Ekonomis", "cost"=>[{"value"=>18000, "etd"=>"4-6", "note"=>""}]}, {"service"=>"REG", "description"=>"Layanan Reguler", "cost"=>[{"value"=>20000, "etd"=>"2-3", "note"=>""}]}]}]>
62
+ ```
63
+
64
+ ## Development
65
+
66
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
67
+
68
+ 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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
69
+
70
+ ## Contributing
71
+
72
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jsavigny/rajaongkir_api. 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/jsavigny/rajaongkir_api/blob/master/CODE_OF_CONDUCT.md).
73
+
74
+
75
+ ## License
76
+
77
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
78
+
79
+ ## Code of Conduct
80
+
81
+ Everyone interacting in the RajaongkirApi project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/jsavigny/rajaongkir_api/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "rajaongkir"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,26 @@
1
+ require 'rajaongkir/api'
2
+ require 'rajaongkir/error'
3
+ require 'rajaongkir/version'
4
+
5
+ module Rajaongkir
6
+ class << self
7
+
8
+ # api_key = API Key from RajaOngkir
9
+ # opts[:host] = Host of RajaOngkir
10
+ # opts[:type] = Account Type (starter/basic/pro)
11
+ def new(api_key, opts = {})
12
+ Rajaongkir::API.new(api_key, default_options.merge(opts))
13
+ end
14
+
15
+ private
16
+
17
+ def default_options
18
+ {
19
+ host: 'https://api.rajaongkir.com',
20
+ type: 'starter',
21
+ timeout: 5,
22
+ open_timeout: 5
23
+ }
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,122 @@
1
+ require 'faraday'
2
+ require 'faraday_middleware'
3
+ require 'rajaongkir/response'
4
+
5
+ module Rajaongkir
6
+ class API
7
+ attr_accessor :api_key, :host, :type, :timeout, :open_timeout
8
+
9
+ # api_key = API Key from RajaOngkir
10
+ # opts[:host] = Host of RajaOngkir
11
+ # opts[:type] = Account Type (starter/basic/pro)
12
+ # opts[:timeout] = Timeout, default 5s
13
+ # opts[:open_timeout] = Open Timeout, default 5s
14
+ def initialize(api_key, opts)
15
+ @api_key = api_key
16
+ @host = opts[:host]
17
+ @type = opts[:type]
18
+ @timeout = opts[:timeout]
19
+ @open_timeout = opts[:open_timeout]
20
+ end
21
+
22
+ # Retrieve provinces list from RajaOngkir
23
+ #
24
+ # Example:
25
+ # >> provinces = rajaongkir.province
26
+ # => <Rajaongkir::Response @results=[{"province_id"=>"1", "province"=>"Bali"}, {"province_id"=>"2", "province"=>"Bangka Belitung"}, {"province_id"=>"3", "province"=>"Banten"}]>
27
+ def province(opts = {})
28
+ payload = {
29
+ id: opts[:province_id]
30
+ }.compact
31
+
32
+ call(:get, 'province', payload)
33
+ end
34
+
35
+
36
+ # Retrieve cities list from RajaOngkir
37
+ #
38
+ # Example:
39
+ # >> cities = rajaongkir.city
40
+ # => #<Rajaongkir::Response @results=[{"city_id"=>"1", "province_id"=>"21", "province"=>"Nanggroe Aceh Darussalam (NAD)", "type"=>"Kabupaten", "city_name"=>"Aceh Barat", "postal_code"=>"23681"}, {"city_id"=>"2", "province_id"=>"21", "province"=>"Nanggroe Aceh Darussalam (NAD)", "type"=>"Kabupaten", "city_name"=>"Aceh Barat Daya", "postal_code"=>"23764"}]>
41
+ def city(opts = {})
42
+ payload = {
43
+ id: opts[:city_id],
44
+ province_id: opts[:province_id]
45
+ }.compact
46
+
47
+ call(:get, 'city', payload)
48
+ end
49
+
50
+
51
+ # Retrieve cost from source city to destination city given weight and courier
52
+ #
53
+ # Example:
54
+ # >> cost = rajaongkir.cost(origin: 1, destination: 2, weight: 1, courier: 'jne')
55
+ # => #<Rajaongkir::Response @results=[{"code"=>"jne", "name"=>"Jalur Nugraha Ekakurir (JNE)", "costs"=>[{"service"=>"OKE", "description"=>"Ongkos Kirim Ekonomis", "cost"=>[{"value"=>18000, "etd"=>"4-6", "note"=>""}]}, {"service"=>"REG", "description"=>"Layanan Reguler", "cost"=>[{"value"=>20000, "etd"=>"2-3", "note"=>""}]}]}]>
56
+ def cost(opts = {})
57
+ payload = {
58
+ origin: opts[:origin].to_s,
59
+ destination: opts[:destination].to_s,
60
+ weight: opts[:weight].to_i,
61
+ courier: opts[:courier].to_s
62
+ }.compact
63
+
64
+ call(:post, 'cost', payload)
65
+ end
66
+
67
+ private
68
+
69
+ def call(method, path, payload)
70
+ start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
71
+
72
+ response = connection.send(method, path, payload)
73
+
74
+ duration = Process.clock_gettime(Process::CLOCK_MONOTONIC) - start_time
75
+
76
+ rajaongkir_response = verify(response)
77
+ Rajaongkir::Response.new(rajaongkir_response)
78
+ rescue Faraday::ConnectionFailed => e
79
+ raise Rajaongkir::OpenTimeoutError.new(e.message)
80
+ rescue Faraday::TimeoutError => e
81
+ raise Rajaongkir::ReadTimeoutError.new(e.message)
82
+ rescue Faraday::Error => e
83
+ raise Rajaongkir::ConnectionError.new(e.message)
84
+ rescue => e
85
+ raise e
86
+ end
87
+
88
+ def verify(response)
89
+ raise Rajaongkir::SystemError.new('Connection Error') unless response.body
90
+
91
+ body = response.body
92
+ status = body.dig('rajaongkir', 'status')
93
+
94
+ raise Rajaongkir::Error.new("Error: #{status.dig('description')}") if status.dig('code') >= 400
95
+
96
+ body.dig('rajaongkir')
97
+ end
98
+
99
+ def url
100
+ case @type
101
+ when 'pro'
102
+ 'https://pro.rajaongkir.com/api'
103
+ else
104
+ "#{@host}/#{@type}"
105
+ end
106
+ end
107
+
108
+ def connection
109
+ @_connection ||= Faraday.new(url: url) do |c|
110
+ c.request :json
111
+ c.response :json
112
+ c.headers['Content-Type'] = 'application/json'
113
+ c.headers['key'] = @api_key
114
+
115
+ c.options.timeout = @timeout
116
+ c.options.open_timeout = @open_timeout
117
+
118
+ c.adapter Faraday.default_adapter
119
+ end
120
+ end
121
+ end
122
+ end
@@ -0,0 +1,7 @@
1
+ module Rajaongkir
2
+ class Error < StandardError; end
3
+ class ConnectionError < Error; end
4
+ class OpenTimeoutError < ConnectionError; end
5
+ class ReadTimeoutError < ConnectionError; end
6
+ class SystemError < ConnectionError; end
7
+ end
@@ -0,0 +1,9 @@
1
+ module Rajaongkir
2
+ class Response
3
+ attr_accessor :results
4
+
5
+ def initialize(data)
6
+ @results = data.dig('results')
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ module Rajaongkir
2
+ VERSION = "0.1.1"
3
+ end
@@ -0,0 +1,32 @@
1
+ require_relative 'lib/rajaongkir/version'
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "rajaongkir_api"
5
+ spec.version = Rajaongkir::VERSION
6
+ spec.authors = ["Julio Savigny"]
7
+ spec.email = ["jsavigny@gmail.com"]
8
+
9
+ spec.summary = %q{Rajaongkir.com API wrapper for Ruby}
10
+ spec.description = %q{Rajaongkir.com API wrapper for Ruby}
11
+ spec.homepage = "https://rubygems.org/gems/rajaongkir_api"
12
+ spec.license = "MIT"
13
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
+
15
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
16
+
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = "https://github.com/jsavigny/rajaongkir_api"
19
+ spec.metadata["changelog_uri"] = "https://github.com/jsavigny/rajaongkir_api"
20
+
21
+ spec.add_dependency 'faraday', '~> 1.0.0'
22
+ spec.add_dependency 'faraday_middleware', '~> 1.0.0'
23
+
24
+ # Specify which files should be added to the gem when it is released.
25
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
26
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
27
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
28
+ end
29
+ spec.bindir = "exe"
30
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
+ spec.require_paths = ["lib"]
32
+ end
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rajaongkir_api
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Julio Savigny
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-10-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.0.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: faraday_middleware
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.0.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.0.0
41
+ description: Rajaongkir.com API wrapper for Ruby
42
+ email:
43
+ - jsavigny@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - ".rspec"
50
+ - ".travis.yml"
51
+ - CODE_OF_CONDUCT.md
52
+ - Gemfile
53
+ - Gemfile.lock
54
+ - LICENSE.txt
55
+ - README.md
56
+ - Rakefile
57
+ - bin/console
58
+ - bin/setup
59
+ - lib/rajaongkir.rb
60
+ - lib/rajaongkir/api.rb
61
+ - lib/rajaongkir/error.rb
62
+ - lib/rajaongkir/response.rb
63
+ - lib/rajaongkir/version.rb
64
+ - rajaongkir_api.gemspec
65
+ homepage: https://rubygems.org/gems/rajaongkir_api
66
+ licenses:
67
+ - MIT
68
+ metadata:
69
+ allowed_push_host: https://rubygems.org
70
+ homepage_uri: https://rubygems.org/gems/rajaongkir_api
71
+ source_code_uri: https://github.com/jsavigny/rajaongkir_api
72
+ changelog_uri: https://github.com/jsavigny/rajaongkir_api
73
+ post_install_message:
74
+ rdoc_options: []
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: 2.3.0
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ requirements: []
88
+ rubygems_version: 3.0.8
89
+ signing_key:
90
+ specification_version: 4
91
+ summary: Rajaongkir.com API wrapper for Ruby
92
+ test_files: []