This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'csv' | |
| require 'nokogiri' | |
| CSV.open('slug_with_image.csv', 'w') do |csv| | |
| CSV.foreach('blog_file.csv', headers: true) do |row| | |
| content_html = Nokogiri::HTML(row['content']) | |
| content_html.css('img').each do |img| | |
| csv << [img['src'], row['slug']] | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def update_nested_templates(path) | |
| if File.directory?(path) | |
| Dir.foreach(path) do |filename| | |
| next if %w(. ..).include?(filename) | |
| update_nested_templates(File.absolute_path(filename, path)) | |
| end | |
| else | |
| update_template!(path) | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require "json" | |
| module AFITop100 | |
| extend self | |
| WATCHED_FILMS_JSON = File.join(File.dirname(__FILE__), "./watched_films.json").freeze | |
| AFI_TOP_100 = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| remove_file "Gemfile" | |
| run "touch Gemfile" | |
| add_source 'https://rubygems.org' | |
| gem 'bootsnap', require: false | |
| gem "health_check" | |
| gem 'rails', '~> 5.2' | |
| gem 'puma' | |
| gem 'pg' |