blueprint-api-rails 0.2.2 → 0.2.3
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/blueprint/api/rails.rb +17 -8
- data/lib/blueprint/api/rails/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: 7d8f08fc6a6a16a012f97f982ce8242f8910ff19
|
4
|
+
data.tar.gz: b0d2f3ada82b8565ad8cf11a455ddf5293a9df60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1752120fbf82f5c3dc59aa472af6353888b624d632850929e09d5fc6e7ecebdafee092d55228f30939fd5301eda79061d6b0209a7614440e7b1cd2b7961956c0
|
7
|
+
data.tar.gz: 53024cf284cbbc36d52179fd59cdb52c57296a4b0301bf11465edcf166cc155edbb8dfdad68b1a0c6dc23c3f95e087c915be04734f8894f7eee92b4c583c0099
|
data/lib/blueprint/api/rails.rb
CHANGED
@@ -18,6 +18,8 @@ module Blueprint
|
|
18
18
|
DESCRIBE_ELEMENT = 'describe-element'
|
19
19
|
DESCRIBE_CONCEPT = 'describe-concept'
|
20
20
|
|
21
|
+
CONTAINS = 'contains'
|
22
|
+
|
21
23
|
# allow users to set the API key
|
22
24
|
def self.set_api_key api_key
|
23
25
|
@api_key = api_key
|
@@ -104,8 +106,7 @@ module Blueprint
|
|
104
106
|
|
105
107
|
# send the controllers to Blueprint
|
106
108
|
controllers.each { |c|
|
107
|
-
self.element(c)
|
108
|
-
# self.log nil, nil, nil, c
|
109
|
+
self.element(c) # register the element
|
109
110
|
}
|
110
111
|
|
111
112
|
# now scan for models
|
@@ -116,8 +117,7 @@ module Blueprint
|
|
116
117
|
p "Found #{models.length} models - sending to Blueprint"
|
117
118
|
|
118
119
|
models.each { |m|
|
119
|
-
self.concept(m)
|
120
|
-
# self.log nil, nil, m
|
120
|
+
self.concept(m) # register the concept
|
121
121
|
}
|
122
122
|
|
123
123
|
p 'Scan complete'
|
@@ -190,7 +190,7 @@ module Blueprint
|
|
190
190
|
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
|
191
191
|
end
|
192
192
|
|
193
|
-
# we register the structural element immediately (so that it appears on the
|
193
|
+
# we register the structural element immediately (so that it appears on the structure even though it has no description / messages)
|
194
194
|
self.send DESCRIBE_ELEMENT,
|
195
195
|
{
|
196
196
|
:name => @name
|
@@ -205,7 +205,16 @@ module Blueprint
|
|
205
205
|
:description => description,
|
206
206
|
:stereotype => stereotype
|
207
207
|
}
|
208
|
-
|
208
|
+
self
|
209
|
+
end
|
210
|
+
|
211
|
+
def contains(constituent)
|
212
|
+
self.send CONTAINS,
|
213
|
+
{
|
214
|
+
:parent => @name,
|
215
|
+
:constituent => constituent
|
216
|
+
}
|
217
|
+
self
|
209
218
|
end
|
210
219
|
|
211
220
|
end
|
@@ -224,7 +233,7 @@ module Blueprint
|
|
224
233
|
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
|
225
234
|
end
|
226
235
|
|
227
|
-
# we register the concept immediately (so that it appears
|
236
|
+
# we register the concept immediately (so that it appears even though it has no description / messages)
|
228
237
|
self.send DESCRIBE_CONCEPT,
|
229
238
|
{
|
230
239
|
:name => @name
|
@@ -239,7 +248,7 @@ module Blueprint
|
|
239
248
|
:description => description,
|
240
249
|
:stereotype => stereotype
|
241
250
|
}
|
242
|
-
|
251
|
+
self
|
243
252
|
end
|
244
253
|
|
245
254
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blueprint-api-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- benjii
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|