hotdocs 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a04eac67f8afb072c5b6ef87e98bac8316659fe4da338d64b1fdb85b66334fd8
4
- data.tar.gz: 542ea09084b1e53da0657368a3a8b4c559dbf9e0a6305be13f1ae2726ddf04f7
3
+ metadata.gz: 501f05b967f998d7e24a0e432fbea171fb233b1f7d5d7b2049b27443a44edb38
4
+ data.tar.gz: 4653cbbb44269bee42356a2f3c573aadcd15aae070762bac1ff383c11048bdcc
5
5
  SHA512:
6
- metadata.gz: 7b8fea60fa67ca77c4b4655e928429483b0a77779843c64863fce8e8f49dfaba102896e54c1b36151a19ad107bf5540fab6b5663727d791e71db27081acefedd
7
- data.tar.gz: fcbfa4cf654c14cb2eb023c3905399479bf784c1dd349f99ff2357e3d7687f342a230b61eceb5b37c8f8ecf444b8b460608be5af07affeede0186c6707e3a95b
6
+ metadata.gz: c30df6ded2bb0118268cfc6670990bb228932ad0ad87341b92fc4731cef2d461228abaecdb4af57e5e1274ac7a251a5536656334227eccb34475b6687cab7e9a
7
+ data.tar.gz: 71ce42eba20291d80db0346363ba3e51b75adb195469b3a2a6cfe9d3c8062f228c32f74935f27cf0b83257644839fe5ff9cd42b1a778aa2e7309945a925ba917
@@ -1,3 +1,3 @@
1
1
  module Hotdocs
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -1,4 +1,4 @@
1
- def source_paths # used by copy() & template()
1
+ def source_paths # used by copy_file()
2
2
  [ File.expand_path("../..", __dir__) ]
3
3
  end
4
4
 
@@ -60,8 +60,8 @@ create_file(Pathname(destination_root).join("app/views/layouts/hotdocs.html.erb"
60
60
  <%= content_for(:title, "HotDocs") unless content_for?(:title) %>
61
61
  <meta name="viewport" content="width=device-width,initial-scale=1">
62
62
  <%= stylesheet_link_tag "hotdocs/application" %>
63
- <%= stylesheet_link_tag "website" %>
64
- <%= stylesheet_link_tag "rouge" %>
63
+ <%= stylesheet_link_tag "hotdocs/base" %>
64
+ <%= stylesheet_link_tag "hotdocs/rouge" %>
65
65
  <%= javascript_importmap_tags "hotdocs" %>
66
66
  <% end %>
67
67
 
@@ -82,13 +82,16 @@ create_file(Pathname(destination_root).join("app/views/hotdocs/index.html.mderb"
82
82
  <input type="checkbox" id="third"><label for="third"> Maybe read the docs: <a href="https://hotdocsrails.com/" target="_blank">hotdocsrails.com</a></label>
83
83
  FILE
84
84
 
85
- copy_file("app/assets/images/hotdocs/icon.svg", Pathname(destination_root).join("app/assets/images/hotdocs.svg"))
85
+ empty_directory "app/assets/images/hotdocs"
86
+ copy_file("app/assets/images/hotdocs/icon.svg", Pathname(destination_root).join("app/assets/images/hotdocs/hotdocs.svg"))
87
+
88
+ route "get '/hotdocs', to: 'hotdocs#index'"
86
89
 
87
90
  create_file(Pathname(destination_root).join("app/helpers/hotdocs_helper.rb"), <<~FILE)
88
91
  module HotdocsHelper
89
92
  # @return [Logo, nil]
90
93
  def logo
91
- Struct.new(:src, :alt).new(asset_path("hotdocs.svg"), "A humanized and happy hot dog")
94
+ Struct.new(:src, :alt).new(asset_path("hotdocs/hotdocs.svg"), "A humanized and happy hot dog")
92
95
  end
93
96
 
94
97
  def title
@@ -97,7 +100,7 @@ create_file(Pathname(destination_root).join("app/helpers/hotdocs_helper.rb"), <<
97
100
 
98
101
  def nav_left_items(classes)
99
102
  [
100
- active_link_to("Docs", root_path, class: Array(classes))
103
+ active_link_to("Docs", hotdocs_path, class: Array(classes))
101
104
  ]
102
105
  end
103
106
 
@@ -110,7 +113,7 @@ create_file(Pathname(destination_root).join("app/helpers/hotdocs_helper.rb"), <<
110
113
  # { label: "", url: *_path, children: [], expanded: false/true }
111
114
  def menu_items
112
115
  [
113
- { label: "Welcome", url: root_path },
116
+ { label: "Welcome", url: hotdocs_path },
114
117
  ]
115
118
  end
116
119
 
@@ -153,7 +156,9 @@ create_file(Pathname(destination_root).join("app/helpers/hotdocs_helper.rb"), <<
153
156
  end
154
157
  FILE
155
158
 
156
- create_file(Pathname(destination_root).join("app/assets/stylesheets/website.css"), <<~FILE)
159
+ empty_directory "app/assets/stylesheets/hotdocs"
160
+
161
+ create_file(Pathname(destination_root).join("app/assets/stylesheets/hotdocs/base.css"), <<~FILE)
157
162
  :root {
158
163
  --docs-code-background-color: #eee;
159
164
  --docs-code-border-color: #00000022;
@@ -199,7 +204,7 @@ create_file(Pathname(destination_root).join("app/assets/stylesheets/website.css"
199
204
  }
200
205
  FILE
201
206
 
202
- create_file(Pathname(destination_root).join("app/assets/stylesheets/rouge.css"), <<~FILE)
207
+ create_file(Pathname(destination_root).join("app/assets/stylesheets/hotdocs/rouge.css"), <<~FILE)
203
208
  .article {
204
209
  .highlight .hll { background-color: #6e7681 }
205
210
  .highlight { background: #0d1117; color: #e6edf3 }
@@ -291,13 +296,3 @@ if Pathname(destination_root).join(".gitignore").exist?
291
296
  append_to_file(".gitignore", %(\n/app/assets/builds/*\n!/app/assets/builds/.keep\n))
292
297
  append_to_file(".gitignore", %(\n/node_modules/\n))
293
298
  end
294
-
295
- routes_path = Pathname(destination_root).join("config/routes.rb")
296
- routes = File.readlines(routes_path)
297
- unless routes.grep(/hotdocs#index/).any?
298
- if routes.grep(/^\s*(?!#)root/).any?
299
- route "get '/hotdocs', to: 'hotdocs#index'"
300
- else
301
- route "root to: 'hotdocs#index'"
302
- end
303
- end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotdocs
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
  - 3v0k4