dossier 2.12.0 → 2.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/dossier/formatter.rb +2 -2
- data/lib/dossier/version.rb +1 -1
- data/spec/dossier/formatter_spec.rb +3 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +179 -0
- 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: 38e25b35de73b25b62fd2532e6a75a40ca1ada9c
|
4
|
+
data.tar.gz: c14577c20f96aca152a179ca827bcae2753b5062
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b3b33eaff2f0a2f82839a672ddd68cf6852be5524052e88ae7511071b003fff3451c6399601d8f7a75f53760b9e9f25108698adaab9c11ab158e8a7c4bc4c2a
|
7
|
+
data.tar.gz: cffa2da9c307d3e78e479785839b210568ed066f9641c03fd1109b93129db9df8f00a5e946744c8c1f3b6385870b69fb3948544076660e09b990c89c3e342002
|
data/lib/dossier/formatter.rb
CHANGED
@@ -9,13 +9,13 @@ module Dossier
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def number_to_dollars(value)
|
12
|
-
|
12
|
+
commafy_number(value, 2).sub(/(\d)/, '$\1')
|
13
13
|
end
|
14
14
|
|
15
15
|
def commafy_number(value, precision = nil)
|
16
16
|
whole, fraction = value.to_s.split('.')
|
17
17
|
fraction = "%.#{precision}d" % (BigDecimal.new("0.#{fraction}").round(precision) * 10**precision).to_i if precision
|
18
|
-
[whole.
|
18
|
+
[whole.gsub(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1,"), fraction].compact.join('.')
|
19
19
|
end
|
20
20
|
|
21
21
|
def url_formatter
|
data/lib/dossier/version.rb
CHANGED
@@ -68,7 +68,9 @@ describe Dossier::Formatter do
|
|
68
68
|
10_000 => '$10,000.00',
|
69
69
|
10_000.00 => '$10,000.00',
|
70
70
|
1_000_000_000.000 => '$1,000,000,000.00',
|
71
|
-
'12345.6788' => '$12,345.68'
|
71
|
+
'12345.6788' => '$12,345.68',
|
72
|
+
0.01 => '$0.01',
|
73
|
+
-0.01 => '-$0.01'
|
72
74
|
}.each { |base, formatted|
|
73
75
|
it "formats #{base} as #{formatted}" do
|
74
76
|
expect(formatter.number_to_dollars(base)).to eq formatted
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/spec/dummy/log/test.log
CHANGED
@@ -526,3 +526,182 @@ Processing by Dossier::ReportsController#show as HTML
|
|
526
526
|
[1m[35mEmployeeWithCustomClientReport (0.2ms)[0m
|
527
527
|
SELECT * FROM `employees`
|
528
528
|
Completed 200 OK in 4ms (Views: 2.1ms | ActiveRecord: 0.2ms)
|
529
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT `schema_migrations`.* FROM `schema_migrations`[0m
|
530
|
+
[1m[35mFACTORY (0.1ms)[0m CREATE DATABASE IF NOT EXISTS `dossier_test`
|
531
|
+
[1m[36mFACTORY (12.4ms)[0m [1mDROP TABLE IF EXISTS `employees`[0m
|
532
|
+
[1m[35mFACTORY (9.8ms)[0m CREATE TABLE `employees` (
|
533
|
+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
534
|
+
`name` varchar(255) NOT NULL,
|
535
|
+
`division` varchar(255) NOT NULL,
|
536
|
+
`salary` int(11) NOT NULL,
|
537
|
+
`suspended` tinyint(1) NOT NULL DEFAULT 0,
|
538
|
+
`hired_on` date NOT NULL,
|
539
|
+
PRIMARY KEY (`id`)
|
540
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
541
|
+
|
542
|
+
[1m[36mFACTORY (2.9ms)[0m [1mTRUNCATE `employees`[0m
|
543
|
+
[1m[35mFACTORY (0.3ms)[0m INSERT INTO
|
544
|
+
`employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
|
545
|
+
VALUES ('Moustafa McMann', '2010-10-02', false, 'Zany Inventions', 30000);
|
546
|
+
|
547
|
+
[1m[36mFACTORY (0.2ms)[0m [1m INSERT INTO
|
548
|
+
`employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
|
549
|
+
VALUES ('Jimmy Jackalope, Jr.', '2013-01-11', true, 'Tedious Toiling', 20000);
|
550
|
+
[0m
|
551
|
+
[1m[35mFACTORY (0.4ms)[0m INSERT INTO
|
552
|
+
`employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
|
553
|
+
VALUES ('Elise Elderberry', '2013-01-11', false, 'Corporate Malfeasance', 99000);
|
554
|
+
|
555
|
+
[1m[36mFACTORY (1.7ms)[0m [1mDROP TABLE IF EXISTS `employees`[0m
|
556
|
+
[1m[35mFACTORY (0.8ms)[0m CREATE TABLE `employees` (
|
557
|
+
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
|
558
|
+
`name` TEXT NOT NULL,
|
559
|
+
`division` TEXT NOT NULL,
|
560
|
+
`salary` INTEGER NOT NULL,
|
561
|
+
`suspended` TINYINT NOT NULL DEFAULT 0,
|
562
|
+
`hired_on` DATE NOT NULL
|
563
|
+
);
|
564
|
+
|
565
|
+
[1m[36mFACTORY (0.7ms)[0m [1mDELETE FROM `employees`[0m
|
566
|
+
[1m[35mFACTORY (0.7ms)[0m INSERT INTO
|
567
|
+
`employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
|
568
|
+
VALUES ('MOUSTAFA MCMANN', '2010-10-02', 0, 'Zany Inventions', 30000);
|
569
|
+
|
570
|
+
[1m[36mFACTORY (0.7ms)[0m [1m INSERT INTO
|
571
|
+
`employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
|
572
|
+
VALUES ('JIMMY JACKALOPE, JR.', '2013-01-11', 1, 'Tedious Toiling', 20000);
|
573
|
+
[0m
|
574
|
+
[1m[35mFACTORY (0.7ms)[0m INSERT INTO
|
575
|
+
`employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
|
576
|
+
VALUES ('ELISE ELDERBERRY', '2013-01-11', 0, 'Corporate Malfeasance', 99000);
|
577
|
+
|
578
|
+
Started GET "/multi/reports/combination.csv" for 127.0.0.1 at 2014-06-05 15:55:50 -0400
|
579
|
+
Processing by Dossier::ReportsController#multi as CSV
|
580
|
+
Parameters: {"report"=>"combination"}
|
581
|
+
Completed 500 Internal Server Error in 4ms
|
582
|
+
Started GET "/multi/reports/combination" for 127.0.0.1 at 2014-06-05 15:55:50 -0400
|
583
|
+
Processing by Dossier::ReportsController#multi as HTML
|
584
|
+
Parameters: {"report"=>"combination"}
|
585
|
+
Rendered dossier/reports/combination/_options.html.haml (7.5ms)
|
586
|
+
[1m[36mEmployeeReport (0.2ms)[0m [1m
|
587
|
+
SELECT * FROM employees WHERE 1=1
|
588
|
+
ORDER BY name ASC[0m
|
589
|
+
Rendered /Users/adamhunter/Studio/github/dossier/app/views/dossier/reports/show.html.haml (8.6ms)
|
590
|
+
[1m[35mEmployeeWithCustomViewReport (0.3ms)[0m
|
591
|
+
SELECT * FROM employees WHERE suspended = true
|
592
|
+
Rendered dossier/reports/employee_with_custom_view.html.haml (2.3ms)
|
593
|
+
Rendered /Users/adamhunter/Studio/github/dossier/app/views/dossier/reports/multi.html.haml (35.4ms)
|
594
|
+
Completed 200 OK in 40ms (Views: 39.6ms | ActiveRecord: 0.5ms)
|
595
|
+
Started GET "/multi/reports/combination" for 127.0.0.1 at 2014-06-05 15:55:50 -0400
|
596
|
+
Processing by Dossier::ReportsController#multi as HTML
|
597
|
+
Parameters: {"report"=>"combination"}
|
598
|
+
Rendered dossier/reports/combination/_options.html.haml (0.9ms)
|
599
|
+
[1m[36mEmployeeReport (0.2ms)[0m [1m
|
600
|
+
SELECT * FROM employees WHERE 1=1
|
601
|
+
ORDER BY name ASC[0m
|
602
|
+
Rendered /Users/adamhunter/Studio/github/dossier/app/views/dossier/reports/show.html.haml (3.6ms)
|
603
|
+
[1m[35mEmployeeWithCustomViewReport (0.2ms)[0m
|
604
|
+
SELECT * FROM employees WHERE suspended = true
|
605
|
+
Rendered dossier/reports/employee_with_custom_view.html.haml (1.2ms)
|
606
|
+
Rendered /Users/adamhunter/Studio/github/dossier/app/views/dossier/reports/multi.html.haml (6.9ms)
|
607
|
+
Completed 200 OK in 8ms (Views: 6.9ms | ActiveRecord: 0.4ms)
|
608
|
+
Started GET "/multi/reports/combination" for 127.0.0.1 at 2014-06-05 15:55:50 -0400
|
609
|
+
Processing by Dossier::ReportsController#multi as HTML
|
610
|
+
Parameters: {"report"=>"combination"}
|
611
|
+
Rendered dossier/reports/combination/_options.html.haml (0.8ms)
|
612
|
+
[1m[36mEmployeeReport (0.2ms)[0m [1m
|
613
|
+
SELECT * FROM employees WHERE 1=1
|
614
|
+
ORDER BY name ASC[0m
|
615
|
+
Rendered /Users/adamhunter/Studio/github/dossier/app/views/dossier/reports/show.html.haml (3.8ms)
|
616
|
+
[1m[35mEmployeeWithCustomViewReport (0.2ms)[0m
|
617
|
+
SELECT * FROM employees WHERE suspended = true
|
618
|
+
Rendered dossier/reports/employee_with_custom_view.html.haml (1.3ms)
|
619
|
+
Rendered /Users/adamhunter/Studio/github/dossier/app/views/dossier/reports/multi.html.haml (7.1ms)
|
620
|
+
Completed 200 OK in 8ms (Views: 7.0ms | ActiveRecord: 0.5ms)
|
621
|
+
Rendered dossier/reports/employee_with_custom_view/_options.html.haml (3.8ms)
|
622
|
+
Started GET "/reports/employee_with_custom_client" for 127.0.0.1 at 2014-06-05 15:55:50 -0400
|
623
|
+
Processing by Dossier::ReportsController#show as HTML
|
624
|
+
Parameters: {"report"=>"employee_with_custom_client"}
|
625
|
+
[1m[36mEmployeeWithCustomClientReport (0.3ms)[0m [1m
|
626
|
+
SELECT * FROM `employees`[0m
|
627
|
+
Completed 200 OK in 7ms (Views: 5.4ms | ActiveRecord: 0.3ms)
|
628
|
+
Started GET "/reports/employee.xls" for 127.0.0.1 at 2014-06-05 15:55:50 -0400
|
629
|
+
Processing by Dossier::ReportsController#show as XLS
|
630
|
+
Parameters: {"report"=>"employee"}
|
631
|
+
[1m[35mEmployeeReport (0.2ms)[0m
|
632
|
+
SELECT * FROM employees WHERE 1=1
|
633
|
+
ORDER BY name ASC
|
634
|
+
Completed 200 OK in 68ms (ActiveRecord: 0.2ms)
|
635
|
+
Started GET "/reports/employee.csv" for 127.0.0.1 at 2014-06-05 15:55:50 -0400
|
636
|
+
Processing by Dossier::ReportsController#show as CSV
|
637
|
+
Parameters: {"report"=>"employee"}
|
638
|
+
[1m[36mEmployeeReport (0.2ms)[0m [1m
|
639
|
+
SELECT * FROM employees WHERE 1=1
|
640
|
+
ORDER BY name ASC[0m
|
641
|
+
Completed 200 OK in 3ms (ActiveRecord: 0.2ms)
|
642
|
+
Started GET "/reports/employee" for 127.0.0.1 at 2014-06-05 15:55:50 -0400
|
643
|
+
Processing by Dossier::ReportsController#show as HTML
|
644
|
+
Parameters: {"report"=>"employee"}
|
645
|
+
[1m[35mEmployeeReport (0.2ms)[0m
|
646
|
+
SELECT * FROM employees WHERE 1=1
|
647
|
+
ORDER BY name ASC
|
648
|
+
Completed 200 OK in 6ms (Views: 4.2ms | ActiveRecord: 0.2ms)
|
649
|
+
Started GET "/reports/employee?options[footer]=1" for 127.0.0.1 at 2014-06-05 15:55:50 -0400
|
650
|
+
Processing by Dossier::ReportsController#show as HTML
|
651
|
+
Parameters: {"options"=>{"footer"=>"1"}, "report"=>"employee"}
|
652
|
+
[1m[36mEmployeeReport (0.2ms)[0m [1m
|
653
|
+
SELECT * FROM employees WHERE 1=1
|
654
|
+
ORDER BY name ASC[0m
|
655
|
+
Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.2ms)
|
656
|
+
Started GET "/reports/employee?options[divisions][]=Tedious+Toiling&options[names][]=Jimmy+Jackalope&options[names][]=Moustafa+McMann&options[order]=desc&options[salary]=true" for 127.0.0.1 at 2014-06-05 15:55:50 -0400
|
657
|
+
Processing by Dossier::ReportsController#show as HTML
|
658
|
+
Parameters: {"options"=>{"divisions"=>["Tedious Toiling"], "names"=>["Jimmy Jackalope", "Moustafa McMann"], "order"=>"desc", "salary"=>"true"}, "report"=>"employee"}
|
659
|
+
[1m[35mEmployeeReport (0.3ms)[0m
|
660
|
+
SELECT * FROM employees WHERE 1=1
|
661
|
+
AND division in (('Tedious Toiling'))
|
662
|
+
AND salary > 10000
|
663
|
+
AND (name like '%Moustafa McMann%' or name like '%Jimmy Jackalope%')
|
664
|
+
ORDER BY name DESC
|
665
|
+
Completed 200 OK in 5ms (Views: 4.0ms | ActiveRecord: 0.3ms)
|
666
|
+
Started GET "/reports/employee_with_custom_view" for 127.0.0.1 at 2014-06-05 15:55:50 -0400
|
667
|
+
Processing by Dossier::ReportsController#show as HTML
|
668
|
+
Parameters: {"report"=>"employee_with_custom_view"}
|
669
|
+
Rendered dossier/reports/employee_with_custom_view/_options.html.haml (2.4ms)
|
670
|
+
[1m[36mEmployeeWithCustomViewReport (0.2ms)[0m [1m
|
671
|
+
SELECT * FROM employees WHERE suspended = true[0m
|
672
|
+
Completed 200 OK in 8ms (Views: 7.5ms | ActiveRecord: 0.2ms)
|
673
|
+
Started GET "/reports/employee_with_custom_view" for 127.0.0.1 at 2014-06-05 15:55:50 -0400
|
674
|
+
Processing by Dossier::ReportsController#show as HTML
|
675
|
+
Parameters: {"report"=>"employee_with_custom_view"}
|
676
|
+
Rendered dossier/reports/employee_with_custom_view/_options.html.haml (1.6ms)
|
677
|
+
[1m[35mEmployeeWithCustomViewReport (0.2ms)[0m
|
678
|
+
SELECT * FROM employees WHERE suspended = true
|
679
|
+
Completed 200 OK in 6ms (Views: 5.1ms | ActiveRecord: 0.2ms)
|
680
|
+
Started GET "/reports/employee" for 127.0.0.1 at 2014-06-05 15:55:50 -0400
|
681
|
+
Processing by Dossier::ReportsController#show as HTML
|
682
|
+
Parameters: {"report"=>"employee"}
|
683
|
+
[1m[36mEmployeeReport (0.3ms)[0m [1m
|
684
|
+
SELECT * FROM employees WHERE 1=1
|
685
|
+
ORDER BY name ASC[0m
|
686
|
+
Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.3ms)
|
687
|
+
[1m[35mEmployeeReport (0.2ms)[0m
|
688
|
+
SELECT * FROM employees WHERE 1=1
|
689
|
+
ORDER BY name ASC
|
690
|
+
[1m[36mEmployeeReport (0.3ms)[0m [1m
|
691
|
+
SELECT * FROM employees WHERE 1=1
|
692
|
+
ORDER BY name ASC[0m
|
693
|
+
[1m[35mEmployeeReport (0.2ms)[0m
|
694
|
+
SELECT * FROM employees WHERE 1=1
|
695
|
+
ORDER BY name ASC
|
696
|
+
Started GET "/reports/cats/are/super_fun" for 127.0.0.1 at 2014-06-05 15:55:50 -0400
|
697
|
+
Processing by Dossier::ReportsController#show as HTML
|
698
|
+
Parameters: {"report"=>"cats/are/super_fun"}
|
699
|
+
[1m[36mCats::Are::SuperFunReport (0.1ms)[0m [1m
|
700
|
+
select 'cats', 'are', 'super', 'fun'[0m
|
701
|
+
Completed 200 OK in 8ms (Views: 3.9ms | ActiveRecord: 0.1ms)
|
702
|
+
Started GET "/employee_report_custom_controller" for 127.0.0.1 at 2014-06-05 15:55:50 -0400
|
703
|
+
Processing by SiteController#report as HTML
|
704
|
+
[1m[35mEmployeeReport (0.2ms)[0m
|
705
|
+
SELECT * FROM employees WHERE 1=1
|
706
|
+
ORDER BY name ASC
|
707
|
+
Completed 200 OK in 5ms (Views: 2.8ms | ActiveRecord: 0.2ms)
|