marfa 0.3.3 → 0.4.0
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/lib/marfa/configuration.rb +8 -4
- data/lib/marfa/models/api_model.rb +9 -28
- data/lib/marfa/version.rb +1 -1
- data/marfa.gemspec +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: f14c3d03481a476f3ddfa3a512f24971d74283ec
|
4
|
+
data.tar.gz: f5befde9af61a03573b811198275e8ed4c150b8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b42d83c7e4c900257cbb693d0b46b54682983ec67f7c9e2ef00f9bd9aefdaccd1775a575d6d179bfa29b4b401511507eed252cd709c482a6875efc552a8a383
|
7
|
+
data.tar.gz: 69d33f58af93235a556e151c0dcdb36127a69378569cd0012f4853207863da24f01485b262eecf861bc1811028fb6af462b0e54789fa98cfee78a50ec64b4d1c
|
data/lib/marfa/configuration.rb
CHANGED
@@ -47,10 +47,14 @@ module Marfa
|
|
47
47
|
|
48
48
|
# Default settings fields for apps
|
49
49
|
def self._default_settings
|
50
|
-
@_default_settings = [
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
@_default_settings = %w[
|
51
|
+
public_folder
|
52
|
+
static_cache_control
|
53
|
+
views
|
54
|
+
environment
|
55
|
+
logging
|
56
|
+
dump_errors
|
57
|
+
show_exceptions
|
54
58
|
]
|
55
59
|
end
|
56
60
|
end
|
@@ -20,32 +20,6 @@ module Marfa
|
|
20
20
|
get_raw_data(params)
|
21
21
|
end
|
22
22
|
|
23
|
-
# Method that make request to delete data from API
|
24
|
-
# @param model_id [Fixnum] id to delete
|
25
|
-
# @example
|
26
|
-
# BaseModel.delete(19)
|
27
|
-
# @return [Hash]
|
28
|
-
def self.delete(model_id)
|
29
|
-
model_name = name.downcase
|
30
|
-
# data = {}
|
31
|
-
|
32
|
-
# begin
|
33
|
-
# path = "#{Marfa.config.api_server}#{model_name}/#{model_id.to_s}"
|
34
|
-
# response = RestClient.delete(path, { params: {}, headers: {} })
|
35
|
-
# data = JSON.parse(response.body, symbolize_names: true)
|
36
|
-
# rescue
|
37
|
-
# p '404 or ParserError'
|
38
|
-
# end
|
39
|
-
|
40
|
-
# Temporary code
|
41
|
-
p "#{Marfa.config.api_server}#{model_name}/#{model_id}"
|
42
|
-
p model_id
|
43
|
-
|
44
|
-
data = { deleted: true }
|
45
|
-
Marfa.cache.delete_by_pattern(model_name)
|
46
|
-
data
|
47
|
-
end
|
48
|
-
|
49
23
|
# "Raw" data getting
|
50
24
|
# @param params [Hash] - options hash
|
51
25
|
# @example
|
@@ -58,8 +32,15 @@ module Marfa
|
|
58
32
|
begin
|
59
33
|
response = RestClient.get("#{Marfa.config.api_server}#{path}", { params: params[:query], headers: {} })
|
60
34
|
result = JSON.parse(response.body, symbolize_names: true)
|
61
|
-
rescue
|
62
|
-
|
35
|
+
rescue => exception
|
36
|
+
if [:development, :test].include? Marfa.config.environment
|
37
|
+
p '========== Exception while making request: =========='
|
38
|
+
p "Path: #{Marfa.config.api_server}#{path}"
|
39
|
+
p 'Params:'
|
40
|
+
p params
|
41
|
+
p "#{exception.message} (#{exception.class})"
|
42
|
+
p '=================================================='
|
43
|
+
end
|
63
44
|
end
|
64
45
|
|
65
46
|
result
|
data/lib/marfa/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Version constant
|
2
2
|
module Marfa
|
3
3
|
# The version constant for the current version of Marfa
|
4
|
-
VERSION = '0.
|
4
|
+
VERSION = '0.4.0' unless defined?(Marfa::VERSION)
|
5
5
|
|
6
6
|
# The current Marfa version.
|
7
7
|
# @return [String] The version number
|
data/marfa.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marfa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Krechetov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-04-
|
13
|
+
date: 2017-04-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: haml
|