Skip to content

Commit

Permalink
Revert "move it out of previews folder"
Browse files Browse the repository at this point in the history
This reverts commit 3ebf573.
  • Loading branch information
jonrohan committed Jul 27, 2022
1 parent 1f2c6e0 commit 0e859e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ demo/app/assets/stylesheets/primer.css
# Generated by lib/tasks/docs.rake
/.yardoc
/doc
test/preview_docs/
test/previews/primer/docs/
lookbook/app/assets/builds/
docs/content/adr/
docs/content/components/
Expand Down
6 changes: 3 additions & 3 deletions lib/tasks/docs.rake
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ namespace :docs do
task :preview do
registry = generate_yard_registry

FileUtils.rm_rf("test/preview_docs/")
FileUtils.rm_rf("test/previews/primer/docs/")

components = Primer::Component.descendants

Expand All @@ -373,7 +373,7 @@ namespace :docs do

yard_example_tags = initialize_method.tags(:example)

path = Pathname.new("test/preview_docs/#{short_name.underscore}_preview.rb")
path = Pathname.new("test/previews/primer/docs/#{short_name.underscore}_preview.rb")
path.dirname.mkdir unless path.dirname.exist?

File.open(path, "w") do |f|
Expand All @@ -386,7 +386,7 @@ namespace :docs do
method_name = name.split("|").first.downcase.parameterize.underscore
f.puts(" def #{method_name}; end")
f.puts unless index == yard_example_tags.size - 1
path = Pathname.new("test/preview_docs/#{short_name.underscore}_preview/#{method_name}.html.erb")
path = Pathname.new("test/previews/primer/docs/#{short_name.underscore}_preview/#{method_name}.html.erb")
path.dirname.mkdir unless path.dirname.exist?
File.open(path, "w") do |view_file|
view_file.puts(code.to_s)
Expand Down

0 comments on commit 0e859e1

Please sign in to comment.