From 1951e3ea02433c9646f76f0829944324e3a24a04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A9=D0=B5=D0=B3=D0=BB=D0=BE=D0=B2=20=D0=90=D1=80=D1=82?= =?UTF-8?q?=D1=83=D1=80?= Date: Mon, 8 Jan 2018 16:38:55 +0300 Subject: [PATCH] Change extension for Markdown from .markdown to .md --- .gitignore | 1 + features/markdown_documentation.feature | 28 +++++++++---------- .../views/markdown_example.rb | 2 +- .../writers/markdown_writer.rb | 2 +- spec/writers/markdown_writer_spec.rb | 2 +- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index a0190963..473211c6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +doc tmp .rvmrc .ruby-version diff --git a/features/markdown_documentation.feature b/features/markdown_documentation.feature index a6cf4957..d77e10bd 100644 --- a/features/markdown_documentation.feature +++ b/features/markdown_documentation.feature @@ -146,7 +146,7 @@ Feature: Generate Markdown documentation from test examples And the exit status should be 0 Scenario: Index file should look like we expect - Then the file "doc/api/index.markdown" should contain exactly: + Then the file "doc/api/index.md" should contain exactly: """ # Example API Example API Description @@ -155,19 +155,19 @@ Feature: Generate Markdown documentation from test examples Getting help - * [Getting welcome message](help/getting_welcome_message.markdown) + * [Getting welcome message](help/getting_welcome_message.md) ## Orders - * [Creating an order](orders/creating_an_order.markdown) - * [Deleting an order](orders/deleting_an_order.markdown) - * [Getting a list of orders](orders/getting_a_list_of_orders.markdown) - * [Getting a specific order](orders/getting_a_specific_order.markdown) - * [Updating an order](orders/updating_an_order.markdown) + * [Creating an order](orders/creating_an_order.md) + * [Deleting an order](orders/deleting_an_order.md) + * [Getting a list of orders](orders/getting_a_list_of_orders.md) + * [Getting a specific order](orders/getting_a_specific_order.md) + * [Updating an order](orders/updating_an_order.md) """ Scenario: Example 'Getting a list of orders' file should look like we expect - Then the file "doc/api/orders/getting_a_list_of_orders.markdown" should contain exactly: + Then the file "doc/api/orders/getting_a_list_of_orders.md" should contain exactly: """ # Orders API @@ -222,7 +222,7 @@ Feature: Generate Markdown documentation from test examples """ Scenario: Example 'Creating an order' file should look like we expect - Then the file "doc/api/orders/creating_an_order.markdown" should contain exactly: + Then the file "doc/api/orders/creating_an_order.md" should contain exactly: """ # Orders API @@ -266,16 +266,16 @@ Feature: Generate Markdown documentation from test examples """ Scenario: Example 'Deleting an order' file should be created - Then a file named "doc/api/orders/deleting_an_order.markdown" should exist + Then a file named "doc/api/orders/deleting_an_order.md" should exist Scenario: Example 'Getting a list of orders' file should be created - Then a file named "doc/api/orders/getting_a_list_of_orders.markdown" should exist + Then a file named "doc/api/orders/getting_a_list_of_orders.md" should exist Scenario: Example 'Getting a specific order' file should be created - Then a file named "doc/api/orders/getting_a_specific_order.markdown" should exist + Then a file named "doc/api/orders/getting_a_specific_order.md" should exist Scenario: Example 'Updating an order' file should be created - Then a file named "doc/api/orders/updating_an_order.markdown" should exist + Then a file named "doc/api/orders/updating_an_order.md" should exist Scenario: Example 'Getting welcome message' file should be created - Then a file named "doc/api/help/getting_welcome_message.markdown" should exist + Then a file named "doc/api/help/getting_welcome_message.md" should exist diff --git a/lib/rspec_api_documentation/views/markdown_example.rb b/lib/rspec_api_documentation/views/markdown_example.rb index 3976dd9b..db16ea98 100644 --- a/lib/rspec_api_documentation/views/markdown_example.rb +++ b/lib/rspec_api_documentation/views/markdown_example.rb @@ -1,7 +1,7 @@ module RspecApiDocumentation module Views class MarkdownExample < MarkupExample - EXTENSION = 'markdown' + EXTENSION = 'md' def initialize(example, configuration) super diff --git a/lib/rspec_api_documentation/writers/markdown_writer.rb b/lib/rspec_api_documentation/writers/markdown_writer.rb index a4231cbf..9b636c56 100644 --- a/lib/rspec_api_documentation/writers/markdown_writer.rb +++ b/lib/rspec_api_documentation/writers/markdown_writer.rb @@ -1,7 +1,7 @@ module RspecApiDocumentation module Writers class MarkdownWriter < GeneralMarkupWriter - EXTENSION = 'markdown' + EXTENSION = 'md' def markup_index_class RspecApiDocumentation::Views::MarkdownIndex diff --git a/spec/writers/markdown_writer_spec.rb b/spec/writers/markdown_writer_spec.rb index 95950898..799336ee 100644 --- a/spec/writers/markdown_writer_spec.rb +++ b/spec/writers/markdown_writer_spec.rb @@ -26,7 +26,7 @@ FileUtils.mkdir_p(configuration.docs_dir) writer.write - index_file = File.join(configuration.docs_dir, "index.markdown") + index_file = File.join(configuration.docs_dir, "index.md") expect(File.exists?(index_file)).to be_truthy end end