birt-api 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/birt/api_controller.rb +6 -0
- data/birt-api.gemspec +0 -1
- data/lib/birt/api.rb +29 -1
- data/lib/birt/api/engine.rb +8 -0
- data/lib/birt/api/version.rb +1 -1
- metadata +3 -3
- data/config/routes.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d567b6da4903bf4dcb9fb853f2586a9f1b68287
|
4
|
+
data.tar.gz: fe3cf79026c3583a67b9b3bc0fa4eddf9d30d0df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84c26bf76a46174ace8f7477ecc112d80fd0c9b48d054e6a2b9a5824392e213cdc5daaafb4cd9229020e085712b23c134b4ba482ec2b0cb835c87935a8d91aee
|
7
|
+
data.tar.gz: 0ec6a32e5325f663110d0f5683b82bc8928ed2102056e52fd7bba3c94f10aa505dabbd879124c2c71f7e74ae54369ba4dffc63fb6374708252167fc4294218b6
|
@@ -2,6 +2,12 @@ module Birt
|
|
2
2
|
class ApiController < ActionController::Base
|
3
3
|
protect_from_forgery with: :exception
|
4
4
|
|
5
|
+
before_filter do
|
6
|
+
if Birt::Api.options.before_filter
|
7
|
+
instance_exec(request, &Birt::Api.options.before_filter)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
5
11
|
def index
|
6
12
|
|
7
13
|
rpt_design_path = params[:_report] || '003.rptdesign'
|
data/birt-api.gemspec
CHANGED
@@ -16,7 +16,6 @@ Gem::Specification.new do |spec|
|
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f|
|
18
18
|
f.match(%r{^(bin|config|public|test|spec|features|birt|app/assets|lib/tasks)/}) }
|
19
|
-
spec.files += ["config/routes.rb"]
|
20
19
|
spec.bindir = "exe"
|
21
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
21
|
spec.require_paths = ["app","lib"]
|
data/lib/birt/api.rb
CHANGED
@@ -1,8 +1,36 @@
|
|
1
1
|
require "birt/api/version"
|
2
|
+
require "birt/api/engine"
|
2
3
|
require "birt/core"
|
3
4
|
|
4
5
|
module Birt
|
5
6
|
module Api
|
6
|
-
|
7
|
+
class Options < OpenStruct
|
8
|
+
def before_filter(&block)
|
9
|
+
if block_given?
|
10
|
+
self.before_filter_proc = block
|
11
|
+
else
|
12
|
+
self.before_filter_proc
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
mattr_accessor :options
|
18
|
+
|
19
|
+
self.options = Options.new(
|
20
|
+
|
21
|
+
url: '/birt/api',
|
22
|
+
app_name: 'BirtApi',
|
23
|
+
app_url: 'https://github.com/mumaoxi/birt-api',
|
24
|
+
|
25
|
+
headers: {},
|
26
|
+
|
27
|
+
api_auth: '', # 'basic' or 'bearer'
|
28
|
+
api_key_name: 'api_key', # 'Authorization'
|
29
|
+
api_key_type: 'query', # 'header'
|
30
|
+
|
31
|
+
before_filter_proc: nil # Proc used as a controller before filter
|
32
|
+
)
|
33
|
+
|
7
34
|
end
|
35
|
+
|
8
36
|
end
|
data/lib/birt/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: birt-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saxer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -71,9 +71,9 @@ files:
|
|
71
71
|
- app/views/birt/api/index.json.jbuilder
|
72
72
|
- birt-api.gemspec
|
73
73
|
- config.ru
|
74
|
-
- config/routes.rb
|
75
74
|
- lib/assets/.keep
|
76
75
|
- lib/birt/api.rb
|
76
|
+
- lib/birt/api/engine.rb
|
77
77
|
- lib/birt/api/version.rb
|
78
78
|
homepage: https://github.com/mumaoxi/birt-api
|
79
79
|
licenses:
|