edtf-humanize 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +12 -0
- data/lib/edtf/humanize.rb +7 -1
- data/lib/edtf/humanize/unknown.rb +11 -0
- data/lib/edtf/humanize/version.rb +1 -1
- data/test/dummy/log/test.log +325 -0
- data/test/edtf_humanize_test.rb +8 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f598275a9531dce2588e12032e88134a6beb0395
|
4
|
+
data.tar.gz: 8123239d6628e382e3d55dc7ccc1647a3422216a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42710d68370529b5a90241e63392b0ad07e83d124d35d83d6d73d816deded6a817578ec6c5fa2dd07be69a88f03dbda77ecae648162af9887306815ed40379e7
|
7
|
+
data.tar.gz: 1885e8645447d2a3bb44668cc22be7095c3909640ccc77e4e042021b657891fc33de9c0adff9952dfeae2564a36787fc48064193b29c40796e2a8d4e129a5455
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
Copyright (c) 2014, Duke University
|
2
|
+
All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
5
|
+
|
6
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
7
|
+
|
8
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
9
|
+
|
10
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
11
|
+
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/lib/edtf/humanize.rb
CHANGED
@@ -9,6 +9,7 @@ module Edtf
|
|
9
9
|
require 'edtf/humanize/season'
|
10
10
|
require 'edtf/humanize/interval'
|
11
11
|
require 'edtf/humanize/set'
|
12
|
+
require 'edtf/humanize/unknown'
|
12
13
|
require 'edtf/humanize/iso_date'
|
13
14
|
|
14
15
|
EDTF::Decade.include Edtf::Humanize::Decade
|
@@ -16,8 +17,10 @@ module Edtf
|
|
16
17
|
EDTF::Season.include Edtf::Humanize::Season
|
17
18
|
EDTF::Interval.include Edtf::Humanize::Interval
|
18
19
|
EDTF::Set.include Edtf::Humanize::Set
|
20
|
+
EDTF::Unknown.include Edtf::Humanize::Unknown
|
19
21
|
Date.include Edtf::Humanize::IsoDate
|
20
22
|
|
23
|
+
|
21
24
|
def self.configuration
|
22
25
|
@configuration ||= Configuration.new
|
23
26
|
end
|
@@ -44,7 +47,8 @@ module Edtf
|
|
44
47
|
:set_dates_connector,
|
45
48
|
:set_last_date_connector,
|
46
49
|
:set_two_dates_connector,
|
47
|
-
:interval_unspecified_suffix
|
50
|
+
:interval_unspecified_suffix,
|
51
|
+
:unknown
|
48
52
|
|
49
53
|
def initialize
|
50
54
|
@day_precision_strftime_format = "%B %-d, %Y"
|
@@ -66,6 +70,8 @@ module Edtf
|
|
66
70
|
@set_dates_connector = ", "
|
67
71
|
@set_last_date_connector = " or "
|
68
72
|
@set_two_dates_connector = " or "
|
73
|
+
|
74
|
+
@unknown = "unknown"
|
69
75
|
end
|
70
76
|
|
71
77
|
end
|
data/test/dummy/log/test.log
CHANGED
@@ -538,3 +538,328 @@ HumanizeSetTest: test_should_return_a_humanized_set_string
|
|
538
538
|
HumanizeDecadeTest: test_should_return_a_humanized_decade_string
|
539
539
|
----------------------------------------------------------------
|
540
540
|
[1m[35m (0.0ms)[0m rollback transaction
|
541
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
542
|
+
--------------------------------------------------------------------------------------
|
543
|
+
HumanizeUncertainIsoDateTest: test_should_return_a_humanized_uncertain_ISO_date_string
|
544
|
+
--------------------------------------------------------------------------------------
|
545
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
546
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
547
|
+
----------------------------------------------------------------
|
548
|
+
HumanizeDecadeTest: test_should_return_a_humanized_decade_string
|
549
|
+
----------------------------------------------------------------
|
550
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
551
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
552
|
+
----------------------------------------------------------------
|
553
|
+
HumanizeSeasonTest: test_should_return_a_humanized_season_string
|
554
|
+
----------------------------------------------------------------
|
555
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
556
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
557
|
+
-------------------------------------------------------------------------------------------
|
558
|
+
HumanizeApproximateIntervalTest: test_should_return_a_humanized_approximate_interval_string
|
559
|
+
-------------------------------------------------------------------------------------------
|
560
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
561
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
562
|
+
----------------------------------------------------------
|
563
|
+
HumanizeSetTest: test_should_return_a_humanized_set_string
|
564
|
+
----------------------------------------------------------
|
565
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
566
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
567
|
+
------------------------------------------------------------------
|
568
|
+
HumanizeCenturyTest: test_should_return_a_humanized_century_string
|
569
|
+
------------------------------------------------------------------
|
570
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
571
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
572
|
+
---------------------------------------------------------------------------------------------------
|
573
|
+
HumanizeUnspecifiedYearIsoDateTest: test_should_return_a_humanized_unspecified_year_ISO_date_string
|
574
|
+
---------------------------------------------------------------------------------------------------
|
575
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
576
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
577
|
+
--------------------------------------------------------------------
|
578
|
+
HumanizeIntervalTest: test_should_return_a_humanized_interval_string
|
579
|
+
--------------------------------------------------------------------
|
580
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
581
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
582
|
+
----------------------------
|
583
|
+
EdtfHumanizeTest: test_truth
|
584
|
+
----------------------------
|
585
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
586
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
587
|
+
-------------------------------------------------------------------
|
588
|
+
HumanizeIsoDateTest: test_should_return_a_humanized_ISO_date_string
|
589
|
+
-------------------------------------------------------------------
|
590
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
591
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
592
|
+
----------------------------------------------------------------
|
593
|
+
HumanizeDecadeTest: test_should_return_a_humanized_decade_string
|
594
|
+
----------------------------------------------------------------
|
595
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
596
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
597
|
+
--------------------------------------------------------------------
|
598
|
+
HumanizeIntervalTest: test_should_return_a_humanized_interval_string
|
599
|
+
--------------------------------------------------------------------
|
600
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
601
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
602
|
+
-------------------------------------------------------------------
|
603
|
+
HumanizeIsoDateTest: test_should_return_a_humanized_ISO_date_string
|
604
|
+
-------------------------------------------------------------------
|
605
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
606
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
607
|
+
----------------------------------------------------------
|
608
|
+
HumanizeSetTest: test_should_return_a_humanized_set_string
|
609
|
+
----------------------------------------------------------
|
610
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
611
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
612
|
+
----------------------------------------------------------------
|
613
|
+
HumanizeSeasonTest: test_should_return_a_humanized_season_string
|
614
|
+
----------------------------------------------------------------
|
615
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
616
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
617
|
+
------------------------------------------------------------------
|
618
|
+
HumanizeCenturyTest: test_should_return_a_humanized_century_string
|
619
|
+
------------------------------------------------------------------
|
620
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
621
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
622
|
+
------------------------------------------------------------------
|
623
|
+
HumanizeUnknownTest: test_should_return_a_humanized_unknown_string
|
624
|
+
------------------------------------------------------------------
|
625
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
626
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
627
|
+
---------------------------------------------------------------------------------------------------
|
628
|
+
HumanizeUnspecifiedYearIsoDateTest: test_should_return_a_humanized_unspecified_year_ISO_date_string
|
629
|
+
---------------------------------------------------------------------------------------------------
|
630
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
631
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
632
|
+
-------------------------------------------------------------------------------------------
|
633
|
+
HumanizeApproximateIntervalTest: test_should_return_a_humanized_approximate_interval_string
|
634
|
+
-------------------------------------------------------------------------------------------
|
635
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
636
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
637
|
+
--------------------------------------------------------------------------------------
|
638
|
+
HumanizeUncertainIsoDateTest: test_should_return_a_humanized_uncertain_ISO_date_string
|
639
|
+
--------------------------------------------------------------------------------------
|
640
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
641
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
642
|
+
----------------------------
|
643
|
+
EdtfHumanizeTest: test_truth
|
644
|
+
----------------------------
|
645
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
646
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
647
|
+
--------------------------------------------------------------------
|
648
|
+
HumanizeIntervalTest: test_should_return_a_humanized_interval_string
|
649
|
+
--------------------------------------------------------------------
|
650
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
651
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
652
|
+
------------------------------------------------------------------
|
653
|
+
HumanizeUnknownTest: test_should_return_a_humanized_unknown_string
|
654
|
+
------------------------------------------------------------------
|
655
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
656
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
657
|
+
----------------------------
|
658
|
+
EdtfHumanizeTest: test_truth
|
659
|
+
----------------------------
|
660
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
661
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
662
|
+
-------------------------------------------------------------------
|
663
|
+
HumanizeIsoDateTest: test_should_return_a_humanized_ISO_date_string
|
664
|
+
-------------------------------------------------------------------
|
665
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
666
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
667
|
+
----------------------------------------------------------------
|
668
|
+
HumanizeSeasonTest: test_should_return_a_humanized_season_string
|
669
|
+
----------------------------------------------------------------
|
670
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
671
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
672
|
+
--------------------------------------------------------------------------------------
|
673
|
+
HumanizeUncertainIsoDateTest: test_should_return_a_humanized_uncertain_ISO_date_string
|
674
|
+
--------------------------------------------------------------------------------------
|
675
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
676
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
677
|
+
------------------------------------------------------------------
|
678
|
+
HumanizeCenturyTest: test_should_return_a_humanized_century_string
|
679
|
+
------------------------------------------------------------------
|
680
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
681
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
682
|
+
---------------------------------------------------------------------------------------------------
|
683
|
+
HumanizeUnspecifiedYearIsoDateTest: test_should_return_a_humanized_unspecified_year_ISO_date_string
|
684
|
+
---------------------------------------------------------------------------------------------------
|
685
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
686
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
687
|
+
----------------------------------------------------------
|
688
|
+
HumanizeSetTest: test_should_return_a_humanized_set_string
|
689
|
+
----------------------------------------------------------
|
690
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
691
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
692
|
+
-------------------------------------------------------------------------------------------
|
693
|
+
HumanizeApproximateIntervalTest: test_should_return_a_humanized_approximate_interval_string
|
694
|
+
-------------------------------------------------------------------------------------------
|
695
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
696
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
697
|
+
----------------------------------------------------------------
|
698
|
+
HumanizeDecadeTest: test_should_return_a_humanized_decade_string
|
699
|
+
----------------------------------------------------------------
|
700
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
701
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
702
|
+
----------------------------------------------------------
|
703
|
+
HumanizeSetTest: test_should_return_a_humanized_set_string
|
704
|
+
----------------------------------------------------------
|
705
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
706
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
707
|
+
------------------------------------------------------------------
|
708
|
+
HumanizeCenturyTest: test_should_return_a_humanized_century_string
|
709
|
+
------------------------------------------------------------------
|
710
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
711
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
712
|
+
--------------------------------------------------------------------
|
713
|
+
HumanizeIntervalTest: test_should_return_a_humanized_interval_string
|
714
|
+
--------------------------------------------------------------------
|
715
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
716
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
717
|
+
----------------------------------------------------------------
|
718
|
+
HumanizeSeasonTest: test_should_return_a_humanized_season_string
|
719
|
+
----------------------------------------------------------------
|
720
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
721
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
722
|
+
---------------------------------------------------------------------------------------------------
|
723
|
+
HumanizeUnspecifiedYearIsoDateTest: test_should_return_a_humanized_unspecified_year_ISO_date_string
|
724
|
+
---------------------------------------------------------------------------------------------------
|
725
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
726
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
727
|
+
----------------------------
|
728
|
+
EdtfHumanizeTest: test_truth
|
729
|
+
----------------------------
|
730
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
731
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
732
|
+
--------------------------------------------------------------------------------------
|
733
|
+
HumanizeUncertainIsoDateTest: test_should_return_a_humanized_uncertain_ISO_date_string
|
734
|
+
--------------------------------------------------------------------------------------
|
735
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
736
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
737
|
+
------------------------------------------------------------------
|
738
|
+
HumanizeUnknownTest: test_should_return_a_humanized_unknown_string
|
739
|
+
------------------------------------------------------------------
|
740
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
741
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
742
|
+
-------------------------------------------------------------------
|
743
|
+
HumanizeIsoDateTest: test_should_return_a_humanized_ISO_date_string
|
744
|
+
-------------------------------------------------------------------
|
745
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
746
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
747
|
+
-------------------------------------------------------------------------------------------
|
748
|
+
HumanizeApproximateIntervalTest: test_should_return_a_humanized_approximate_interval_string
|
749
|
+
-------------------------------------------------------------------------------------------
|
750
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
751
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
752
|
+
----------------------------------------------------------------
|
753
|
+
HumanizeDecadeTest: test_should_return_a_humanized_decade_string
|
754
|
+
----------------------------------------------------------------
|
755
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
756
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
757
|
+
--------------------------------------------------------------------
|
758
|
+
HumanizeIntervalTest: test_should_return_a_humanized_interval_string
|
759
|
+
--------------------------------------------------------------------
|
760
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
761
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
762
|
+
-------------------------------------------------------------------------------------------
|
763
|
+
HumanizeApproximateIntervalTest: test_should_return_a_humanized_approximate_interval_string
|
764
|
+
-------------------------------------------------------------------------------------------
|
765
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
766
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
767
|
+
------------------------------------------------------------------
|
768
|
+
HumanizeCenturyTest: test_should_return_a_humanized_century_string
|
769
|
+
------------------------------------------------------------------
|
770
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
771
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
772
|
+
--------------------------------------------------------------------------------------
|
773
|
+
HumanizeUncertainIsoDateTest: test_should_return_a_humanized_uncertain_ISO_date_string
|
774
|
+
--------------------------------------------------------------------------------------
|
775
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
776
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
777
|
+
-------------------------------------------------------------------
|
778
|
+
HumanizeIsoDateTest: test_should_return_a_humanized_ISO_date_string
|
779
|
+
-------------------------------------------------------------------
|
780
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
781
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
782
|
+
------------------------------------------------------------------
|
783
|
+
HumanizeUnknownTest: test_should_return_a_humanized_unknown_string
|
784
|
+
------------------------------------------------------------------
|
785
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
786
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
787
|
+
----------------------------------------------------------------
|
788
|
+
HumanizeSeasonTest: test_should_return_a_humanized_season_string
|
789
|
+
----------------------------------------------------------------
|
790
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
791
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
792
|
+
----------------------------
|
793
|
+
EdtfHumanizeTest: test_truth
|
794
|
+
----------------------------
|
795
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
796
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
797
|
+
----------------------------------------------------------
|
798
|
+
HumanizeSetTest: test_should_return_a_humanized_set_string
|
799
|
+
----------------------------------------------------------
|
800
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
801
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
802
|
+
----------------------------------------------------------------
|
803
|
+
HumanizeDecadeTest: test_should_return_a_humanized_decade_string
|
804
|
+
----------------------------------------------------------------
|
805
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
806
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
807
|
+
---------------------------------------------------------------------------------------------------
|
808
|
+
HumanizeUnspecifiedYearIsoDateTest: test_should_return_a_humanized_unspecified_year_ISO_date_string
|
809
|
+
---------------------------------------------------------------------------------------------------
|
810
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
811
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
812
|
+
---------------------------------------------------------------------------------------------------
|
813
|
+
HumanizeUnspecifiedYearIsoDateTest: test_should_return_a_humanized_unspecified_year_ISO_date_string
|
814
|
+
---------------------------------------------------------------------------------------------------
|
815
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
816
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
817
|
+
-------------------------------------------------------------------
|
818
|
+
HumanizeIsoDateTest: test_should_return_a_humanized_ISO_date_string
|
819
|
+
-------------------------------------------------------------------
|
820
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
821
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
822
|
+
------------------------------------------------------------------
|
823
|
+
HumanizeUnknownTest: test_should_return_a_humanized_unknown_string
|
824
|
+
------------------------------------------------------------------
|
825
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
826
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
827
|
+
----------------------------
|
828
|
+
EdtfHumanizeTest: test_truth
|
829
|
+
----------------------------
|
830
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
831
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
832
|
+
----------------------------------------------------------------
|
833
|
+
HumanizeSeasonTest: test_should_return_a_humanized_season_string
|
834
|
+
----------------------------------------------------------------
|
835
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
836
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
837
|
+
--------------------------------------------------------------------
|
838
|
+
HumanizeIntervalTest: test_should_return_a_humanized_interval_string
|
839
|
+
--------------------------------------------------------------------
|
840
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
841
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
842
|
+
------------------------------------------------------------------
|
843
|
+
HumanizeCenturyTest: test_should_return_a_humanized_century_string
|
844
|
+
------------------------------------------------------------------
|
845
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
846
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
847
|
+
--------------------------------------------------------------------------------------
|
848
|
+
HumanizeUncertainIsoDateTest: test_should_return_a_humanized_uncertain_ISO_date_string
|
849
|
+
--------------------------------------------------------------------------------------
|
850
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
851
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
852
|
+
----------------------------------------------------------------
|
853
|
+
HumanizeDecadeTest: test_should_return_a_humanized_decade_string
|
854
|
+
----------------------------------------------------------------
|
855
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
856
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
857
|
+
----------------------------------------------------------
|
858
|
+
HumanizeSetTest: test_should_return_a_humanized_set_string
|
859
|
+
----------------------------------------------------------
|
860
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
861
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
862
|
+
-------------------------------------------------------------------------------------------
|
863
|
+
HumanizeApproximateIntervalTest: test_should_return_a_humanized_approximate_interval_string
|
864
|
+
-------------------------------------------------------------------------------------------
|
865
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
data/test/edtf_humanize_test.rb
CHANGED
@@ -68,3 +68,11 @@ class HumanizeSetTest < ActiveSupport::TestCase
|
|
68
68
|
assert_equal "1980, 1981 or 1983", d.humanize
|
69
69
|
end
|
70
70
|
end
|
71
|
+
|
72
|
+
class HumanizeUnknownTest < ActiveSupport::TestCase
|
73
|
+
test "should return a humanized unknown string" do
|
74
|
+
d = Date.edtf('uuuu')
|
75
|
+
assert_equal "unknown", d.humanize
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: edtf-humanize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cory Lown
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -53,13 +53,14 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: This gem adds a humanize method to EDTF::Decade, EDTF::Interval, EDTF::Set,
|
56
|
-
EDTF::Season, and Date (ISO 8601 compliant) objects.
|
56
|
+
EDTF::Season, EDTF::Unknown, and Date (ISO 8601 compliant) objects.
|
57
57
|
email:
|
58
58
|
- cory.lown@duke.edu
|
59
59
|
executables: []
|
60
60
|
extensions: []
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
|
+
- LICENSE.txt
|
63
64
|
- Rakefile
|
64
65
|
- lib/edtf-humanize.rb
|
65
66
|
- lib/edtf/humanize.rb
|
@@ -70,6 +71,7 @@ files:
|
|
70
71
|
- lib/edtf/humanize/iso_date.rb
|
71
72
|
- lib/edtf/humanize/season.rb
|
72
73
|
- lib/edtf/humanize/set.rb
|
74
|
+
- lib/edtf/humanize/unknown.rb
|
73
75
|
- lib/edtf/humanize/version.rb
|
74
76
|
- lib/tasks/edtf_humanize_tasks.rake
|
75
77
|
- test/dummy/README.rdoc
|