Skip to content
This repository was archived by the owner on May 9, 2021. It is now read-only.

jvatic/static-sprockets-tent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

static-sprockets-tent

Tent authentication component for static-sprockets.

Usage

# Gemfile
gem 'static-sprockets', :git => 'git://github.com/jvatic/static-sprockets.git', :branch => 'master'
gem 'static-sprockets-tent', :git => 'git://github.com/jvatic/static-sprockets-tent.git', :branch => 'master', :require => false
# config.rb
require 'static-sprockets'
StaticSprockets.configure(
  :asset_roots => ["./assets"],
  :asset_types => %w( javascripts stylesheets ),
  :layout => "./layout.html.erb",
  :layout_output_name => 'application.html',
  :output_dir => "./build",
  :url => ENV['URL'], # redirect_uri is {url}/auth/tent/callback
  :tent_config => {
    :name => "My Tent App",
    :description => "Description of my Tent app",
    :display_url => "Display URL for my Tent app",
    :read_types => %w(), # Array of post types my app needs read-only access to
    :write_types => %w(), # Array of post types my app needs write access to
    :scopes => %w( permissions ) # Array of scopes my app needs
  },
  :tent_config_db_path => File.join(File.expand_path(File.join(__FILE__, "..")), "db") # directory to store Tent data
)

StaticSprockets.app_config do |app|
  require 'static-sprockets-tent'
  StaticSprocketsTent::App.attach_to_app(app)
end
# config.ru
require 'bundler'
Bundler.require

require './config'

require 'static-sprockets/app'
map '/' do
  use Rack::Session::Cookie,  :key => 'drop.session',
                              :expire_after => 2592000, # 1 month
                              :secret => ENV['SESSION_SECRET'] || SecureRandom.hex
  run StaticSprockets::App.new
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages