epages-rest 1.0.2 → 1.0.3
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.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/epages/product.rb +5 -0
- data/lib/epages/rest/request.rb +1 -2
- data/lib/epages/shop.rb +3 -2
- data/lib/epages/utils.rb +1 -1
- data/lib/epages/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abbbdaf768efb6c4a943963ef45e768d5adc434b
|
4
|
+
data.tar.gz: ee5a7d1afbd68df9f2e188ced17aad97f3658aab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8490ff0dc25cc868dbfc794908a9bc422898150d24b0202b300251eb26ecd9b6bb396992708c71648eb69b2480bcd1a983c4c99b33dbc171593d96294df91ea
|
7
|
+
data.tar.gz: af53cbc4a04ef403810b94b28b4c404eb1fb11eb3bbce92a231f0b5cee2f824b5bd250d7506173ce1fab134dc5bd0287680cb6b547b1d1fcc0c14dce46521b2f
|
data/README.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
[](https://travis-ci.org/ePages-de/epages-rest-ruby)
|
2
|
+
[](https://codeclimate.com/github/ePages-de/epages-rest-ruby)
|
3
|
+
[](https://codeclimate.com/github/ePages-de/epages-rest-ruby/coverage)
|
4
|
+
|
1
5
|
# The Epages REST Ruby Gem
|
2
6
|
|
3
7
|
A Ruby interface to the Epages REST API
|
@@ -22,7 +26,7 @@ You can get any public information of any shop indicating only the name of the s
|
|
22
26
|
# Usage examples
|
23
27
|
|
24
28
|
The first thing is create your REST shop.
|
25
|
-
`shop = Epages::REST::Shop.new(
|
29
|
+
`shop = Epages::REST::Shop.new(shop_host, shop_name)` or `shop = Epages::REST::Shop.new(shop_host, shop_name, token)`
|
26
30
|
|
27
31
|
Once this is done, you can use the API calls.
|
28
32
|
|
data/lib/epages/product.rb
CHANGED
data/lib/epages/rest/request.rb
CHANGED
@@ -6,12 +6,11 @@ module Epages
|
|
6
6
|
class Request
|
7
7
|
include Epages::Utils
|
8
8
|
|
9
|
-
BASE_URL = 'https://pm.epages.com/rs/shops/'
|
10
9
|
attr_accessor :shop, :uri, :path, :request_method, :options, :headers
|
11
10
|
|
12
11
|
def initialize(object, request_method, path, options = {})
|
13
12
|
@shop = build_shop_from(object)
|
14
|
-
@uri = URI.parse(
|
13
|
+
@uri = URI.parse("https://#{@shop.host}/rs/shops/#{@shop.name.to_s + path}")
|
15
14
|
@path = uri.path
|
16
15
|
set_options(request_method, options)
|
17
16
|
end
|
data/lib/epages/shop.rb
CHANGED
data/lib/epages/utils.rb
CHANGED
@@ -69,7 +69,7 @@ module Epages
|
|
69
69
|
# returns a shop. If [shop] is not a Epages::REST::Shop create one calling the [shop] method shop_mame
|
70
70
|
def build_shop_from(shop)
|
71
71
|
return shop if shop.is_a? Epages::REST::Shop
|
72
|
-
Epages::REST::Shop.new(shop.shop_name)
|
72
|
+
Epages::REST::Shop.new(shop.host, shop.shop_name)
|
73
73
|
end
|
74
74
|
|
75
75
|
# returns the object replacing all the keys as symbols
|
data/lib/epages/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epages-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Domingo Cividanes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
version: '0'
|
119
119
|
requirements: []
|
120
120
|
rubyforge_project:
|
121
|
-
rubygems_version: 2.5.
|
121
|
+
rubygems_version: 2.5.1
|
122
122
|
signing_key:
|
123
123
|
specification_version: 4
|
124
124
|
summary: A Ruby interface to the Epages Rest API.
|