user_docs 0.2.0 → 0.3.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: 8a29682463845307876f721711cc7c35fb66b740b57fa04c7a2aae82972db7d1
4
- data.tar.gz: 1cb0f5c6697ad276f401968f4b342da581d81e33f92e468c1c40862e8c59d48e
3
+ metadata.gz: 479708398a4aad02dd98ddb186eef5c936b8838dc2680a9cc7d0a55908238d73
4
+ data.tar.gz: bb388526212fcfc90e4a66d6a37bb1657180f17acec9a1673f1adc393790b27f
5
5
  SHA512:
6
- metadata.gz: f3741fb6d581ea85e6ce3f63ae00ba213c2d452a2af19b1a36b2f6c0eba2b09c36cf34ac87d94c75fe94cc451147cf408930ece29024f61f60f45c9f804a7350
7
- data.tar.gz: ccda61469eaf5bf01c1cbe52c7abbc4aa325a362cd6b5a4ef8351bf1e38da94f75411f820a295eb19565f4022321f3dd8dd04921e1d38ad7e4e09af8da0aca00
6
+ metadata.gz: ad34fca7912ec5bf2be9ff3568a285d32ea9439b161f8feaf4f78c2939c346c6839a3f040096aaaaa23435f1cf8d3b3a331e607cf99a5cb99e7b4aa2e47a6846
7
+ data.tar.gz: 712e73ded00f2231327966f3bddcb7cae93af8783ad5e43c2e05d2fbca930bdbc6ebb567c7d085f836ed110860fbd868f5a404526ef2917adc5fee9a14cdced2
@@ -1,6 +1,26 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # desc "Explaining what the task does"
4
- # task :user_docs do
5
- # # Task goes here
6
- # end
3
+ namespace :user_docs do
4
+ desc "Build site"
5
+ task build_site: :environment do
6
+ check_installation
7
+
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
+
22
+ # :nocov:
23
+ abort("ERROR: Run 'rails g user_docs:install.'")
24
+ # :nocov:
25
+ end
26
+ end
@@ -60,8 +60,9 @@ module UserDocs
60
60
  def make_version_index
61
61
  directory = "#{Rails.root}/docs/versions/#{version}"
62
62
  FileUtils.mkdir_p directory
63
+ output_file = "#{directory}/index.html"
63
64
  File.write(
64
- "#{directory}/index.html",
65
+ output_file,
65
66
  <<~HTML
66
67
  ---
67
68
  layout: default
@@ -70,6 +71,9 @@ module UserDocs
70
71
  {% include index.html %}
71
72
  HTML
72
73
  )
74
+
75
+ entry_file = Rails.root.join("docs/index.html")
76
+ FileUtils.cp_r(output_file, entry_file, remove_destination: true)
73
77
  end
74
78
  # rubocop:enable Metrics/MethodLength
75
79
 
@@ -1,6 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # :nocov:
3
4
  module UserDocs
5
+ # Extend Rails and/or modify the initialization process.
4
6
  class Railtie < ::Rails::Railtie
7
+ rake_tasks do
8
+ load "tasks/user_docs_tasks.rake"
9
+ end
5
10
  end
6
11
  end
12
+ # :nocov:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UserDocs
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
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.2.0
4
+ version: 0.3.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-19 00:00:00.000000000 Z
11
+ date: 2020-05-20 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