Browse Source

Merge branch 'master' into default_session_to_base_api_version

Paulo Margarido 4 years ago
parent
commit
dcd7eee049
3 changed files with 16 additions and 2 deletions
  1. 8 1
      Rakefile
  2. 1 1
      docs/index.md
  3. 7 0
      lib/verify_docs.rb

+ 8 - 1
Rakefile

@@ -21,7 +21,14 @@ rescue LoadError
   end
 end
 
-task :default => :test
+task :default => [:test, :verify_docs]
+
+require 'verify_docs'
+task :verify_docs do
+  unless VerifyDocs.call
+    abort("\nWARNING: docs/index.md and README.md no longer have identical content. Please correct this.")
+  end
+end
 
 require 'rdoc/task'
 Rake::RDocTask.new do |rdoc|

+ 1 - 1
docs/index.md

@@ -106,7 +106,7 @@ For a private App you just need to set the base site url as follows:
    ```ruby
    shop_url = "https://#{API_KEY}:#{PASSWORD}@#{SHOP_NAME}.myshopify.com"
    ShopifyAPI::Base.site = shop_url
-   ShopifyAPI::Base.api_version = '<version_name>' # find the latest stable api_version [here](https://shopify.dev/concepts/about-apis/versioning)
+   ShopifyAPI::Base.api_version = '<version_name>' # find the latest stable api_version here: https://shopify.dev/concepts/about-apis/versioning
    ```
 
    That's it; you're done! Next, skip to step 6 and start using the API!

+ 7 - 0
lib/verify_docs.rb

@@ -0,0 +1,7 @@
+class VerifyDocs
+  def self.call
+    readme_content = File.read("README.md").lines[2..-1]
+    docs_content = File.read("docs/index.md").lines[4..-1]
+    readme_content == docs_content
+  end
+end