ecm-blockchain-api 1.1.0 → 1.1.1
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/Gemfile.lock +2 -2
- data/bin/console +2 -2
- data/lib/ecm-blockchain-api/models/asset_model.rb +15 -3
- data/lib/ecm-blockchain-api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6128eb92afdb48f135ab0f3b506b408f555cf64dff04d4318904d3dd74db3995
|
4
|
+
data.tar.gz: f74df4533c6778aa500fc731a7d2bc3d5f428d19b6cf2c9d9f31f4edd87f8e7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32c331d5738e6d127b4bd5aad45dcbc09388ebed4774efff83a51e21bc320d2a3c9205c6202f2e932a0ae38bf4cb1efd77e45d77ad64947267bd9eaa7033519b
|
7
|
+
data.tar.gz: 0b4a613e1aecf6c4b84b21d9f576c27933f291f6db18f1157bfbb3e2b12500021648a2965e07212bd68c6589185577b8bd5349d746e8dd3fa58bb2a0e9ba0fa4
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
|
4
|
+
ecm-blockchain-api (1.1.0)
|
5
5
|
activemodel (~> 7.0, >= 7.0.4.3)
|
6
6
|
httparty (~> 0.22.0)
|
7
7
|
|
@@ -112,7 +112,7 @@ PLATFORMS
|
|
112
112
|
DEPENDENCIES
|
113
113
|
activemodel (~> 7.0, >= 7.0.4.3)
|
114
114
|
activesupport (~> 7.0, >= 7.0.4.3)
|
115
|
-
|
115
|
+
ecm-blockchain-api!
|
116
116
|
factory_bot
|
117
117
|
faker
|
118
118
|
pry
|
data/bin/console
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require "bundler/setup"
|
5
|
-
require "
|
5
|
+
require "ecm-blockchain-api"
|
6
6
|
|
7
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
8
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,7 +10,7 @@ require "ecm_blockchain_api"
|
|
10
10
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
11
|
# require "pry"
|
12
12
|
# Pry.start
|
13
|
-
ECMBlockchain.base_url = "http://
|
13
|
+
ECMBlockchain.base_url = "http://127.0.0.1:3002/v1"
|
14
14
|
# ECMBlockchain.access_token = ""
|
15
15
|
ECMBlockchain.access_token = "W4nd3rl4nds!"
|
16
16
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'active_model'
|
2
|
+
require 'json'
|
2
3
|
|
3
4
|
module ECMBlockchain
|
4
5
|
class AssetModel
|
@@ -13,8 +14,16 @@ module ECMBlockchain
|
|
13
14
|
class << self
|
14
15
|
def verify(data={})
|
15
16
|
asset = self.new(data)
|
16
|
-
raise ECMBlockchain::
|
17
|
-
|
17
|
+
raise ECMBlockchain::Error.raise_error(
|
18
|
+
OpenStruct.new(
|
19
|
+
code: 422,
|
20
|
+
body: {
|
21
|
+
error: {
|
22
|
+
message: asset.errors.full_messages.first,
|
23
|
+
details: ''
|
24
|
+
}
|
25
|
+
}.to_json
|
26
|
+
)
|
18
27
|
) unless asset.valid?
|
19
28
|
asset
|
20
29
|
end
|
@@ -44,7 +53,10 @@ module ECMBlockchain
|
|
44
53
|
|
45
54
|
def data_file_or_content?
|
46
55
|
unless file.valid? || content.valid?
|
47
|
-
errors.add(:base,
|
56
|
+
errors.add(:base,
|
57
|
+
"file or content error: #{file.errors.full_messages.first || content.errors.full_messages.first ||
|
58
|
+
"Please supply either a file object or content object"}"
|
59
|
+
)
|
48
60
|
end
|
49
61
|
end
|
50
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecm-blockchain-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wardy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|