user_docs 0.2.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/user_docs/install_generator.rb +5 -5
- data/lib/generators/user_docs/templates/_includes/index.tt +1 -1
- data/lib/generators/user_docs/templates/_layouts/default.tt +6 -6
- data/lib/tasks/user_docs_tasks.rake +16 -4
- data/lib/user_docs/capybara_extension.rb +24 -22
- data/lib/user_docs/railtie.rb +6 -0
- data/lib/user_docs/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f228c6cb3ca1e8592a67e4e0ee6dc8e6a209544606772749a246502176babe6c
|
4
|
+
data.tar.gz: e4ba2e9cda4db54c58b119bcce3dcd10d8885c67e3b624d540b987b16464b0ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb27d9911c94b771df7694184f2d15cd608deba4502e95b4691d6572367739112e982e63095367707fed1f14aa940b615dc50a31cc41532b4d8a263edaa75ef1
|
7
|
+
data.tar.gz: 5dd84a8f0cd6fe49236d5af72fe7189a89cf7f11cec57486acc42d80bed7bf8ba18f729a3ec6ff3c6d8278a896358d48b45560ad55234c37d76591976d1c931f
|
@@ -10,11 +10,11 @@ module UserDocs
|
|
10
10
|
def create
|
11
11
|
check_for_version
|
12
12
|
|
13
|
-
template "index", "docs/index.html"
|
14
|
-
template "_layouts/default", "docs/_layouts/default.html"
|
15
|
-
template "_includes/index", "docs/_includes/index.html"
|
16
|
-
empty_directory "docs/_data/versions"
|
17
|
-
empty_directory "docs/versions"
|
13
|
+
template "index", ".docs/index.html"
|
14
|
+
template "_layouts/default", ".docs/_layouts/default.html"
|
15
|
+
template "_includes/index", ".docs/_includes/index.html"
|
16
|
+
empty_directory ".docs/_data/versions"
|
17
|
+
empty_directory ".docs/versions"
|
18
18
|
end
|
19
19
|
|
20
20
|
private
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
{% assign version_directory = page.version | default: site.version | replace: '.', '_' %}
|
4
4
|
{% for feature in site.data.versions[version_directory] %}
|
5
|
-
<h2 class="mt-3">{{feature[0]}}</h2>
|
5
|
+
<h2 class="mt-3">{{feature[0] | replace: '_', ' ' | capitalize}}</h2>
|
6
6
|
|
7
7
|
<div class="accordian" id="{{feature[0]}}">
|
8
8
|
{% for methods in feature[1] %}
|
@@ -4,13 +4,13 @@
|
|
4
4
|
<head>
|
5
5
|
<meta charset="utf-8">
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
7
|
-
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.
|
7
|
+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
|
8
8
|
<title>End User Documentation</title>
|
9
9
|
</head>
|
10
10
|
|
11
11
|
<body class="container">
|
12
12
|
<nav class="navbar navbar-expand-lg navbar-light bg-light rounded">
|
13
|
-
<a class="navbar-brand" href="index.html">End User Documentation v{{ current_page_version }}</a>
|
13
|
+
<a class="navbar-brand" href="{{ 'index.html' | relative_url }}">End User Documentation v{{ current_page_version }}</a>
|
14
14
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
15
15
|
<span class="navbar-toggler-icon"></span>
|
16
16
|
</button>
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
25
25
|
{% for version in site.data.versions %}
|
26
26
|
{% assign dot_version = version.first | replace: '_', '.' %}
|
27
|
-
{% assign version_path = "/versions/" | append:
|
27
|
+
{% assign version_path = "/versions/" | append: version.first %}
|
28
28
|
{% assign css_class = "" %}
|
29
29
|
{% if dot_version == current_page_version %}
|
30
30
|
{% assign css_class = " active" %}
|
@@ -37,8 +37,8 @@
|
|
37
37
|
</div>
|
38
38
|
</nav>
|
39
39
|
{{ content }}
|
40
|
-
<script src="https://code.jquery.com/jquery-3.
|
41
|
-
<script src="https://
|
42
|
-
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.
|
40
|
+
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
|
41
|
+
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
|
42
|
+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
|
43
43
|
</body>
|
44
44
|
</html>
|
@@ -1,6 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
namespace :user_docs do
|
4
|
+
desc "Build site"
|
5
|
+
task build_site: :environment do
|
6
|
+
procedures_dir = Rails.root.join("docs")
|
7
|
+
hidden_dir = Rails.root.join(".docs")
|
8
|
+
output_dir = Rails.root.join("public/docs")
|
9
|
+
|
10
|
+
Rails::Generators.invoke("user_docs:install") unless Dir.exist?(hidden_dir)
|
11
|
+
|
12
|
+
system("rails test #{procedures_dir}/*")
|
13
|
+
system <<~CMD.squish
|
14
|
+
jekyll build
|
15
|
+
--source #{hidden_dir} --destination #{output_dir} --baseurl /docs
|
16
|
+
CMD
|
17
|
+
end
|
18
|
+
end
|
@@ -11,22 +11,19 @@ module UserDocs
|
|
11
11
|
|
12
12
|
check_installation
|
13
13
|
|
14
|
-
@class_name = class_name.chomp("
|
14
|
+
@class_name = class_name.chomp("Procedure")
|
15
15
|
@method = name.sub("test_", "")
|
16
16
|
make_version_data_directory
|
17
17
|
make_version_index
|
18
|
-
Capybara.save_path =
|
18
|
+
Capybara.save_path =
|
19
|
+
Rails.root.join(".docs/assets/#{version}/#{klass_name}/#{@method}")
|
19
20
|
|
20
21
|
@json = { name: @method.humanize, steps: [] }
|
21
22
|
end
|
22
23
|
|
23
24
|
def before_teardown
|
24
|
-
|
25
|
-
|
26
|
-
"docs", "_data", "versions", version_data_directory_name,
|
27
|
-
@class_name, "#{@method}.json"
|
28
|
-
), @json.to_json
|
29
|
-
)
|
25
|
+
path = ".docs/_data/versions/#{version}/#{klass_name}/#{@method}.json"
|
26
|
+
File.write(Rails.root.join(path), @json.to_json)
|
30
27
|
|
31
28
|
super
|
32
29
|
end
|
@@ -42,34 +39,37 @@ module UserDocs
|
|
42
39
|
end
|
43
40
|
|
44
41
|
def version
|
45
|
-
Rails.application.class.module_parent::VERSION
|
42
|
+
Rails.application.class.module_parent::VERSION.tr(".", "_")
|
46
43
|
end
|
47
44
|
|
48
|
-
def
|
49
|
-
|
45
|
+
def klass_name
|
46
|
+
@class_name.underscore
|
50
47
|
end
|
51
48
|
|
52
49
|
def make_version_data_directory
|
53
|
-
|
54
|
-
|
55
|
-
version_data_directory_name, @class_name)
|
56
|
-
)
|
50
|
+
data_path = Rails.root.join(".docs/_data/versions/#{version}/#{klass_name}")
|
51
|
+
FileUtils.mkdir_p(data_path)
|
57
52
|
end
|
58
53
|
|
59
54
|
# rubocop:disable Metrics/MethodLength
|
60
55
|
def make_version_index
|
61
|
-
directory =
|
62
|
-
|
56
|
+
directory = Rails.root.join(".docs/versions/#{version}")
|
57
|
+
output_file = directory + "index.html"
|
58
|
+
entry_file = Rails.root.join(".docs/index.html")
|
59
|
+
|
60
|
+
FileUtils.mkdir_p(directory)
|
63
61
|
File.write(
|
64
|
-
|
62
|
+
output_file,
|
65
63
|
<<~HTML
|
66
64
|
---
|
67
65
|
layout: default
|
68
|
-
version: #{version}
|
66
|
+
version: #{version.tr!('_', '.')}
|
69
67
|
---
|
70
68
|
{% include index.html %}
|
71
69
|
HTML
|
72
70
|
)
|
71
|
+
|
72
|
+
FileUtils.cp_r(output_file, entry_file, remove_destination: true)
|
73
73
|
end
|
74
74
|
# rubocop:enable Metrics/MethodLength
|
75
75
|
|
@@ -93,10 +93,12 @@ module UserDocs
|
|
93
93
|
@json[:steps] << "Click **OK**."
|
94
94
|
end
|
95
95
|
|
96
|
-
def save_screenshot(image)
|
96
|
+
def save_screenshot(image = Time.now.to_i.to_s)
|
97
|
+
image += ".png"
|
97
98
|
super
|
98
|
-
|
99
|
-
|
99
|
+
|
100
|
+
path = "/docs/assets/#{version}/#{klass_name}/#{@method}/#{image}"
|
101
|
+
@json[:steps] << "<img src='#{path}' class='img-fluid'>"
|
100
102
|
end
|
101
103
|
|
102
104
|
def comment(string)
|
data/lib/user_docs/railtie.rb
CHANGED
data/lib/user_docs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: user_docs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jtopgi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -24,20 +24,34 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 3.32.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: jekyll
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 4.0.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 4.0.1
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rails
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: 6.0.3
|
47
|
+
version: 6.0.3.1
|
34
48
|
type: :runtime
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: 6.0.3
|
54
|
+
version: 6.0.3.1
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: selenium-webdriver
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|