prelands_rails 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -2,3 +2,9 @@
2
2
 
3
3
  Код, занимающийся валидацией и публикацией прелендов V4.
4
4
 
5
+ # How to publish gem
6
+
7
+ 1. Bump version inside `prelands_rails.gemspec`.
8
+ 2. Make commit & push to `master` branch.
9
+ 3. Then checkout `tags` branch and `git rebase master` (accept theirs if there are any conflicts).
10
+ 4. Then `git push` - and Gitlab CI publish the new version of the gem.
@@ -86,7 +86,7 @@ module PrelandsRails
86
86
  title_rx = /<title>[^<]+<\/title>/
87
87
  return if @string[title_rx]
88
88
 
89
- 'Tag <title> not found.'
89
+ 'Tag `title` not found.'
90
90
  end
91
91
 
92
92
  def check_a_hrefs
@@ -97,10 +97,10 @@ module PrelandsRails
97
97
  end
98
98
 
99
99
  def check_favicon
100
- favicon_rx = '<link rel="shortcut icon" href="icon.ico">'
100
+ favicon_rx = /<link.+href="icon.ico">/
101
101
  return if @string[favicon_rx]
102
102
 
103
- '<link rel="shortcut icon" href="icon.ico"> not found.'
103
+ '`link href="icon.ico"` not found.'
104
104
  end
105
105
 
106
106
  protected
@@ -16,13 +16,17 @@ module PrelandsRails
16
16
  end
17
17
 
18
18
  assures do
19
+ optional(:warnings).maybe(type?: Array)
20
+ end
19
21
 
22
+ before do
23
+ context.warnings ||= []
20
24
  end
21
25
 
22
26
  def act
23
27
  content = context[:files_content]['index.js']
24
28
  content = Js.new(content)
25
- fail! errors: {'index.js' => content.errors} unless content.valid?
29
+ context.warnings += content.errors unless content.valid?
26
30
  end
27
31
 
28
32
  on_breach { |breaches| bad_expects breaches }
@@ -15,7 +15,7 @@ module PrelandsRails
15
15
  end
16
16
 
17
17
  assures do
18
-
18
+ optional(:warnings).maybe(type?: Array)
19
19
  end
20
20
 
21
21
  organize ValidateIncomingFiles, ValidateHtml, ValidateJs, ValidateCss
@@ -34,6 +34,7 @@ module PrelandsRails
34
34
  required(:files_content).value(type?: Hash) # распакованные файлы из архива { file_name[String] => file_content[String], ... }
35
35
  required(:compiled_htmls).value(type?: Hash) # скомпилированные исходники { file_name[String] => compiled_content[String], ... }
36
36
  required(:preland_simple_source).filled
37
+ optional(:warnings).maybe(type?: Array)
37
38
  end
38
39
 
39
40
  organize DetectIncomingLocales,
@@ -13,17 +13,15 @@ module PrelandsRails
13
13
  end
14
14
 
15
15
  assures do
16
-
17
- end
18
-
19
- before do
20
-
16
+ optional(:warnings).maybe(type?: Array)
21
17
  end
22
18
 
23
19
  def act
24
20
  if context.files_content
25
21
  result = ::PrelandsRails::CreateSimpleSource::ValidateZipContent.call context
26
- unless result.success?
22
+ if result.success?
23
+ context.warnings = result.warnings
24
+ else
27
25
  fail!(errors: result.errors)
28
26
  end
29
27
  end
@@ -34,6 +34,7 @@ module PrelandsRails
34
34
  optional(:files_content).maybe(type?: Hash) # распакованные файлы из архива { file_name[String] => file_content[String], ... }
35
35
  optional(:compiled_htmls).value(type?: Hash) # скомпилированные исходники { file_name[String] => compiled_content[String], ... }
36
36
  required(:preland_simple_source).filled
37
+ optional(:warnings).maybe(type?: Array)
37
38
  end
38
39
 
39
40
  organize ::PrelandsRails::CreateSimpleSource::DetectIncomingLocales,
@@ -15,6 +15,7 @@ module PrelandsRails
15
15
  end
16
16
 
17
17
  assures do
18
+ optional(:warnings).maybe(type?: Array)
18
19
  end
19
20
 
20
21
  organize ::PrelandsRails::CreateSimpleSource::DetectIncomingLocales,
@@ -5,7 +5,7 @@ end
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "prelands_rails"
8
- spec.version = "0.1.2"
8
+ spec.version = "0.1.3"
9
9
  spec.authors = ["C80609A"]
10
10
  spec.email = ["c080609a@gmail.com"]
11
11
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prelands_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - C80609A
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-23 00:00:00.000000000 Z
11
+ date: 2021-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: interactor