[ Gemspec ]
This commit is contained in:
parent
7085e69bb6
commit
8dfb642c84
6 changed files with 52 additions and 3 deletions
35
bin/tonton-web
Normal file
35
bin/tonton-web
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
#! /usr/bin/ruby
|
||||||
|
|
||||||
|
require 'sod'
|
||||||
|
|
||||||
|
class New < Sod::Action
|
||||||
|
on "--new", argument: "NAME"
|
||||||
|
|
||||||
|
def call(name)
|
||||||
|
destination_root = Pathname.new name
|
||||||
|
|
||||||
|
destination_root.mkdir
|
||||||
|
|
||||||
|
(destination_root+'modules').mkdir
|
||||||
|
|
||||||
|
gem_root = Pathname.new(__FILE__).parent + '..'
|
||||||
|
|
||||||
|
for source in gem_root.glob('{example/*,*.md}')
|
||||||
|
destination = destination_root + source.basename
|
||||||
|
|
||||||
|
`cp #{source} #{destination}`
|
||||||
|
end
|
||||||
|
|
||||||
|
(destination_root+'views').mkdir
|
||||||
|
|
||||||
|
`cp -r #{gem_root+'views'} #{destination_root}`
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
cli = Sod.new(banner: "TonTon Web 0.0.0: TonTon utilitary for web apps") do
|
||||||
|
on(New)
|
||||||
|
|
||||||
|
on Sod::Prefabs::Actions::Help, self
|
||||||
|
end
|
||||||
|
|
||||||
|
cli.call
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
require 'gollum/app'
|
require 'gollum/app'
|
||||||
require 'sinatra/flash'
|
require 'sinatra/flash'
|
||||||
require "sqlite3"
|
require "sqlite3"
|
||||||
|
require 'tonton_web'
|
||||||
|
|
||||||
class TonTonWeb < Sinatra::Base
|
class TonTonWeb::App < Sinatra::Base
|
||||||
set :host_authorization, { permitted_hosts: ['localhost', 'mytonton.com.br'] }
|
set :host_authorization, { permitted_hosts: ['localhost', 'mytonton.com.br'] }
|
||||||
|
|
||||||
set :sessions, true
|
set :sessions, true
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
require_relative 'tonton_web'
|
require_relative 'app'
|
||||||
|
|
||||||
# Require TonTon modules if you want
|
# Require TonTon modules if you want
|
||||||
|
|
||||||
use Rack::Session::Cookie, key: 'rack.session', secret: ENV.fetch('SESSION_SECRET')
|
use Rack::Session::Cookie, key: 'rack.session', secret: ENV.fetch('SESSION_SECRET')
|
||||||
|
|
||||||
app = Rack::URLMap.new(
|
app = Rack::URLMap.new(
|
||||||
'/' => TonTonWeb.new
|
'/' => TonTonWeb::App.new
|
||||||
# Add TonTon modules here
|
# Add TonTon modules here
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
1
lib/tonton_web.rb
Normal file
1
lib/tonton_web.rb
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
require_relative 'tonton_web/auth'
|
||||||
12
tonton_web.gemspec
Normal file
12
tonton_web.gemspec
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
Gem::Specification.new do |s|
|
||||||
|
s.name = 'tonton_web'
|
||||||
|
s.version = '0.0.0'
|
||||||
|
s.summary = 'TonTon Web app main parts'
|
||||||
|
s.description = 'TonTon Web app main parts'
|
||||||
|
s.authors = ['Mateus Cezário Barreto']
|
||||||
|
s.email = 'mateus.cezario.barreto@gmail.com'
|
||||||
|
s.homepage = 'https://mytonton.com.br'
|
||||||
|
s.license = 'MIT'
|
||||||
|
s.files = Dir.glob('{bin/*,lib/**/*,example/*,*.md,views/*}')
|
||||||
|
s.files.each { |f| if f.include?('bin/') then s.executables << File.basename(f) end }
|
||||||
|
end
|
||||||
Loading…
Add table
Add a link
Reference in a new issue