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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4617827037c4d0f95d02b4afba4ea54676551bc
4
- data.tar.gz: c4385067e3e523b7ef8dc9d4eac5bca33c1ca7b9
3
+ metadata.gz: 1d567b6da4903bf4dcb9fb853f2586a9f1b68287
4
+ data.tar.gz: fe3cf79026c3583a67b9b3bc0fa4eddf9d30d0df
5
5
  SHA512:
6
- metadata.gz: 02c5fec41f3fefd4740be03a0faea7a27a45bb609666e63a34cc8b64452b0bf553e3c1ef35ec5867c6df0933d80692743180147d54a732b77e48df5445788bf7
7
- data.tar.gz: cdda89f1783c26c5411393390d43bd265194bae58a43952d804fdfdec1fd5cc67c8a22b6ca578b9ff9246ab624e7108f78f16c63230770163674492279440cc8
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
- # Your code goes here...
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
@@ -0,0 +1,8 @@
1
+ module Birt
2
+ module Api
3
+ class Engine < ::Rails::Engine
4
+ paths['lib/tasks'] = 'lib/tasks/exported'
5
+ isolate_namespace Birt::Api
6
+ end
7
+ end
8
+ end
@@ -1,5 +1,5 @@
1
1
  module Birt
2
2
  module Api
3
- VERSION = "0.1.6"
3
+ VERSION = "0.1.7"
4
4
  end
5
5
  end
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.6
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-01 00:00:00.000000000 Z
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:
data/config/routes.rb DELETED
@@ -1,5 +0,0 @@
1
- Rails.application.routes.draw do
2
- namespace :birt do
3
- resources :api, only: [:index]
4
- end
5
- end