Rnotes is a web server where you can add and watch different release notes of your favorite software.
Uses Ruby with nokogiri to scrap web pages and to retrieve releases notes, as web server uses NodeJs with express.
First you need to clone this repository and install NodeJs and Ruby dependencies, be sure to have installed NodeJs and Ruby with bundler.
# Clone repository
git clone
# Change to rnotes directory
cd rnotes
# Install ruby dependencies
bundle install
# Install NodeJs dependencies
npm install
# start local server
npm start
Rnotes has some thor commands, this commands let you list all available scrappers, run the scrappers and list what files are ready to be shown.
You can see all command with the following commands:
# Show all available commands and what to do
thor list
# Show description and how to use a command
thor help <command>
Rnotes uses provides two classes that can scrap web pages. You can add more scrappers adding more ruby files in the directory /app/releaseNotes/ directory.
Each scrappers should inherit any of the following classes:
This class scraps txt files and gives them a simple HTML structure.
This class is straightforward to use, you only have to inherit this class and add a self.url class variable pointing to the url where the release note you want to scrap is.
# Example of the usage of this class, found in app/releaseNotes/emacs.rb
require_relative '../htmlGenerator/rawTextScraper.rb'
class Emacs < RawTextGenerator
self.url = 'https://www.gnu.org/savannah-checkouts/gnu/emacs/news/NEWS.27.1'
end
This class scraps html files, the scrapped file can be modified using any nokogiri method or procedure.
This class provides the self.htmlCleaner method, which purpose is modify or clean an html file and return this html file with the procedures applied. By default this method return <body>.
# Example of the usage of this class, found in app/releaseNotes/gcc.rb
require_relative '../htmlGenerator/htmlTextScraper'
class Gcc < HtmlTextGenerator
self.url = 'https://gcc.gnu.org/gcc-10/changes.html'
# method modified
def self.htmlCleaner(nodeSet)
nodeSet.css('.copyright').remove
nodeSet
end
end