juno-report 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +20 -0
- data/.idea/.name +1 -0
- data/.idea/.rakeTasks +7 -0
- data/.idea/encodings.xml +5 -0
- data/.idea/juno-report.iml +31 -0
- data/.idea/misc.xml +5 -0
- data/.idea/modules.xml +9 -0
- data/.idea/scopes/scope_settings.xml +5 -0
- data/.idea/vcs.xml +7 -0
- data/.idea/workspace.xml +281 -0
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +51 -0
- data/LICENSE.txt +22 -0
- data/README.md +197 -0
- data/Rakefile +7 -0
- data/juno-report.gemspec +24 -0
- data/lib/juno-report.rb +33 -0
- data/lib/juno-report/pdf.rb +279 -0
- data/lib/juno-report/pdf/behaviors.rb +18 -0
- data/lib/juno-report/pdf/formatters.rb +13 -0
- data/lib/juno-report/report_object.rb +9 -0
- data/lib/juno-report/version.rb +3 -0
- data/samples/example.rb +21 -0
- data/samples/report.pdf +972 -0
- data/samples/report.yml +30 -0
- data/spec/data/data1.rb +9 -0
- data/spec/data/rule1.yml +10 -0
- data/spec/default_spec.rb +13 -0
- data/spec/rules_spec.rb +13 -0
- data/spec/spec_helper.rb +11 -0
- metadata +39 -3
data/samples/report.yml
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
page:
|
2
|
+
fields:
|
3
|
+
title1: [260, {size: 24, align: center, value: "Test Report"}]
|
4
|
+
subtitle1: [260, {size: 20, posY: 20, align: center, value: "Generated by Juno Report"}]
|
5
|
+
body:
|
6
|
+
settings: {posY: 40, height: 30, groups: [group_field1, group_field2]}
|
7
|
+
fields:
|
8
|
+
test_field1: [10]
|
9
|
+
test_field2: [220]
|
10
|
+
test_field3: [420, {column: "Named Test Field 3"}]
|
11
|
+
footer:
|
12
|
+
label_total: [10, {value: "Total"}]
|
13
|
+
totalizer1: [220, {behavior: count}]
|
14
|
+
test_field3: [420, {behavior: sum}]
|
15
|
+
group_field1:
|
16
|
+
settings: {posY: 30, height: 10}
|
17
|
+
fields:
|
18
|
+
group_field1: [10, size: 25]
|
19
|
+
footer:
|
20
|
+
group_field1: [10, {label: "Total "}]
|
21
|
+
totalizer1: [220, {behavior: count}]
|
22
|
+
test_field3: [420, {behavior: sum}]
|
23
|
+
group_field2:
|
24
|
+
settings: {posY: 30, height: 25}
|
25
|
+
fields:
|
26
|
+
group_field2: [10, size: 17]
|
27
|
+
footer:
|
28
|
+
group_field2: [10, {label: "Total "}]
|
29
|
+
totalizer1: [220, {behavior: count}]
|
30
|
+
test_field3: [420, {behavior: sum}]
|
data/spec/data/data1.rb
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
[
|
2
|
+
{:test_field1 => 'Test Value 1', :test_field2 => "Test Value 2", :test_field3 => 50},
|
3
|
+
{:test_field1 => 'Test Value 1', :test_field2 => "Test Value 2", :test_field3 => 7},
|
4
|
+
{:test_field1 => 'Test Value 1', :test_field2 => "Test Value 2", :test_field3 => 10},
|
5
|
+
{:test_field1 => 'Test Value 1', :test_field2 => "Test Value 2", :test_field3 => 5},
|
6
|
+
{:test_field1 => 'Test Value 1', :test_field2 => "Test Value 2", :test_field3 => 2},
|
7
|
+
{:test_field1 => 'Test Value 1', :test_field2 => "Test Value 2", :test_field3 => 4},
|
8
|
+
{:test_field1 => 'Test Value 1', :test_field2 => "Test Value 2", :test_field3 => 24}
|
9
|
+
]
|
data/spec/data/rule1.yml
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
body:
|
2
|
+
settings: {posY: 40, height: 25}
|
3
|
+
fields:
|
4
|
+
test_field1: [10]
|
5
|
+
test_field2: [220]
|
6
|
+
test_field3: [430, {column: "Named Test Field 3"}]
|
7
|
+
footer:
|
8
|
+
label_total: [10, {value: "Total"}]
|
9
|
+
totalizer: [220, {behavior: count}]
|
10
|
+
test_field3: [430, {behavior: sum}]
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require File.join(File.expand_path(File.dirname(__FILE__)), "spec_helper")
|
2
|
+
|
3
|
+
describe "Generating a report" do
|
4
|
+
it "YAML file should exist" do
|
5
|
+
data = require 'data/data1.rb'
|
6
|
+
lambda {JunoReport::generate data, report: File.expand_path('spec/data/rule1')}.should_not raise_error Errno::ENOENT
|
7
|
+
end
|
8
|
+
|
9
|
+
it "Invalid YAML file should crash" do
|
10
|
+
data = require 'data/data1.rb'
|
11
|
+
lambda {JunoReport::generate data, report: 'fake-rule'}.should raise_error Errno::ENOENT
|
12
|
+
end
|
13
|
+
end
|
data/spec/rules_spec.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require File.join(File.expand_path(File.dirname(__FILE__)), "spec_helper")
|
2
|
+
|
3
|
+
describe "Generating a report" do
|
4
|
+
it "YAML file should exist" do
|
5
|
+
data = require 'data/data1.rb'
|
6
|
+
lambda {JunoReport::generate data, report: File.expand_path('spec/data/rule1')}.should_not raise_error Errno::ENOENT
|
7
|
+
end
|
8
|
+
|
9
|
+
it "Invalid YAML file should crash" do
|
10
|
+
data = require 'data/data1.rb'
|
11
|
+
lambda {JunoReport::generate data, report: 'fake-rule'}.should raise_error Errno::ENOENT
|
12
|
+
end
|
13
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
Bundler.setup
|
3
|
+
|
4
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
5
|
+
require 'juno-report'
|
6
|
+
require 'rspec/autorun'
|
7
|
+
|
8
|
+
RSpec.configure do |config|
|
9
|
+
config.color_enabled = true
|
10
|
+
config.formatter = 'documentation'
|
11
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: juno-report
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edson Júnior
|
@@ -58,7 +58,38 @@ email:
|
|
58
58
|
executables: []
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
|
-
files:
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".idea/.name"
|
64
|
+
- ".idea/.rakeTasks"
|
65
|
+
- ".idea/encodings.xml"
|
66
|
+
- ".idea/juno-report.iml"
|
67
|
+
- ".idea/misc.xml"
|
68
|
+
- ".idea/modules.xml"
|
69
|
+
- ".idea/scopes/scope_settings.xml"
|
70
|
+
- ".idea/vcs.xml"
|
71
|
+
- ".idea/workspace.xml"
|
72
|
+
- ".rspec"
|
73
|
+
- Gemfile
|
74
|
+
- Gemfile.lock
|
75
|
+
- LICENSE.txt
|
76
|
+
- README.md
|
77
|
+
- Rakefile
|
78
|
+
- juno-report.gemspec
|
79
|
+
- lib/juno-report.rb
|
80
|
+
- lib/juno-report/pdf.rb
|
81
|
+
- lib/juno-report/pdf/behaviors.rb
|
82
|
+
- lib/juno-report/pdf/formatters.rb
|
83
|
+
- lib/juno-report/report_object.rb
|
84
|
+
- lib/juno-report/version.rb
|
85
|
+
- samples/example.rb
|
86
|
+
- samples/report.pdf
|
87
|
+
- samples/report.yml
|
88
|
+
- spec/data/data1.rb
|
89
|
+
- spec/data/rule1.yml
|
90
|
+
- spec/default_spec.rb
|
91
|
+
- spec/rules_spec.rb
|
92
|
+
- spec/spec_helper.rb
|
62
93
|
homepage: http://github.com/ebfjunior/juno-report
|
63
94
|
licenses: []
|
64
95
|
metadata: {}
|
@@ -82,4 +113,9 @@ rubygems_version: 2.5.1
|
|
82
113
|
signing_key:
|
83
114
|
specification_version: 4
|
84
115
|
summary: Juno Reports generates reports with the minimum configuration and effort
|
85
|
-
test_files:
|
116
|
+
test_files:
|
117
|
+
- spec/data/data1.rb
|
118
|
+
- spec/data/rule1.yml
|
119
|
+
- spec/default_spec.rb
|
120
|
+
- spec/rules_spec.rb
|
121
|
+
- spec/spec_helper.rb
|