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
| if (typeof jQuery === 'function') { | |
| var oQuery = jQuery.noConflict(true); | |
| } | |
| /*! | |
| * jQuery JavaScript Library v1.7.2 | |
| * http://jquery.com/ | |
| * | |
| * Copyright 2011, John Resig | |
| * Dual licensed under the MIT or GPL Version 2 licenses. |
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
| if (typeof jQuery === 'function') { | |
| var oQuery = jQuery.noConflict(true); | |
| } | |
| /*! | |
| * jQuery JavaScript Library v1.7.2 | |
| * http://jquery.com/ | |
| * | |
| * Copyright 2011, John Resig | |
| * Dual licensed under the MIT or GPL Version 2 licenses. |
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
| if (typeof jQuery === 'function') { | |
| var oQuery = jQuery.noConflict(true); | |
| } | |
| /*! | |
| * jQuery JavaScript Library v1.7.2 | |
| * http://jquery.com/ | |
| * | |
| * Copyright 2011, John Resig | |
| * Dual licensed under the MIT or GPL Version 2 licenses. |
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
| <script id="skyscrpr-config-script"> | |
| var skyscrprSettings={site_id:'17d45be8-e962-11e1-99e6-1231380fc676',}; | |
| </script> | |
| <script> | |
| (function(){ | |
| function async_load(){ | |
| var scr=document.createElement('script'); | |
| scr.type='text/javascript'; | |
| scr.async=true; |
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 publish | |
| html = render_to_string(template: "media_kits/preview", | |
| layout: 'application' ) | |
| cache_page(html, "media_kits/#{@media_kit.publisher_profile.fqdn}") | |
| redirect_to media_kit_path(@media_kit), notice: 'Media Kit Published' | |
| 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
| require 'fileutils' | |
| module Openair | |
| module CachePage | |
| # This methods come from action_pack/cache_page' | |
| # https://github.com/rails/actionpack-page_caching | |
| # We didn't need the whole gem. So I decided to get | |
| # just what we need :) | |
| def cache_page(content, path, extension = '.html', gzip = Zlib::BEST_COMPRESSION) | |
| path = page_cache_path(path, extension) | |
| FileUtils.makedirs(File.dirname(path)) |
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 'rack/utils' | |
| class StaticRack | |
| def call(env) | |
| path = env["SERVER_NAME"] | |
| file, headers = pick_file_and_headers_for_path(path, env) | |
| file_server = ::Rack::File.new(file, headers) | |
| file_server.call(env) | |
| end | |
| private |
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 'rack/utils' | |
| module Openair | |
| class MediaKitStaticRack | |
| def initialize | |
| @middlewares = [:bugsnag] | |
| @middlewares << :errors unless Rails.env.development? | |
| end | |
| def call(env) | |
| @app = load_app |
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 'rack/utils' | |
| class StaticFileServer | |
| def initialize | |
| @middleware_stack = ActionDispatch::MiddlewareStack.new | |
| @middleware_stack.use ActionDispatch::ShowExceptions, show_exception_app unless Rails.env.development? | |
| @middleware_stack.use Bugsnag::Rack | |
| end | |
| def call(env) |
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
| class Engine < Rails::Engine | |
| initializer 'imprenta.controller_methods' do |app| | |
| ActionController::Base.send :include, Imprenta::CachePage | |
| end | |
| end |