forest_liana 1.1.15 → 1.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/services/forest_liana/stripe_cards_getter.rb +4 -0
- data/app/services/forest_liana/stripe_invoices_getter.rb +4 -0
- data/app/services/forest_liana/stripe_payments_getter.rb +4 -0
- data/lib/forest_liana/engine.rb +31 -29
- data/lib/forest_liana/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: d8f236c05a4fda3ca63553fbe3bdc740c16a7199
|
4
|
+
data.tar.gz: ea83ef6b9644a7598356e7a1c0a5948c4eb6332a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f974c93a1fe87bc596ba6684f179dbe7bcec36e4b171d29215cf2c16b93ba1d254730ae1b7463245a5c9dba0655dc37f100eb7f0f3ddab599c6c32650012531
|
7
|
+
data.tar.gz: 0894696de4d8986d7bcc9936cb3087e28e5197bb7d8a4db91867bdc1a3ae5f6796e504ad9ac8b72347a1407361528fb7b9d9019654ee8f6e640ea194cf9e0e89
|
data/lib/forest_liana/engine.rb
CHANGED
@@ -25,46 +25,48 @@ module ForestLiana
|
|
25
25
|
model.try(:table_exists?)
|
26
26
|
end
|
27
27
|
|
28
|
-
# Monkey patch the find_serializer_class_name method to specify the
|
29
|
-
# serializer to use.
|
28
|
+
# Monkey patch the find_serializer_class_name method to specify the
|
29
|
+
# good serializer to use.
|
30
30
|
JSONAPI::Serializer.class_eval do
|
31
31
|
def self.find_serializer_class_name(obj)
|
32
32
|
SerializerFactory.get_serializer_name(obj.class)
|
33
33
|
end
|
34
34
|
end
|
35
|
-
end
|
36
35
|
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
if ForestLiana.jwt_signing_key
|
37
|
+
forest_url = ENV['FOREST_URL'] ||
|
38
|
+
'https://forestadmin-server.herokuapp.com';
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
apimaps = []
|
41
|
+
SchemaUtils.tables_names.map do |table_name|
|
42
|
+
model = SchemaUtils.find_model_from_table_name(table_name)
|
43
|
+
if model.try(:table_exists?)
|
44
|
+
apimaps << SchemaAdapter.new(model).perform
|
45
|
+
end
|
46
|
+
end
|
46
47
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
48
|
+
liana_version = Gem::Specification.find_by_name('forest_liana')
|
49
|
+
.version.to_s
|
50
|
+
json = JSONAPI::Serializer.serialize(apimaps, {
|
51
|
+
is_collection: true,
|
52
|
+
meta: { liana: 'forest-rails', liana_version: liana_version }
|
53
|
+
})
|
53
54
|
|
54
55
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
56
|
+
uri = URI.parse("#{forest_url}/forest/apimaps")
|
57
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
58
|
+
http.use_ssl = true if forest_url.start_with?('https')
|
59
|
+
http.start do |client|
|
60
|
+
request = Net::HTTP::Post.new(uri.path)
|
61
|
+
request.body = json.to_json
|
62
|
+
request['Content-Type'] = 'application/json'
|
63
|
+
request['forest-secret-key'] = ForestLiana.jwt_signing_key
|
64
|
+
response = client.request(request)
|
64
65
|
|
65
|
-
|
66
|
-
|
67
|
-
|
66
|
+
if response.is_a?(Net::HTTPNotFound)
|
67
|
+
logger.warn "Forest cannot find your project secret key. " \
|
68
|
+
"Please, run `rails g forest_liana:install`."
|
69
|
+
end
|
68
70
|
end
|
69
71
|
end
|
70
72
|
end
|
data/lib/forest_liana/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forest_liana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sandro Munda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|