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.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.gitlab-ci.yml +1 -2
- data/Gemfile.lock +601 -601
- data/README.md +6 -0
- data/lib/prelands_rails/create_simple_source/validate_zip_content/validate_html/html.rb +3 -3
- data/lib/prelands_rails/create_simple_source/validate_zip_content/validate_js.rb +5 -1
- data/lib/prelands_rails/create_simple_source/validate_zip_content.rb +1 -1
- data/lib/prelands_rails/create_simple_source.rb +1 -0
- data/lib/prelands_rails/update_simple_source/validate_zip_content.rb +4 -6
- data/lib/prelands_rails/update_simple_source.rb +1 -0
- data/lib/prelands_rails/validate_simple_source.rb +1 -0
- data/prelands_rails.gemspec +1 -1
- metadata +2 -2
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
|
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 =
|
100
|
+
favicon_rx = /<link.+href="icon.ico">/
|
101
101
|
return if @string[favicon_rx]
|
102
102
|
|
103
|
-
'
|
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
|
-
|
29
|
+
context.warnings += content.errors unless content.valid?
|
26
30
|
end
|
27
31
|
|
28
32
|
on_breach { |breaches| bad_expects breaches }
|
@@ -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
|
-
|
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,
|
data/prelands_rails.gemspec
CHANGED
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.
|
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-
|
11
|
+
date: 2021-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: interactor
|