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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8855e257499ae951a04b45a6a56f7732fb25497
4
- data.tar.gz: 5aec70129f40c196dc72dde3167e0fcda6557a45
3
+ metadata.gz: 38e25b35de73b25b62fd2532e6a75a40ca1ada9c
4
+ data.tar.gz: c14577c20f96aca152a179ca827bcae2753b5062
5
5
  SHA512:
6
- metadata.gz: 856da45da19795e27559e2ba32a5016295f2460eb3f056f15dfe74b8120ffae2c8f82e7329c12c835c5ebb684da9dbf7c8da35f2b0246766b04ff90957b76c00
7
- data.tar.gz: 600e84681a3592155a59e4a3c523e880934e76e2848ad1e1ba6e762d1c89abd1134cec52077bef355aaf48083260312275f9413f349b1e98753ba4f6e33f2215
6
+ metadata.gz: 6b3b33eaff2f0a2f82839a672ddd68cf6852be5524052e88ae7511071b003fff3451c6399601d8f7a75f53760b9e9f25108698adaab9c11ab158e8a7c4bc4c2a
7
+ data.tar.gz: cffa2da9c307d3e78e479785839b210568ed066f9641c03fd1109b93129db9df8f00a5e946744c8c1f3b6385870b69fb3948544076660e09b990c89c3e342002
@@ -9,13 +9,13 @@ module Dossier
9
9
  end
10
10
 
11
11
  def number_to_dollars(value)
12
- "$#{commafy_number(value, 2)}"
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.to_i.to_s.gsub(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1,"), fraction].compact.join('.')
18
+ [whole.gsub(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1,"), fraction].compact.join('.')
19
19
  end
20
20
 
21
21
  def url_formatter
@@ -1,3 +1,3 @@
1
1
  module Dossier
2
- VERSION = "2.12.0"
2
+ VERSION = "2.12.1"
3
3
  end
@@ -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
Binary file
@@ -526,3 +526,182 @@ Processing by Dossier::ReportsController#show as HTML
526
526
  EmployeeWithCustomClientReport (0.2ms)
527
527
  SELECT * FROM `employees`
528
528
  Completed 200 OK in 4ms (Views: 2.1ms | ActiveRecord: 0.2ms)
529
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT `schema_migrations`.* FROM `schema_migrations`
530
+ FACTORY (0.1ms) CREATE DATABASE IF NOT EXISTS `dossier_test`
531
+ FACTORY (12.4ms) DROP TABLE IF EXISTS `employees`
532
+ FACTORY (9.8ms) 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
+ FACTORY (2.9ms) TRUNCATE `employees`
543
+ FACTORY (0.3ms) INSERT INTO
544
+ `employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
545
+ VALUES ('Moustafa McMann', '2010-10-02', false, 'Zany Inventions', 30000);
546
+
547
+ FACTORY (0.2ms)  INSERT INTO
548
+ `employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
549
+ VALUES ('Jimmy Jackalope, Jr.', '2013-01-11', true, 'Tedious Toiling', 20000);
550
+ 
551
+ FACTORY (0.4ms) INSERT INTO
552
+ `employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
553
+ VALUES ('Elise Elderberry', '2013-01-11', false, 'Corporate Malfeasance', 99000);
554
+
555
+ FACTORY (1.7ms) DROP TABLE IF EXISTS `employees`
556
+ FACTORY (0.8ms) 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
+ FACTORY (0.7ms) DELETE FROM `employees`
566
+ FACTORY (0.7ms) INSERT INTO
567
+ `employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
568
+ VALUES ('MOUSTAFA MCMANN', '2010-10-02', 0, 'Zany Inventions', 30000);
569
+
570
+ FACTORY (0.7ms)  INSERT INTO
571
+ `employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
572
+ VALUES ('JIMMY JACKALOPE, JR.', '2013-01-11', 1, 'Tedious Toiling', 20000);
573
+ 
574
+ FACTORY (0.7ms) 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
+ EmployeeReport (0.2ms) 
587
+ SELECT * FROM employees WHERE 1=1
588
+ ORDER BY name ASC
589
+ Rendered /Users/adamhunter/Studio/github/dossier/app/views/dossier/reports/show.html.haml (8.6ms)
590
+ EmployeeWithCustomViewReport (0.3ms)
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
+ EmployeeReport (0.2ms) 
600
+ SELECT * FROM employees WHERE 1=1
601
+ ORDER BY name ASC
602
+ Rendered /Users/adamhunter/Studio/github/dossier/app/views/dossier/reports/show.html.haml (3.6ms)
603
+ EmployeeWithCustomViewReport (0.2ms)
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
+ EmployeeReport (0.2ms) 
613
+ SELECT * FROM employees WHERE 1=1
614
+ ORDER BY name ASC
615
+ Rendered /Users/adamhunter/Studio/github/dossier/app/views/dossier/reports/show.html.haml (3.8ms)
616
+ EmployeeWithCustomViewReport (0.2ms)
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
+ EmployeeWithCustomClientReport (0.3ms) 
626
+ SELECT * FROM `employees`
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
+ EmployeeReport (0.2ms)
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
+ EmployeeReport (0.2ms) 
639
+ SELECT * FROM employees WHERE 1=1
640
+ ORDER BY name ASC
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
+ EmployeeReport (0.2ms)
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
+ EmployeeReport (0.2ms) 
653
+ SELECT * FROM employees WHERE 1=1
654
+ ORDER BY name ASC
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
+ EmployeeReport (0.3ms)
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
+ EmployeeWithCustomViewReport (0.2ms) 
671
+ SELECT * FROM employees WHERE suspended = true
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
+ EmployeeWithCustomViewReport (0.2ms)
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
+ EmployeeReport (0.3ms) 
684
+ SELECT * FROM employees WHERE 1=1
685
+ ORDER BY name ASC
686
+ Completed 200 OK in 5ms (Views: 4.1ms | ActiveRecord: 0.3ms)
687
+ EmployeeReport (0.2ms)
688
+ SELECT * FROM employees WHERE 1=1
689
+ ORDER BY name ASC
690
+ EmployeeReport (0.3ms) 
691
+ SELECT * FROM employees WHERE 1=1
692
+ ORDER BY name ASC
693
+ EmployeeReport (0.2ms)
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
+ Cats::Are::SuperFunReport (0.1ms) 
700
+ select 'cats', 'are', 'super', 'fun'
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
+ EmployeeReport (0.2ms)
705
+ SELECT * FROM employees WHERE 1=1
706
+ ORDER BY name ASC
707
+ Completed 200 OK in 5ms (Views: 2.8ms | ActiveRecord: 0.2ms)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dossier
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.0
4
+ version: 2.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Hunter