flexirest 1.2.3 → 1.2.4
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/CHANGELOG.md +8 -0
- data/lib/flexirest/base.rb +1 -1
- data/lib/flexirest/configuration.rb +1 -0
- data/lib/flexirest/version.rb +1 -1
- data/spec/lib/base_spec.rb +5 -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: 04507c65528dc2baef055f9197b1f12edd3492e4
|
4
|
+
data.tar.gz: f32284067eabbb3b79e4e010351f8787de76dbcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c1981bf74912034111120ad4054d87d1e18ee0be4725af68ca29e13e03cd80ec88423682ca2ad6d239e2a770ed92fd400a262ae463d0aaf2057211bd6883228
|
7
|
+
data.tar.gz: 66c1e257611da681ef0d99e8d3c80995591922a3c1aec4b1517144540e3b68d0c8764036aeef80057139a610c87e3612b5739bbfe410b57559402313babe184e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.2.4 / 1.2.3
|
4
|
+
|
5
|
+
Bugfixes:
|
6
|
+
|
7
|
+
- Allows setting of base_url, username, password and request_body_type in a project-specific base class, then using that default in subclasses.
|
8
|
+
- Strings of four digits in the response are no longer treated as (invalid) dates (thanks Tom Hoen)
|
9
|
+
- 1.2.3 was pushed without a successful Travis build
|
10
|
+
|
3
11
|
## 1.2.2
|
4
12
|
|
5
13
|
Features:
|
data/lib/flexirest/base.rb
CHANGED
@@ -26,7 +26,7 @@ module Flexirest
|
|
26
26
|
attribute_name = attribute_name.to_sym
|
27
27
|
if attribute_value.to_s[/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6]))))$/]
|
28
28
|
@attributes[attribute_name] = Date.parse(attribute_value)
|
29
|
-
elsif attribute_value.to_s[/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)
|
29
|
+
elsif attribute_value.to_s[/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)$/]
|
30
30
|
@attributes[attribute_name] = DateTime.parse(attribute_value)
|
31
31
|
else
|
32
32
|
@attributes[attribute_name] = attribute_value
|
data/lib/flexirest/version.rb
CHANGED
data/spec/lib/base_spec.rb
CHANGED
@@ -94,6 +94,11 @@ describe Flexirest::Base do
|
|
94
94
|
expect(client["test"]).to eq(d)
|
95
95
|
end
|
96
96
|
|
97
|
+
it "should allow strings of 4 digits and not intepret them as dates" do
|
98
|
+
client = EmptyExample.new(:test => "2015")
|
99
|
+
expect(client["test"]).to be_an_instance_of(String)
|
100
|
+
end
|
101
|
+
|
97
102
|
it "should store attributes set using missing method names and mark them as dirty" do
|
98
103
|
client = EmptyExample.new()
|
99
104
|
client.test = "Something"
|