Module: Customers
Overview
Customers module to configure jekyll’s bundle per website
Constant Summary collapse
- JEKYLL_CONFIG =
'_config.yml'
Instance Method Summary collapse
- #activate ⇒ Object
- #customers_domains ⇒ Object
- #customers_list ⇒ Object
- #deploy_date(customer) ⇒ Object
- #show_last_deploys_dates ⇒ Object
Instance Method Details
#activate ⇒ Object
12 13 14 15 |
# File 'lib/jekyll_theme_marketing/customers.rb', line 12 def activate delete_default_config activate_customers_config(customer_config_path) end |
#customers_domains ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/jekyll_theme_marketing/customers.rb', line 26 def customers_domains domains = [] customers_list.each do |customer| domain = customer .gsub('./_data/customers/', '') .gsub('.yml', '') domains << domain end domains end |
#customers_list ⇒ Object
37 38 39 |
# File 'lib/jekyll_theme_marketing/customers.rb', line 37 def customers_list Dir.glob('./_data/customers/*.yml').to_a.sort end |
#deploy_date(customer) ⇒ Object
41 42 43 44 45 |
# File 'lib/jekyll_theme_marketing/customers.rb', line 41 def deploy_date(customer) page = Nokogiri::HTML(open("https://www.#{customer}")) last_deploy = page.css('img[data-last-deploy]')[0] last_deploy.nil? ? '' : last_deploy['data-last-deploy'].gsub(/ -0.00/, '') end |
#show_last_deploys_dates ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/jekyll_theme_marketing/customers.rb', line 17 def show_last_deploys_dates last_deploys_dates = [] customers_domains.each do |customer| puts "Testing #{customer}" last_deploys_dates << "#{deploy_date(customer)}: #{customer}" end puts last_deploys_dates.sort.reverse end |