appfuel 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/lib/appfuel/storage/web_api/http_model.rb +23 -2
- data/lib/appfuel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: beefc3a9ec7594370a31fe42de16d6b109d90279
|
4
|
+
data.tar.gz: 8e4f95b742475e7a91239708ce8f3f81707e7b3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fabfb619c581c0ddc07404061e7b336d80aa846c181ec362891cf823fe0b656dca7f5908e86125b726e43ac5e8d4af809190e83f331e8b787dd4204e56b44c47
|
7
|
+
data.tar.gz: f56daa9f43805b1572a853655abb43ca367dd605423f1cfe4be250ce13b400e683533a46718d05425b833e8ec780a1613a77035366ecd188a92588489ed8cc43
|
data/CHANGELOG.md
CHANGED
@@ -5,7 +5,14 @@ All notable changes to this project will be documented in this file. (Pending ap
|
|
5
5
|
|
6
6
|
|
7
7
|
# Releases
|
8
|
-
## [[0.3.
|
8
|
+
## [[0.3.4]](https://github.com/rsb/appfuel/releases/tag/0.3.4) 2017-06-20
|
9
|
+
### Changed
|
10
|
+
- `web api model` changed `url` to `uri`
|
11
|
+
### Added
|
12
|
+
- `web api model` added `url` method to create full endpoint with path
|
13
|
+
- `web api model` added `get` and `post` to wrap rest-client interface
|
14
|
+
|
15
|
+
## [[0.3.3]](https://github.com/rsb/appfuel/releases/tag/0.3.3) 2017-06-20
|
9
16
|
### Added
|
10
17
|
- `storage_hash` method to general mapper
|
11
18
|
|
@@ -43,17 +43,38 @@ module Appfuel
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
attr_reader :config, :
|
46
|
+
attr_reader :config, :uri, :adapter, :content_type
|
47
47
|
|
48
48
|
def initialize
|
49
49
|
@config = self.class.load_config
|
50
50
|
unless @config.key?(:url)
|
51
51
|
fail "[web_api initialize] config is missing :url"
|
52
52
|
end
|
53
|
-
@
|
53
|
+
@uri = URI(@config[:url])
|
54
54
|
@adapter = self.class.load_http_adapter
|
55
55
|
end
|
56
56
|
|
57
|
+
def url(path)
|
58
|
+
uri.to_s + "/#{path}"
|
59
|
+
end
|
60
|
+
|
61
|
+
def get(path, options = {})
|
62
|
+
add_content_type(options)
|
63
|
+
adapter.get(url(path), options)
|
64
|
+
end
|
65
|
+
|
66
|
+
def post(path, params = {}, options = {})
|
67
|
+
add_content_type(options)
|
68
|
+
adapter.post(url(path), params, options)
|
69
|
+
end
|
70
|
+
|
71
|
+
private
|
72
|
+
|
73
|
+
def add_content_type(options)
|
74
|
+
if content_type && !options.key?(:content_type)
|
75
|
+
options[:content_type] = content_type
|
76
|
+
end
|
77
|
+
end
|
57
78
|
end
|
58
79
|
end
|
59
80
|
end
|
data/lib/appfuel/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appfuel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Scott-Buccleuch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|