birt-api 0.1.2 → 0.1.3

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: 6686f23e3e43711c93d69554cb71ab8466086750
4
- data.tar.gz: 872258dc8be915bfd1e67bea6fd87c7b1f41b7a9
3
+ metadata.gz: 1d870b284d3729375d13a7802adb38eb1e5a9895
4
+ data.tar.gz: 76bffd051b86ee002413ffe23f1c32a676badd76
5
5
  SHA512:
6
- metadata.gz: 3425dfe1f2a58b96e011bb78e89814384421a274f7c7f17abcaf0ac8f73d5912f4eaf03e321d0c64b5c6f4e5a72bfadd0423150e3b23cbd5800eabaa70915aa3
7
- data.tar.gz: c986fcdc9c694b6addcdf5815daaa23f10706ac39517d284051fc5554d4eb52543f0a99df230e77be36ecf0a06b786f9446a530999465dfd2efc247b13846011
6
+ metadata.gz: 7ee7a62728c8015dab4658d0795677f5de99b32c2faeee1d056ddae4271f6ee49c1922d758ad702d946c5cec3b6d31dc2c9c290256db81917af40ff2c8d48a4a
7
+ data.tar.gz: 3d3653fa5e09021fba78ed5f95ed3c62d6f2d2e1a35f2efd06762871d55ee0b7ca1c016506a25c3f1e4534b3064a6b8813847cbb78012f301f32bd5042b0108d
data/Gemfile CHANGED
@@ -12,12 +12,13 @@ gem 'turbolinks'
12
12
  gem 'jbuilder', '~> 2.0'
13
13
  gem 'sdoc', '~> 0.4.0', group: :doc
14
14
 
15
- gem 'birt-core', '~> 0.1.2'
15
+ gem 'birt-core', '~> 0.1.4'
16
16
 
17
17
 
18
18
  group :development, :test do
19
19
  gem 'byebug'
20
-
20
+ gem 'pry'
21
+ gem 'pry-nav'
21
22
  gem 'web-console', '~> 2.0'
22
23
 
23
24
  gem 'spring'
@@ -5,8 +5,9 @@ class Birt::ApiController < ActionController::Base
5
5
 
6
6
  rpt_design_path = params[:_report] || '003.rptdesign'
7
7
  @rpt_design = Birt::Core::RptDesign.new("./birt/reports/#{rpt_design_path}")
8
- @rpt_design.parse_rpt
9
8
 
10
- render json: @rpt_design
9
+ #数据解析
10
+ @rpt_design.parse_rpt
11
+ @rpt_design.data_sets.values.each { |data_set| data_set.data_set_result }
11
12
  end
12
13
  end
@@ -1,3 +1,14 @@
1
1
  module Birt::ApiHelper
2
2
 
3
+ def parse_table_header(table_header)
4
+ header = []
5
+ table_header.rows.each_with_index { |row, index|
6
+ header << []
7
+ row.row_cells.each { |row_cell|
8
+ header[index] << row_cell.cell_labels[0].text_properties[0].text
9
+ }
10
+ }
11
+
12
+ header
13
+ end
3
14
  end
@@ -0,0 +1,6 @@
1
+ json.rpt_design do
2
+ json.tables @rpt_design.reports[:tables].values do |table|
3
+ json.id table.id
4
+ json.header parse_table_header(table.header)
5
+ end
6
+ end
data/birt-api.gemspec CHANGED
@@ -6,7 +6,7 @@ require 'birt/api/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "birt-api"
8
8
  spec.version = Birt::Api::VERSION
9
- spec.authors = ["Stream"]
9
+ spec.authors = ["Saxer"]
10
10
  spec.email = ["15201280641@qq.com"]
11
11
 
12
12
  spec.summary = %q{birt api}
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = "https://github.com/mumaoxi/birt-api"
15
15
  spec.license = "MIT"
16
16
 
17
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(public|test|spec|features|birt|app/assets)/}) }
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(public|test|spec|features|birt|app/assets|lib/tasks)/}) }
18
18
  spec.bindir = "exe"
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["app","lib"]
@@ -25,5 +25,5 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  spec.add_development_dependency "bundler", "~> 1.9"
27
27
  spec.add_development_dependency "rake", "~> 10.0"
28
- spec.add_development_dependency "birt-core", ">= 0.1.2"
28
+ spec.add_development_dependency "birt-core", "~> 0.1.4"
29
29
  end
@@ -1,5 +1,5 @@
1
1
  module Birt
2
2
  module Api
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: birt-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
- - Stream
7
+ - Saxer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: birt-core
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.1.2
47
+ version: 0.1.4
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.1.2
54
+ version: 0.1.4
55
55
  description: birt report data api
56
56
  email:
57
57
  - 15201280641@qq.com
@@ -68,8 +68,7 @@ files:
68
68
  - Rakefile
69
69
  - app/controllers/birt/api_controller.rb
70
70
  - app/helpers/birt/api_helper.rb
71
- - app/views/birt/api/application.html.erb
72
- - app/views/birt/api/index.html.erb
71
+ - app/views/birt/api/index.json.jbuilder
73
72
  - bin/bundle
74
73
  - bin/console
75
74
  - bin/rails
@@ -98,7 +97,6 @@ files:
98
97
  - lib/assets/.keep
99
98
  - lib/birt/api.rb
100
99
  - lib/birt/api/version.rb
101
- - lib/tasks/.keep
102
100
  homepage: https://github.com/mumaoxi/birt-api
103
101
  licenses:
104
102
  - MIT
@@ -121,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
119
  version: '0'
122
120
  requirements: []
123
121
  rubyforge_project:
124
- rubygems_version: 2.4.3
122
+ rubygems_version: 2.4.6
125
123
  signing_key:
126
124
  specification_version: 4
127
125
  summary: birt api
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>BirtApi</title>
5
- <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
- <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
@@ -1,4 +0,0 @@
1
- Hello
2
-
3
-
4
- <%= @rpt_design.data_sets %>
data/lib/tasks/.keep DELETED
File without changes