A description of how to run an existing CouchApp on PouchDB in the browser using service workers - without any modifications to existing code being necessary! The best thing is that if service workers aren't available, the CouchApp will still run as normal: that is, online.
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
Sequel.migration do | |
up do | |
run 'CREATE EXTENSION "uuid-ossp"' | |
create_table :products do | |
primary_key :id, {type: :uuid, default: Sequel.function(:uuid_generate_v4)} | |
end | |
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
require File.expand_path('../../../../app/helpers/issue_helper', __FILE__) | |
describe "IssueHelper" do | |
subject do | |
Class.new do | |
include Padrino::Helpers::OutputHelpers | |
include Padrino::Helpers::TagHelpers | |
include Magazineshop::IssueHelper | |
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
module MyApp | |
module CommonViewHelper | |
def self.registered(app) | |
app.helpers Helpers | |
end | |
alias :included :registered | |
module Helpers | |
def page_title(title="") | |
@base_title = "Test Titke" |
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
source "https://rubygems.org" | |
gem 'puma' | |
gem 'sinatra' |