edtf-humanize 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/edtf/humanize/interval.rb +5 -1
- data/lib/edtf/humanize/version.rb +1 -1
- data/test/dummy/log/test.log +99 -0
- data/test/edtf_humanize_test.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc28b955897a0df8fd98e869bfe4cbafc60c850b
|
4
|
+
data.tar.gz: 67ceb2bfccf3438ec328f4dfc491bf7e3005e800
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e7a12162e59e2defc0726c7cf4fef39d99a14759bdc5333e18b3981df9a944eca2a950066880f8cc8ce9eb625d131f54517c95fa221b215110467f73596607d
|
7
|
+
data.tar.gz: e915de6f949f2de23aef3d4970e012751eaa5d7a3b240263876ad89bb1e7823ba96ffce2fa3217ee875622d348061c25174dc121b92f2a20ab90dab18b87fec7
|
@@ -5,7 +5,11 @@ module Edtf
|
|
5
5
|
include Edtf::Humanize::Formats
|
6
6
|
|
7
7
|
def humanize
|
8
|
-
"#{apply_if_approximate(self.from)}
|
8
|
+
"#{apply_if_approximate(self.from)}"\
|
9
|
+
"#{simple_date_format(self.from)}"\
|
10
|
+
"#{Edtf::Humanize.configuration.interval_connector}"\
|
11
|
+
"#{apply_if_approximate(self.to)}"\
|
12
|
+
"#{simple_date_format(self.to)}"
|
9
13
|
end
|
10
14
|
|
11
15
|
private
|
data/test/dummy/log/test.log
CHANGED
@@ -1039,3 +1039,102 @@ HumanizeSetTest: test_should_return_a_humanized_set_string
|
|
1039
1039
|
HumanizeUnknownTest: test_should_return_a_humanized_unknown_string
|
1040
1040
|
------------------------------------------------------------------
|
1041
1041
|
[1m[35m (0.0ms)[0m rollback transaction
|
1042
|
+
--------------------------------------------------------------------------------------
|
1043
|
+
HumanizeUncertainIsoDateTest: test_should_return_a_humanized_uncertain_ISO_date_string
|
1044
|
+
--------------------------------------------------------------------------------------
|
1045
|
+
------------------------------------------------------------------
|
1046
|
+
HumanizeCenturyTest: test_should_return_a_humanized_century_string
|
1047
|
+
------------------------------------------------------------------
|
1048
|
+
----------------------------------------------------------------
|
1049
|
+
HumanizeSeasonTest: test_should_return_a_humanized_season_string
|
1050
|
+
----------------------------------------------------------------
|
1051
|
+
---------------------------------------------------------------------------------------------------
|
1052
|
+
HumanizeUnspecifiedYearIsoDateTest: test_should_return_a_humanized_unspecified_year_ISO_date_string
|
1053
|
+
---------------------------------------------------------------------------------------------------
|
1054
|
+
----------------------------------------------------------
|
1055
|
+
HumanizeSetTest: test_should_return_a_humanized_set_string
|
1056
|
+
----------------------------------------------------------
|
1057
|
+
-------------------------------------------------------------------------------------------
|
1058
|
+
HumanizeApproximateIntervalTest: test_should_return_a_humanized_approximate_interval_string
|
1059
|
+
-------------------------------------------------------------------------------------------
|
1060
|
+
--------------------------------------------------------------------
|
1061
|
+
HumanizeIntervalTest: test_should_return_a_humanized_interval_string
|
1062
|
+
--------------------------------------------------------------------
|
1063
|
+
----------------------------
|
1064
|
+
EdtfHumanizeTest: test_truth
|
1065
|
+
----------------------------
|
1066
|
+
-------------------------------------------------------------------
|
1067
|
+
HumanizeIsoDateTest: test_should_return_a_humanized_ISO_date_string
|
1068
|
+
-------------------------------------------------------------------
|
1069
|
+
----------------------------------------------------------------
|
1070
|
+
HumanizeDecadeTest: test_should_return_a_humanized_decade_string
|
1071
|
+
----------------------------------------------------------------
|
1072
|
+
------------------------------------------------------------------
|
1073
|
+
HumanizeUnknownTest: test_should_return_a_humanized_unknown_string
|
1074
|
+
------------------------------------------------------------------
|
1075
|
+
----------------------------------------------------------
|
1076
|
+
HumanizeSetTest: test_should_return_a_humanized_set_string
|
1077
|
+
----------------------------------------------------------
|
1078
|
+
----------------------------
|
1079
|
+
EdtfHumanizeTest: test_truth
|
1080
|
+
----------------------------
|
1081
|
+
--------------------------------------------------------------------------------------
|
1082
|
+
HumanizeUncertainIsoDateTest: test_should_return_a_humanized_uncertain_ISO_date_string
|
1083
|
+
--------------------------------------------------------------------------------------
|
1084
|
+
---------------------------------------------------------------------------------------------------
|
1085
|
+
HumanizeUnspecifiedYearIsoDateTest: test_should_return_a_humanized_unspecified_year_ISO_date_string
|
1086
|
+
---------------------------------------------------------------------------------------------------
|
1087
|
+
------------------------------------------------------------------
|
1088
|
+
HumanizeCenturyTest: test_should_return_a_humanized_century_string
|
1089
|
+
------------------------------------------------------------------
|
1090
|
+
----------------------------------------------------------------
|
1091
|
+
HumanizeSeasonTest: test_should_return_a_humanized_season_string
|
1092
|
+
----------------------------------------------------------------
|
1093
|
+
-------------------------------------------------------------------------------------------
|
1094
|
+
HumanizeApproximateIntervalTest: test_should_return_a_humanized_approximate_interval_string
|
1095
|
+
-------------------------------------------------------------------------------------------
|
1096
|
+
--------------------------------------------------------------------
|
1097
|
+
HumanizeIntervalTest: test_should_return_a_humanized_interval_string
|
1098
|
+
--------------------------------------------------------------------
|
1099
|
+
----------------------------------------------------------------
|
1100
|
+
HumanizeDecadeTest: test_should_return_a_humanized_decade_string
|
1101
|
+
----------------------------------------------------------------
|
1102
|
+
-------------------------------------------------------------------
|
1103
|
+
HumanizeIsoDateTest: test_should_return_a_humanized_ISO_date_string
|
1104
|
+
-------------------------------------------------------------------
|
1105
|
+
------------------------------------------------------------------
|
1106
|
+
HumanizeUnknownTest: test_should_return_a_humanized_unknown_string
|
1107
|
+
------------------------------------------------------------------
|
1108
|
+
------------------------------------------------------------------
|
1109
|
+
HumanizeUnknownTest: test_should_return_a_humanized_unknown_string
|
1110
|
+
------------------------------------------------------------------
|
1111
|
+
---------------------------------------------------------------------------------------------------
|
1112
|
+
HumanizeUnspecifiedYearIsoDateTest: test_should_return_a_humanized_unspecified_year_ISO_date_string
|
1113
|
+
---------------------------------------------------------------------------------------------------
|
1114
|
+
----------------------------------------------------------------
|
1115
|
+
HumanizeSeasonTest: test_should_return_a_humanized_season_string
|
1116
|
+
----------------------------------------------------------------
|
1117
|
+
-------------------------------------------------------------------------------------------
|
1118
|
+
HumanizeApproximateIntervalTest: test_should_return_a_humanized_approximate_interval_string
|
1119
|
+
-------------------------------------------------------------------------------------------
|
1120
|
+
----------------------------------------------------------
|
1121
|
+
HumanizeSetTest: test_should_return_a_humanized_set_string
|
1122
|
+
----------------------------------------------------------
|
1123
|
+
--------------------------------------------------------------------
|
1124
|
+
HumanizeIntervalTest: test_should_return_a_humanized_interval_string
|
1125
|
+
--------------------------------------------------------------------
|
1126
|
+
----------------------------
|
1127
|
+
EdtfHumanizeTest: test_truth
|
1128
|
+
----------------------------
|
1129
|
+
--------------------------------------------------------------------------------------
|
1130
|
+
HumanizeUncertainIsoDateTest: test_should_return_a_humanized_uncertain_ISO_date_string
|
1131
|
+
--------------------------------------------------------------------------------------
|
1132
|
+
------------------------------------------------------------------
|
1133
|
+
HumanizeCenturyTest: test_should_return_a_humanized_century_string
|
1134
|
+
------------------------------------------------------------------
|
1135
|
+
----------------------------------------------------------------
|
1136
|
+
HumanizeDecadeTest: test_should_return_a_humanized_decade_string
|
1137
|
+
----------------------------------------------------------------
|
1138
|
+
-------------------------------------------------------------------
|
1139
|
+
HumanizeIsoDateTest: test_should_return_a_humanized_ISO_date_string
|
1140
|
+
-------------------------------------------------------------------
|
data/test/edtf_humanize_test.rb
CHANGED
@@ -30,7 +30,7 @@ end
|
|
30
30
|
class HumanizeApproximateIntervalTest < ActiveSupport::TestCase
|
31
31
|
test "should return a humanized approximate interval string" do
|
32
32
|
d = Date.edtf('1970~/1980~')
|
33
|
-
assert_equal "circa 1970 to 1980", d.humanize
|
33
|
+
assert_equal "circa 1970 to circa 1980", d.humanize
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
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.7
|
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-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: edtf
|