togostanza 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/togostanza/application.rb +6 -5
- data/lib/togostanza/cli.rb +1 -0
- data/lib/togostanza/version.rb +1 -1
- data/templates/provider/config.ru.erb +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a95f963ba13ba30d3915279e89b17980f2347602
|
4
|
+
data.tar.gz: 64ec79fc4621e83f2246d8c96d6b1d05e9d38ad2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63b4d8c3ed61593e06ea3376aefb25ba6453704e4182b584996de29c2695266f01c67d18efb917e5a2643ad9f929b01ea41845e5b7cb66192d578c792c2060d3
|
7
|
+
data.tar.gz: 1e07f6d3304a57356bd2467ce6410246b1c1e62b08586e96cbefb66a0af2612efcfd5ebfddb758e6581c0faf44cd783d2ad4b310145d060fcdcc7249589bd844
|
@@ -1,11 +1,13 @@
|
|
1
1
|
require 'sinatra/base'
|
2
|
+
require 'sinatra/json'
|
2
3
|
require 'sinatra/reloader'
|
3
4
|
require 'haml'
|
4
5
|
|
5
6
|
module TogoStanza
|
6
7
|
class Application < Sinatra::Base
|
7
|
-
set :root,
|
8
|
-
set :haml,
|
8
|
+
set :root, File.expand_path('../../..', __FILE__)
|
9
|
+
set :haml, escape_html: true
|
10
|
+
set :protection, except: [:json_csrf]
|
9
11
|
|
10
12
|
configure :development do
|
11
13
|
register Sinatra::Reloader
|
@@ -28,10 +30,9 @@ module TogoStanza
|
|
28
30
|
end
|
29
31
|
|
30
32
|
get '/:id/resources/:resource_id' do |id, resource_id|
|
31
|
-
content_type :json
|
32
|
-
|
33
33
|
value = Stanza.find(id).new(params).resource(resource_id)
|
34
|
-
|
34
|
+
|
35
|
+
json resource_id => value
|
35
36
|
end
|
36
37
|
|
37
38
|
get '/:id/help' do |id|
|
data/lib/togostanza/cli.rb
CHANGED
data/lib/togostanza/version.rb
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
require 'bundler'
|
2
|
-
|
2
|
+
|
3
|
+
env = ENV['RACK_ENV'] || :development
|
4
|
+
Bundler.require :default, env
|
5
|
+
|
6
|
+
log = open(File.expand_path("../log/#{env}.log", __FILE__), 'a+').tap {|f| f.sync = true }
|
7
|
+
|
8
|
+
use Rack::CommonLogger, log
|
3
9
|
|
4
10
|
map '/stanza/assets' do
|
5
11
|
run TogoStanza.sprockets
|