Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
= Rind
Rind is a templating engine that turns HTML (and XML) into node trees and allows you to create custom tags or reuse someone else's genius. Rind gives web devs tags to work with and provides the same thing to app devs as an object. This project is just getting started so watch out for sharp corners and unfinished rooms. Enough of that, let's talk about what's done.
== Installation gem install rind
== Come say "Hello".
require 'rubygems' require 'rind'
doc = Rind::Document.new('index.html')
doc.sf('/html/head/title').children.push('Hello World')
puts doc.render!
== Create your own!
One of the great things about Rind is that you can create your own HTML elements and bundle them in modules. Imagine making a module that performs a variety of useful functions on images. For example, it could provide a gallery view that automatically generates thumbnails and paginates. Clicked pics could provide full sized versions of themselves in a lightbox.
Create your custom module.
require 'rind'
module Images class Gallery < Rind::Element attr_accessor :path_to_images
# gallery magic here
...
end
end
App devs treat it like an object.
require 'rind' require 'images'
doc = Rind::Document.new('index.html') doc.sf('/html/body/images:gallery').path_to_images = '/home/me/photos' puts doc.render!
Web devs treat it like a tag.
And just like a regular Ruby module, if you make it available, we can all benefit.
== Mucking with standard HTML
Interested in modifying the behavior of a standard HTML element? Let's say that you want all external links to use rel="nofollow". Rather than remembering to do this every time you can build it into a base namespace.
Create your base module.
require 'rind'
module Core class A < Rind::Html::A def initialize(options={}) super(options) @attributes[:rel] = 'nofollow' if is_external? end
def is_external?
....
end
private :is_external?
end
end
Pass it to the Document as the base_namespace.
require 'rind' require 'core'
doc = Document.new('index.html', :base_namespace => 'core') puts doc.render!
The links in index.html will now have the rel attribute automatically added. GitHub
== The Future? This is an early release. An alpha of sorts. The interface may change before it's all over. Rind needs to help out modules with style sheets, JavaScript libraries, images, querying system/user info, etc. Virtually no time has been spent optimizing the code. More test cases need to be written. I still have a bunch of stuff in my office that needs filing. You get the idea.
FAQs
Unknown package
We found that rind demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.