user_docs 0.3.0 → 0.4.0

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: 479708398a4aad02dd98ddb186eef5c936b8838dc2680a9cc7d0a55908238d73
4
- data.tar.gz: bb388526212fcfc90e4a66d6a37bb1657180f17acec9a1673f1adc393790b27f
3
+ metadata.gz: c4935a454170bcd2e7b1fbf7eb3934d0d1d1f38c20fa18b25cebaf94a1cf03d7
4
+ data.tar.gz: aa2f9d340850464df354c2d50e7ef85ddcb4e9443088a408adfd1b5efd397b4d
5
5
  SHA512:
6
- metadata.gz: ad34fca7912ec5bf2be9ff3568a285d32ea9439b161f8feaf4f78c2939c346c6839a3f040096aaaaa23435f1cf8d3b3a331e607cf99a5cb99e7b4aa2e47a6846
7
- data.tar.gz: 712e73ded00f2231327966f3bddcb7cae93af8783ad5e43c2e05d2fbca930bdbc6ebb567c7d085f836ed110860fbd868f5a404526ef2917adc5fee9a14cdced2
6
+ metadata.gz: c36aaf5904e572dd6b5c6bb6a5a1b4a846405caac6c314810e9ef45553e4c718da4da4157990c102fa60d42185fc1c19c67fe17ad45f8297cc70a3534805f9fb
7
+ data.tar.gz: 1ac4f13c5d3935a4e570d553329a31bede2a6c911b4f4a3815b2b4215ba0c7ae4132b84d6c7afc09a25cbef7fa8e93db70ded6007610934172492051d9dc8e13
@@ -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
@@ -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.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
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>
@@ -37,8 +37,8 @@
37
37
  </div>
38
38
  </nav>
39
39
  {{ content }}
40
- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
41
- <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
42
- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
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>
@@ -3,24 +3,16 @@
3
3
  namespace :user_docs do
4
4
  desc "Build site"
5
5
  task build_site: :environment do
6
- check_installation
7
-
6
+ procedures_dir = Rails.root.join("docs")
7
+ temp_dir = Rails.root.join(".docs")
8
8
  output_dir = Rails.root.join("public/docs")
9
- FileUtils.mkdir_p(output_dir)
10
- system("cd docs && jekyll build -b /docs")
11
- FileUtils.mv(
12
- Dir.glob(Rails.root.join("docs/_site/*")), output_dir, force: true
13
- )
14
- FileUtils.remove_dir(Rails.root.join("docs/_site"))
15
- end
16
-
17
- private
18
-
19
- def check_installation
20
- return if Dir.exist?(Rails.root.join("docs"))
21
9
 
22
- # :nocov:
23
- abort("ERROR: Run 'rails g user_docs:install.'")
24
- # :nocov:
10
+ Rails::Generators.invoke("user_docs:install")
11
+ system("rails test #{procedures_dir}/*")
12
+ system <<~CMD.squish
13
+ jekyll build
14
+ --source #{temp_dir} --destination #{output_dir} --baseurl /docs
15
+ CMD
16
+ FileUtils.rm_rf(Rails.root.join(".docs"))
25
17
  end
26
18
  end
@@ -15,7 +15,8 @@ module UserDocs
15
15
  @method = name.sub("test_", "")
16
16
  make_version_data_directory
17
17
  make_version_index
18
- Capybara.save_path = Rails.root.join("docs", "assets", @class_name, @method)
18
+ Capybara.save_path =
19
+ Rails.root.join(".docs", "assets", @class_name, @method)
19
20
 
20
21
  @json = { name: @method.humanize, steps: [] }
21
22
  end
@@ -23,7 +24,7 @@ module UserDocs
23
24
  def before_teardown
24
25
  File.write(
25
26
  Rails.root.join(
26
- "docs", "_data", "versions", version_data_directory_name,
27
+ ".docs", "_data", "versions", version_data_directory_name,
27
28
  @class_name, "#{@method}.json"
28
29
  ), @json.to_json
29
30
  )
@@ -51,14 +52,14 @@ module UserDocs
51
52
 
52
53
  def make_version_data_directory
53
54
  FileUtils.mkdir_p(
54
- Rails.root.join("docs", "_data", "versions",
55
+ Rails.root.join(".docs", "_data", "versions",
55
56
  version_data_directory_name, @class_name)
56
57
  )
57
58
  end
58
59
 
59
60
  # rubocop:disable Metrics/MethodLength
60
61
  def make_version_index
61
- directory = "#{Rails.root}/docs/versions/#{version}"
62
+ directory = "#{Rails.root}/.docs/versions/#{version}"
62
63
  FileUtils.mkdir_p directory
63
64
  output_file = "#{directory}/index.html"
64
65
  File.write(
@@ -72,7 +73,7 @@ module UserDocs
72
73
  HTML
73
74
  )
74
75
 
75
- entry_file = Rails.root.join("docs/index.html")
76
+ entry_file = Rails.root.join(".docs/index.html")
76
77
  FileUtils.cp_r(output_file, entry_file, remove_destination: true)
77
78
  end
78
79
  # rubocop:enable Metrics/MethodLength
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UserDocs
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: user_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jtopgi