-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move default to having
lfx_committee_url
in the front matter
Signed-off-by: John Mertic <jmertic@linuxfoundation.org>
- Loading branch information
Showing
5 changed files
with
58 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require 'json' | ||
require 'net/http' | ||
|
||
module ExternalJSON | ||
class ExternalJSON_tag < Liquid::Tag | ||
def initialize(tag_name, text, tokens) | ||
super | ||
@text = text | ||
end | ||
def render(context) | ||
if /(.+) from url (.+)/.match(@text) | ||
url = context[$2] || $2 | ||
resp = Net::HTTP.get_response(URI(url.strip)) | ||
data = resp.body | ||
context[$1] = JSON data | ||
nil | ||
else | ||
# syntax error | ||
raise ArgumentError, 'ERROR:bad_syntax' | ||
end | ||
end | ||
end | ||
end | ||
|
||
Liquid::Template.register_tag('externalJSON', ExternalJSON::ExternalJSON_tag) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
lfx_committee_url: https://projectadmin.lfx.linuxfoundation.org/project/a0941000002wBz3AAE/collaboration/committees/146d2a4b-d39d-45e6-91a2-20937f4978cf | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
lfx_committee_url: https://projectadmin.lfx.linuxfoundation.org/project/a0941000002wBykAAE/collaboration/committees/40ab4fff-0c3b-4718-91e4-e76b2805f34c | ||
--- | ||
|