station 0.0.118 → 0.0.119

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
  SHA256:
3
- metadata.gz: 25755e3c43da4163dab4f1cf4a1967b544f4d1d2a57e8d15594400d6684e5d6d
4
- data.tar.gz: d13ed08a5c4e1dcdb6c533f0cead6421e51cac65354373a7c039f752b337ec08
3
+ metadata.gz: 00fd57efc12156e2204fe6100b16d6d1e7fa82d644424f94642bc438438da3a0
4
+ data.tar.gz: 6135e50832b1f1b7c274f6fa36913b6de82c34d625aac6b2957a378a5c137f3e
5
5
  SHA512:
6
- metadata.gz: 1bc45e9f780bd12fecc0104f5c261ec279a9f8d44636588208aaa7f59d7a83137e81f240597e11645aac565374d2018896823fc9c2b7ea852efc844192df74ac
7
- data.tar.gz: 3aa3de175695e4e6fa0473397d18a75011898123b7218067cffc240c5efcf7f37b9b7c9cd14acf04c3ee4d55142fb94ad5819ba3c6826d0e14afd3d0b58c7314
6
+ metadata.gz: 4ae2cbd84a39b427d5a1eb5e4f85ecb613226ca14e2f10a09ef11a9ec14ff226737c43e4e1d3758267b6be65b0dd522bf481fe41fd5626cc41530b204212e5e9
7
+ data.tar.gz: 5ee3f6fd92082f55fcb2ebce0238376707d194473f08862268c0117470eb7e81d9c34c3a8d6013386061265ad7cca03bcfe6963fea9a93fbd4b7b30ae29c43b2
@@ -139,7 +139,7 @@ gem 'sassc-rails', '~> 2.1'
139
139
  gem 'gmaps4rails', '2.1.2'
140
140
 
141
141
  # Create beautiful JavaScript charts with one line of Ruby
142
- gem 'chartkick', '3.4.2'
142
+ gem 'chartkick', '~> 4.0'
143
143
 
144
144
  group :development, :test do
145
145
  gem 'awesome_print'
@@ -22,40 +22,40 @@ GIT
22
22
  GEM
23
23
  remote: https://rubygems.org/
24
24
  specs:
25
- actioncable (6.1.3)
26
- actionpack (= 6.1.3)
27
- activesupport (= 6.1.3)
25
+ actioncable (6.1.3.1)
26
+ actionpack (= 6.1.3.1)
27
+ activesupport (= 6.1.3.1)
28
28
  nio4r (~> 2.0)
29
29
  websocket-driver (>= 0.6.1)
30
- actionmailbox (6.1.3)
31
- actionpack (= 6.1.3)
32
- activejob (= 6.1.3)
33
- activerecord (= 6.1.3)
34
- activestorage (= 6.1.3)
35
- activesupport (= 6.1.3)
30
+ actionmailbox (6.1.3.1)
31
+ actionpack (= 6.1.3.1)
32
+ activejob (= 6.1.3.1)
33
+ activerecord (= 6.1.3.1)
34
+ activestorage (= 6.1.3.1)
35
+ activesupport (= 6.1.3.1)
36
36
  mail (>= 2.7.1)
37
- actionmailer (6.1.3)
38
- actionpack (= 6.1.3)
39
- actionview (= 6.1.3)
40
- activejob (= 6.1.3)
41
- activesupport (= 6.1.3)
37
+ actionmailer (6.1.3.1)
38
+ actionpack (= 6.1.3.1)
39
+ actionview (= 6.1.3.1)
40
+ activejob (= 6.1.3.1)
41
+ activesupport (= 6.1.3.1)
42
42
  mail (~> 2.5, >= 2.5.4)
43
43
  rails-dom-testing (~> 2.0)
44
- actionpack (6.1.3)
45
- actionview (= 6.1.3)
46
- activesupport (= 6.1.3)
44
+ actionpack (6.1.3.1)
45
+ actionview (= 6.1.3.1)
46
+ activesupport (= 6.1.3.1)
47
47
  rack (~> 2.0, >= 2.0.9)
48
48
  rack-test (>= 0.6.3)
49
49
  rails-dom-testing (~> 2.0)
50
50
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
51
- actiontext (6.1.3)
52
- actionpack (= 6.1.3)
53
- activerecord (= 6.1.3)
54
- activestorage (= 6.1.3)
55
- activesupport (= 6.1.3)
51
+ actiontext (6.1.3.1)
52
+ actionpack (= 6.1.3.1)
53
+ activerecord (= 6.1.3.1)
54
+ activestorage (= 6.1.3.1)
55
+ activesupport (= 6.1.3.1)
56
56
  nokogiri (>= 1.8.5)
57
- actionview (6.1.3)
58
- activesupport (= 6.1.3)
57
+ actionview (6.1.3.1)
58
+ activesupport (= 6.1.3.1)
59
59
  builder (~> 3.1)
60
60
  erubi (~> 1.4)
61
61
  rails-dom-testing (~> 2.0)
@@ -69,22 +69,22 @@ GEM
69
69
  kaminari (~> 1.0, >= 1.2.1)
70
70
  railties (>= 5.2, < 6.2)
71
71
  ransack (~> 2.1, >= 2.1.1)
72
- activejob (6.1.3)
73
- activesupport (= 6.1.3)
72
+ activejob (6.1.3.1)
73
+ activesupport (= 6.1.3.1)
74
74
  globalid (>= 0.3.6)
75
- activemodel (6.1.3)
76
- activesupport (= 6.1.3)
77
- activerecord (6.1.3)
78
- activemodel (= 6.1.3)
79
- activesupport (= 6.1.3)
80
- activestorage (6.1.3)
81
- actionpack (= 6.1.3)
82
- activejob (= 6.1.3)
83
- activerecord (= 6.1.3)
84
- activesupport (= 6.1.3)
85
- marcel (~> 0.3.1)
86
- mimemagic (~> 0.3.2)
87
- activesupport (6.1.3)
75
+ activemodel (6.1.3.1)
76
+ activesupport (= 6.1.3.1)
77
+ activerecord (6.1.3.1)
78
+ activemodel (= 6.1.3.1)
79
+ activesupport (= 6.1.3.1)
80
+ activestorage (6.1.3.1)
81
+ actionpack (= 6.1.3.1)
82
+ activejob (= 6.1.3.1)
83
+ activerecord (= 6.1.3.1)
84
+ activesupport (= 6.1.3.1)
85
+ marcel (~> 1.0.0)
86
+ mini_mime (~> 1.0.2)
87
+ activesupport (6.1.3.1)
88
88
  concurrent-ruby (~> 1.0, >= 1.0.2)
89
89
  i18n (>= 1.6, < 2)
90
90
  minitest (>= 5.1)
@@ -130,7 +130,7 @@ GEM
130
130
  rack-test (>= 0.6.3)
131
131
  regexp_parser (>= 1.5, < 3.0)
132
132
  xpath (~> 3.2)
133
- chartkick (3.4.2)
133
+ chartkick (4.0.2)
134
134
  coderay (1.1.3)
135
135
  coffee-rails (5.0.0)
136
136
  coffee-script (>= 2.2.0)
@@ -289,16 +289,17 @@ GEM
289
289
  lumberjack (1.2.8)
290
290
  mail (2.7.1)
291
291
  mini_mime (>= 0.1.1)
292
- marcel (0.3.3)
293
- mimemagic (~> 0.3.2)
292
+ marcel (1.0.0)
294
293
  method_source (1.0.0)
295
294
  mime-types (3.3.1)
296
295
  mime-types-data (~> 3.2015)
297
296
  mime-types-data (3.2021.0212)
298
- mimemagic (0.3.6)
299
- mini_mime (1.0.2)
297
+ mimemagic (0.4.3)
298
+ nokogiri (~> 1)
299
+ rake
300
+ mini_mime (1.0.3)
300
301
  mini_portile2 (2.5.0)
301
- minitest (5.14.3)
302
+ minitest (5.14.4)
302
303
  msgpack (1.4.2)
303
304
  msgpack (1.4.2-java)
304
305
  multi_json (1.15.0)
@@ -325,7 +326,7 @@ GEM
325
326
  sass (~> 3.1)
326
327
  shotgun (~> 0.9)
327
328
  sinatra (~> 2.0)
328
- nexmo_markdown_renderer (0.9.0)
329
+ nexmo_markdown_renderer (0.9.1)
329
330
  actionview (~> 6.0)
330
331
  activemodel (~> 6.0)
331
332
  banzai (~> 0.1.2)
@@ -333,16 +334,16 @@ GEM
333
334
  nokogiri (~> 1.10)
334
335
  redcarpet (~> 3.4)
335
336
  rouge (~> 2.0.7)
336
- nio4r (2.5.5)
337
- nio4r (2.5.5-java)
338
- nokogiri (1.11.1)
337
+ nio4r (2.5.7)
338
+ nio4r (2.5.7-java)
339
+ nokogiri (1.11.2)
339
340
  mini_portile2 (~> 2.5.0)
340
341
  racc (~> 1.4)
341
- nokogiri (1.11.1-java)
342
+ nokogiri (1.11.2-java)
342
343
  racc (~> 1.4)
343
- nokogiri (1.11.1-x64-mingw32)
344
+ nokogiri (1.11.2-x64-mingw32)
344
345
  racc (~> 1.4)
345
- nokogiri (1.11.1-x86-mingw32)
346
+ nokogiri (1.11.2-x86-mingw32)
346
347
  racc (~> 1.4)
347
348
  notiffany (0.1.3)
348
349
  nenv (~> 0.1)
@@ -385,29 +386,29 @@ GEM
385
386
  rack
386
387
  rack-test (1.1.0)
387
388
  rack (>= 1.0, < 3)
388
- rails (6.1.3)
389
- actioncable (= 6.1.3)
390
- actionmailbox (= 6.1.3)
391
- actionmailer (= 6.1.3)
392
- actionpack (= 6.1.3)
393
- actiontext (= 6.1.3)
394
- actionview (= 6.1.3)
395
- activejob (= 6.1.3)
396
- activemodel (= 6.1.3)
397
- activerecord (= 6.1.3)
398
- activestorage (= 6.1.3)
399
- activesupport (= 6.1.3)
389
+ rails (6.1.3.1)
390
+ actioncable (= 6.1.3.1)
391
+ actionmailbox (= 6.1.3.1)
392
+ actionmailer (= 6.1.3.1)
393
+ actionpack (= 6.1.3.1)
394
+ actiontext (= 6.1.3.1)
395
+ actionview (= 6.1.3.1)
396
+ activejob (= 6.1.3.1)
397
+ activemodel (= 6.1.3.1)
398
+ activerecord (= 6.1.3.1)
399
+ activestorage (= 6.1.3.1)
400
+ activesupport (= 6.1.3.1)
400
401
  bundler (>= 1.15.0)
401
- railties (= 6.1.3)
402
+ railties (= 6.1.3.1)
402
403
  sprockets-rails (>= 2.0.0)
403
404
  rails-dom-testing (2.0.3)
404
405
  activesupport (>= 4.2.0)
405
406
  nokogiri (>= 1.6)
406
407
  rails-html-sanitizer (1.3.0)
407
408
  loofah (~> 2.3)
408
- railties (6.1.3)
409
- actionpack (= 6.1.3)
410
- activesupport (= 6.1.3)
409
+ railties (6.1.3.1)
410
+ actionpack (= 6.1.3.1)
411
+ activesupport (= 6.1.3.1)
411
412
  method_source
412
413
  rake (>= 0.8.7)
413
414
  thor (~> 1.0)
@@ -617,7 +618,7 @@ DEPENDENCIES
617
618
  bugsnag
618
619
  byebug
619
620
  capybara
620
- chartkick (= 3.4.2)
621
+ chartkick (~> 4.0)
621
622
  coffee-rails (~> 5.0)
622
623
  colorize
623
624
  countries
@@ -9,13 +9,7 @@ class Tutorial::FileLoader
9
9
  end
10
10
 
11
11
  def path
12
- @path ||= Nexmo::Markdown::DocFinder.find(
13
- root: root,
14
- document: doc_name,
15
- language: ::I18n.locale,
16
- code_language: code_language,
17
- format: format
18
- ).path
12
+ @path ||= doc.path
19
13
  end
20
14
 
21
15
  def content
@@ -25,4 +19,14 @@ class Tutorial::FileLoader
25
19
  def yaml
26
20
  @yaml ||= YAML.safe_load(content)
27
21
  end
22
+
23
+ def doc
24
+ @doc ||= Nexmo::Markdown::DocFinder.find(
25
+ root: root,
26
+ document: doc_name,
27
+ language: ::I18n.locale,
28
+ code_language: code_language,
29
+ format: format
30
+ )
31
+ end
28
32
  end
@@ -1,5 +1,7 @@
1
1
  class Tutorial::Task
2
- attr_reader :name, :code_language, :current_step
2
+ extend ActiveModel::Naming
3
+
4
+ attr_reader :name, :code_language, :current_step, :errors
3
5
 
4
6
  delegate :yaml, :path, to: :@file_loader
5
7
 
@@ -10,6 +12,8 @@ class Tutorial::Task
10
12
  @code_language = code_language
11
13
  @current_step = current_step
12
14
  @file_loader = load_file!
15
+
16
+ @errors = ActiveModel::Errors.new(self)
13
17
  end
14
18
 
15
19
  def load_file!
@@ -21,6 +25,14 @@ class Tutorial::Task
21
25
  )
22
26
  end
23
27
 
28
+ def validate!
29
+ unless ['introduction', 'conclusion', 'prerequisites'].include? name
30
+ path.present?
31
+ end
32
+ rescue ::Nexmo::Markdown::DocFinder::MissingDoc => _e
33
+ @errors.add(:name, message: "could not find the file: #{name}")
34
+ end
35
+
24
36
  def active?
25
37
  @name == @current_step
26
38
  end
@@ -55,4 +67,18 @@ class Tutorial::Task
55
67
  def description
56
68
  @description || yaml['description']
57
69
  end
70
+
71
+ # The following methods are needed for validation
72
+
73
+ def read_attribute_for_validation(attr)
74
+ send(attr)
75
+ end
76
+
77
+ def self.human_attribute_name(attr, _options = {})
78
+ attr
79
+ end
80
+
81
+ def self.lookup_ancestors
82
+ [self]
83
+ end
58
84
  end
@@ -102,7 +102,7 @@ Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia od
102
102
 
103
103
  **Inline styles**
104
104
 
105
- Text can be **bold**, _italic_ or **_bold and italic_**. You could use ~~strikethrough~~ but please don't.
105
+ Text can be **bold**, *italic* or ***bold and italic***. You could use ~~strikethrough~~ but please don't.
106
106
 
107
107
  You can define inline `code block` with backticks.
108
108
 
@@ -122,7 +122,7 @@ They auto-magically color when you use verbs like [POST] or [DELETE]
122
122
  |
123
123
  | Here is some hidden content.
124
124
  |
125
- | Markdown _still_ works `here`!
125
+ | Markdown *still* works `here`!
126
126
  |
127
127
  | Nullam id dolor id nibh ultricies vehicula ut id elit. Donec ullamcorper nulla non metus auctor fringilla. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
128
128
 
@@ -131,7 +131,7 @@ They auto-magically color when you use verbs like [POST] or [DELETE]
131
131
  |
132
132
  | Here is some hidden content.
133
133
  |
134
- | Markdown _still_ works `here`!
134
+ | Markdown *still* works `here`!
135
135
  |
136
136
  | Nullam id dolor id nibh ultricies vehicula ut id elit. Donec ullamcorper nulla non metus auctor fringilla. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
137
137
  ````
@@ -19,8 +19,7 @@ require.context('../fonts', true);
19
19
  require.context('@vonagevolta/volta2/images/logos', true)
20
20
  require.context('@vonagevolta/volta2/dist/symbol', true)
21
21
 
22
- require('chartkick');
23
- require('chart.js');
22
+ require('chartkick/chart.js');
24
23
  require('jquery');
25
24
  require('clipboard');
26
25
  require('underscore');
@@ -167,5 +167,27 @@ namespace :ci do
167
167
  end
168
168
  end
169
169
 
170
- task all: %i[verify_pages verify_navigation verify_oas_reference verify_error_urls_resolve check_word_blocklist]
170
+ task validate_tutorials: :environment do
171
+ p 'Validating tutorials...'
172
+ TutorialList.all.each do |tutorial_list_item|
173
+ # Consider every code language and the case when it is nil
174
+ tutorial_list_item.languages.append(nil).each do |code_language|
175
+ tutorial = Tutorial.load(tutorial_list_item.filename, nil, nil, code_language)
176
+
177
+ tasks = tutorial.subtasks
178
+ tasks.map(&:validate!)
179
+
180
+ messages = tasks.map(&:errors).map(&:messages).flatten.reject(&:empty?)
181
+ if messages.any?
182
+ p "Errors for: #{tutorial.path}"
183
+ messages.each do |errors|
184
+ errors.each { |_k, v| p "* #{v.join(',')}".indent(4) }
185
+ end
186
+ end
187
+ end
188
+ end
189
+ p 'Done!'
190
+ end
191
+
192
+ task all: %i[verify_pages verify_navigation verify_oas_reference verify_error_urls_resolve check_word_blocklist validate_tutorials]
171
193
  end
@@ -1,3 +1,3 @@
1
1
  module NexmoDeveloper
2
- VERSION = '0.0.118'.freeze
2
+ VERSION = '0.0.119'.freeze
3
3
  end
data/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "dependencies": {
3
3
  "@activeadmin/activeadmin": "^2.9.0",
4
- "@babel/core": "^7.13.10",
4
+ "@babel/core": "^7.13.16",
5
5
  "@babel/plugin-proposal-class-properties": "^7.12.13",
6
- "@babel/plugin-proposal-decorators": "^7.13.5",
6
+ "@babel/plugin-proposal-decorators": "^7.13.15",
7
7
  "@babel/plugin-proposal-export-namespace-from": "^7.12.13",
8
8
  "@babel/plugin-proposal-function-sent": "^7.12.13",
9
9
  "@babel/plugin-proposal-json-strings": "^7.12.13",
@@ -12,32 +12,32 @@
12
12
  "@babel/plugin-proposal-throw-expressions": "^7.12.13",
13
13
  "@babel/plugin-syntax-dynamic-import": "^7.0.0",
14
14
  "@babel/plugin-syntax-import-meta": "^7.10.4",
15
- "@babel/preset-env": "^7.13.12",
15
+ "@babel/preset-env": "^7.13.15",
16
16
  "@googlemaps/google-maps-services-js": "^3.1.16",
17
17
  "@rails/ujs": "^6.1.3",
18
18
  "@rails/webpacker": "^5.2.1",
19
19
  "@vonagevolta/volta2": "^0.1.6",
20
- "algoliasearch": "^4.8.6",
20
+ "algoliasearch": "^4.9.0",
21
21
  "autoprefixer": "9.8.6",
22
22
  "babel-loader": "^8.2.2",
23
23
  "babel-preset-babili": "^0.1.4",
24
- "chart.js": "^2.9.4",
25
- "chartkick": "^3.2.1",
24
+ "chart.js": "^3.1.1",
25
+ "chartkick": "^4.0.3",
26
26
  "clipboard": "^2.0.8",
27
27
  "coffee-loader": "^1.0.1",
28
28
  "coffee-script": "^1.12.7",
29
29
  "compression-webpack-plugin": "^6.1.1",
30
- "css-loader": "^5.2.0",
30
+ "css-loader": "^5.2.4",
31
31
  "dotenv": "^8.2.0",
32
32
  "fetch-mock": "^9.11.0",
33
33
  "file-loader": "^6.2.0",
34
34
  "foundation-sites": "^6.6.3",
35
35
  "glob": "^7.1.2",
36
- "gsap": "^3.6.0",
36
+ "gsap": "^3.6.1",
37
37
  "https-proxy-agent": "^5.0.0",
38
38
  "jquery": "^3.6.0",
39
- "js-yaml": "4.0.0",
40
- "jsrsasign": "^10.1.13",
39
+ "js-yaml": "4.1.0",
40
+ "jsrsasign": "^10.2.0",
41
41
  "kind-of": "^6.0.3",
42
42
  "lodash": "^4.17.21",
43
43
  "markdown-spellcheck": "^1.3.1",
@@ -55,13 +55,13 @@
55
55
  "serialize-javascript": "^5.0.1",
56
56
  "sha1-file": "^1.0.0",
57
57
  "style-loader": "^2.0.0",
58
- "underscore": "^1.12.1",
58
+ "underscore": "^1.13.1",
59
59
  "vue": "^2.6.12",
60
60
  "vue-loader": "^15.9.6",
61
61
  "vue-template-compiler": "^2.6.12",
62
62
  "webfontloader": "^1.6.28",
63
63
  "webpack": "^4.44.2",
64
- "webpack-manifest-plugin": "^3.1.0",
64
+ "webpack-manifest-plugin": "^3.1.1",
65
65
  "webpack-merge": "^5.7.3",
66
66
  "websocket-extensions": "^0.1.4",
67
67
  "whatwg-fetch": "^3.6.2"
@@ -79,11 +79,11 @@
79
79
  "ssri": "^8.0.1"
80
80
  },
81
81
  "devDependencies": {
82
- "@vue/test-utils": "1.1.3",
82
+ "@vue/test-utils": "1.1.4",
83
83
  "alex": "^9.1.0",
84
84
  "babel-core": "^7.0.0-bridge.0",
85
85
  "babel-jest": "^26.6.3",
86
- "eslint": "^7.22.0",
86
+ "eslint": "^7.24.0",
87
87
  "eslint-config-standard": "^16.0.2",
88
88
  "eslint-plugin-import": "^2.22.1",
89
89
  "eslint-plugin-node": "^11.1.0",
@@ -94,7 +94,7 @@
94
94
  "jest": "^26.6.3",
95
95
  "node-fetch": "^2.6.1",
96
96
  "vue-jest": "^3.0.7",
97
- "webpack-bundle-analyzer": "^4.4.0",
97
+ "webpack-bundle-analyzer": "^4.4.1",
98
98
  "webpack-dev-server": "^3.11.2"
99
99
  },
100
100
  "version": "1.1.0",