appfuel 0.4.3 → 0.4.4

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
  SHA1:
3
- metadata.gz: 251641502bd9884ee6c26eb419b46c434a9c20d6
4
- data.tar.gz: e669ab20c305420bf5d04fb5d7f0c31ea474054b
3
+ metadata.gz: 791084a5719110e76c41bf1eb305ca214dcad6ae
4
+ data.tar.gz: 89567858ea98c91f2e034c709d8662b8ae1ef2a1
5
5
  SHA512:
6
- metadata.gz: d0d241f0d91a742a4c42f4b21a1e1318422cf80c438343406cfa2cc868bc4d1ccb999ca109dfdda84b717c50f88e90d686567d763c0bf0c574fcb16179027674
7
- data.tar.gz: f318266ed813d1d1763493fa01098f15e6d9a1e47d8688f7fa73a06bf6b67cdb8aad1941ec60181b13d80df651f8583226caa0454ffe7f35166b9ca6a38a4b48
6
+ metadata.gz: 1547177ab48f3ba39e1e7cd71bfe01d22d86341cb7f5affc746ba65cf5011ef0aeeb41acf5d496abf9513d63c9a0263e09ef9ea0ad9deac6e0f85fb8c276be4e
7
+ data.tar.gz: 9815ebdf21d91cff4d8deefd97ac0305da22939f2476bf0a12e3cdb9407d30ffee66262552932bfd64f962b403aab1c8b560f4ca3f922fff92f57259d66a832d
data/CHANGELOG.md CHANGED
@@ -5,6 +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.4.4]] (https://github.com/rsb/appfuel/releases/tag/0.4.4) 2017-06-21
9
+ ### Changed
10
+ - upgraded `active record to 5.1.1`
11
+
12
+ ### Fixed
13
+ - invalid require statement for logging initializer
14
+ - invalid container key for web_api initializer
15
+
8
16
  ## [[0.4.3]](https://github.com/rsb/appfuel/releases/tag/0.4.3) 2017-06-21
9
17
  ### Fixed
10
18
  - db config definition referenced invalid namespace
data/appfuel.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  # we have to lock dry-types due to failures I am encountering
24
24
  # when dynamically creating form validators. Not sure if it is the library
25
25
  # or the way I am using it.
26
- spec.add_dependency "activerecord", "~> 5.1.0"
26
+ spec.add_dependency "activerecord", "~> 5.1.1"
27
27
  spec.add_dependency "pg", "~> 0.20"
28
28
  spec.add_dependency "dry-types", "0.9.2"
29
29
  spec.add_dependency "dry-container", "~> 0.6"
@@ -1,3 +1,3 @@
1
- require_relative 'logger'
1
+ require_relative 'logging'
2
2
  require_relative 'db'
3
3
  require_relative 'web_api'
@@ -1,4 +1,4 @@
1
- Appfuel::Initialize.define('global.http_adapter') do |config, container|
1
+ Appfuel::Initialize.define('global.web_api') do |config, container|
2
2
  require 'rest-client'
3
3
  container.register('web_api.http_adapter', RestClient)
4
4
  end
@@ -1,4 +1,6 @@
1
1
  require 'uri'
2
+ require 'json'
3
+ require 'rest-client'
2
4
 
3
5
  module Appfuel
4
6
  module WebApi
@@ -58,21 +60,35 @@ module Appfuel
58
60
  uri.to_s + "/#{path}"
59
61
  end
60
62
 
61
- def get(path, options = {})
63
+ def request(method, path, options = {})
62
64
  add_content_type(options)
63
- adapter.get(url(path), options)
65
+ http_url = url(path)
66
+ begin
67
+ data = options.merge({method: method, url: http_url })
68
+ response = adapter::Request.execute(data)
69
+ parse_json = options.delete(:json)
70
+ if parse_json == true
71
+ response = json(response.body)
72
+ end
73
+ rescue => err
74
+ msg = "[#{http_url}] #{err.message}"
75
+ err.message = msg
76
+ raise err
77
+ end
78
+
79
+ response
64
80
  end
65
81
 
66
- def post(path, params = {}, options = {})
67
- add_content_type(options)
68
- adapter.post(url(path), params, options)
82
+ def json(data)
83
+ JSON.parse(data)
69
84
  end
70
85
 
71
86
  private
72
87
 
73
88
  def add_content_type(options)
74
- if content_type && !options.key?(:content_type)
75
- options[:content_type] = content_type
89
+ options[:headers] ||= {}
90
+ if content_type && !options[:headers].key?(:content_type)
91
+ options[:headers][:content_type] = content_type
76
92
  end
77
93
  end
78
94
  end
@@ -22,6 +22,10 @@ module Appfuel
22
22
  =end
23
23
  end
24
24
 
25
+ def storage_class(domain_name, domain_attr)
26
+ mapper.storage_class(domain_name, domain_attr, :web_api)
27
+ end
28
+
25
29
  # when key has no . assume the feature of the repository
26
30
  #
27
31
  #
@@ -1,3 +1,3 @@
1
1
  module Appfuel
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
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.4.3
4
+ version: 0.4.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-21 00:00:00.000000000 Z
11
+ date: 2017-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 5.1.0
19
+ version: 5.1.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 5.1.0
26
+ version: 5.1.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pg
29
29
  requirement: !ruby/object:Gem::Requirement