A xUnit family unit testing microframework for Ruby.
Ruby >= 2.2.2
| // Dependency: https://medialab.github.io/artoo/ | |
| // Recommendation: Use the script with Google Chrome DevTools console. | |
| let attendees; | |
| attendees = $('.attendee-item').map(function(_index, attendee) { | |
| const $attendee = $( attendee ); | |
| const $avatar = $attendee.find('a.avatar'); | |
| const image = $avatar.css('background-image').match(/"(.*)"/i)[1]; |
| /* | |
| // https://www.w3schools.com/tags/default.asp | |
| JSON.stringify( | |
| Array.prototype.slice.call( | |
| document.querySelectorAll('.w3-table-all tr') | |
| ) | |
| .map(tr => tr.querySelector('td')) | |
| .filter(n => !!n) | |
| .map(n => n.innerText) | |
| ) |
| module LazyLogger | |
| extend self | |
| attr_accessor :output | |
| def log(&callback) | |
| @log_actions ||= [] | |
| @log_actions << callback | |
| end |
| module Foo | |
| A = 1 | |
| B = 2 | |
| def a1 | |
| A | |
| end | |
| def b1 | |
| B |
Development dependencies:
Features:
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>jQuery.behavior</title> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| </head> | |
| <body> | |
| <a href="01.html">01</a> | <a href="02.html">02</a> | <a href="03.html">03</a> | <a href="04.html">04</a> | <a href="05.html">05</a> |
| # Runtime dependency: | |
| # gem install bundler --no-ri --no-rdoc | |
| # How to run: | |
| # ruby example_1.rb | |
| require "bundler/inline" | |
| gemfile do | |
| source "https://rubygems.org" |
| ArgAsNumber = -> (args) do | |
| -> key { args[key].to_f } | |
| end | |
| CalculateTaskArgumentsWith = -> (operator) do | |
| -> (task, args) do | |
| arg_as_number = ArgAsNumber.(args) | |
| puts [:a, :b].map(&arg_as_number).reduce(&operator) |