Skip to content

Instantly share code, notes, and snippets.

View vladimir-vg's full-sized avatar
🙂

Vladimir Gordeev vladimir-vg

🙂
View GitHub Profile
Welcome, would you like some coffee?
{{#drinks?}}
We can offer some of this:
{{#drinks}}
{{name}}
{{#alcohol?}}
(only if you older 21)
{{/alcohol?}}
{{/drinks}}
---
drinks?: true
drinks: []
---
Welcome, would you like some milk?
We can offer some of this:
---
drinks?: true
drinks:
- { name: wine, alcohol?: true }
- { name: milk }
---
Welcome, would you like some milk?
We can offer some of this:
wine
(only if you older 21)
milk
---
drinks?: true
drinks:
- { name: wine }
- { name: milk, alcohol?: false }
alcohol?: true
---
Welcome, would you like some milk?
We can offer some of this:
wine
(only if you older 21)
milk
---
drinks?: true
drinks: { name: wine, alcohol?: true }
---
Welcome, would you like some milk?
We can offer some of this:
wine
(only if you older 21)
class FooBarVendor::ItemScraper < Scraper
# подключаем самописный DSL для работы с HTML
include Makhno
# присутствие строго одного элемента
one :title,
css: '.product-details .product-content > h1',
# перед manipulate, элемент будет преобразован в значение
value: ->(e) { e.text.strip }