From 5d6eee60d4e3093f73de105d0a52dcd160ddb005 Mon Sep 17 00:00:00 2001 From: Robbie Marcelo Date: Tue, 20 Jun 2017 16:25:22 +0800 Subject: [PATCH] Prettify indentation of code snippet examples in docs/README --- docs/README.md | 63 ++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/docs/README.md b/docs/README.md index cfb63af..110b5dd 100644 --- a/docs/README.md +++ b/docs/README.md @@ -24,11 +24,10 @@ You can use this guide to work with SSL certificates. # Use this example if you are using a pem file class Client - include HTTParty - - base_uri "https://example.com" - pem File.read("#{File.expand_path('.')}/path/to/certs/cert.pem"), "123456" + include HTTParty + base_uri "https://example.com" + pem File.read("#{File.expand_path('.')}/path/to/certs/cert.pem"), "123456" end ``` @@ -38,11 +37,10 @@ end # Use this example if you are using a pkcs12 file class Client - include HTTParty - - base_uri "https://example.com" - pkcs12 File.read("#{File.expand_path('.')}/path/to/certs/cert.p12"), "123456" + include HTTParty + base_uri "https://example.com" + pkcs12 File.read("#{File.expand_path('.')}/path/to/certs/cert.p12"), "123456" end ``` @@ -52,11 +50,10 @@ end # Use this example if you are using a pkcs12 file class Client - include HTTParty - - base_uri "https://example.com" - ssl_ca_file "#{File.expand_path('.')}/path/to/certs/cert.pem" + include HTTParty + base_uri "https://example.com" + ssl_ca_file "#{File.expand_path('.')}/path/to/certs/cert.pem" end ``` @@ -66,10 +63,10 @@ end # Use this example if you are using a pkcs12 file class Client - include HTTParty - - base_uri "https://example.com" - ssl_ca_path '/path/to/certs' + include HTTParty + + base_uri "https://example.com" + ssl_ca_path '/path/to/certs' end ``` @@ -77,13 +74,13 @@ You can also include this options with the call: ```ruby class Client - include HTTParty - - base_uri "https://example.com" - - def self.fetch - get("/resources", pem: (File.read("#{File.expand_path('.')}/path/to/certs/cert.pem"), "123456") - end + include HTTParty + + base_uri "https://example.com" + + def self.fetch + get("/resources", pem: (File.read("#{File.expand_path('.')}/path/to/certs/cert.pem"), "123456") + end end ``` @@ -92,18 +89,18 @@ end In some cases you may want to skip SSL verification, because the entity that issue the certificate is not a valid one, but you still want to work with it. You can achieve this through: ```ruby -#Skips SSL certificate verification +# Skips SSL certificate verification class Client - include HTTParty + include HTTParty - base_uri "https://example.com" - pem File.read("#{File.expand_path('.')}/path/to/certs/cert.pem"), "123456" - - def self.fetch - get("/resources", verify: false) - # You can also use something like: - # get("resources", verify_peer: false) - end + base_uri "https://example.com" + pem File.read("#{File.expand_path('.')}/path/to/certs/cert.pem"), "123456" + + def self.fetch + get("/resources", verify: false) + # You can also use something like: + # get("resources", verify_peer: false) + end end ``` \ No newline at end of file