This is an automated email from the ASF dual-hosted git repository.

rabbah pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 6453b73  chore: minor Ruby linting and fix end of file (#471)
6453b73 is described below

commit 6453b73ecf0efda1ccf391a2c05cbe723a2413d0
Author: John Bampton <[email protected]>
AuthorDate: Tue Mar 16 00:42:17 2021 +1000

    chore: minor Ruby linting and fix end of file (#471)
---
 Gemfile                         |  8 ++++----
 _includes/code/hello.rb         |  2 +-
 _plugins/remote_file_content.rb | 16 +++++-----------
 3 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/Gemfile b/Gemfile
index 5e761e8..8de00bc 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,4 +1,4 @@
-source "https://rubygems.org";
+source 'https://rubygems.org'
 ruby RUBY_VERSION
 
 # Hello! This is where you manage which Jekyll version is used to run.
@@ -9,10 +9,10 @@ ruby RUBY_VERSION
 #
 # This will help ensure the proper Jekyll version is running.
 # Happy Jekylling!
-gem "jekyll", "3.3.0"
+gem 'jekyll', '3.3.0'
 
 # This is the default theme for new Jekyll sites. You may change this to 
anything you like.
-#gem "minima", "~> 2.0"
+# gem 'minima', '~> 2.0'
 
 # If you want to use GitHub Pages, remove the "gem "jekyll"" above and
 # uncomment the line below. To upgrade, run `bundle update github-pages`.
@@ -20,7 +20,7 @@ gem "jekyll", "3.3.0"
 
 # If you have any plugins, put them here!
 group :jekyll_plugins do
-   gem "jekyll-feed", "~> 0.6"
+  gem 'jekyll-feed', '~> 0.6'
 end
 
 # used to check html on build
diff --git a/_includes/code/hello.rb b/_includes/code/hello.rb
index c53d1e6..8cc6df4 100644
--- a/_includes/code/hello.rb
+++ b/_includes/code/hello.rb
@@ -1,5 +1,5 @@
 def main(params = {})
-  name = params["name"] || "stranger"
+  name = params['name'] || 'stranger'
   greeting = "Hello #{name}!"
   { "greeting": greeting }
 end
diff --git a/_plugins/remote_file_content.rb b/_plugins/remote_file_content.rb
index d42a874..9a4050e 100644
--- a/_plugins/remote_file_content.rb
+++ b/_plugins/remote_file_content.rb
@@ -2,15 +2,13 @@ require 'net/http'
 require 'uri'
 
 module Jekyll
-
   class RemoteFileContent < Liquid::Tag
-
     def initialize(tag_name, markup, tokens)
       url = markup
 
-      puts 'Fetching content of url: ' + url
+      puts "Fetching content of url: #{url}"
 
-      if url =~ URI::regexp
+      if url =~ URI::DEFAULT_PARSER.make_regexp
         @content = fetchContent(url)
       else
         raise 'Invalid URL passed to RemoteFileContent'
@@ -19,12 +17,8 @@ module Jekyll
       super
     end
 
-    def render(context)
-      if @content
-        @content
-      else
-        raise 'Something went wrong in RemoteFileContent'
-      end
+    def render(_context)
+      @content || raise('Something went wrong in RemoteFileContent')
     end
 
     def fetchContent(url)
@@ -33,4 +27,4 @@ module Jekyll
   end
 end
 
-Liquid::Template.register_tag('remotefile', Jekyll::RemoteFileContent)
\ No newline at end of file
+Liquid::Template.register_tag('remotefile', Jekyll::RemoteFileContent)

Reply via email to