resty-generators 0.3.2 → 0.3.3
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.
- data/lib/resty/resty_railtie.rb +9 -19
- metadata +2 -2
data/lib/resty/resty_railtie.rb
CHANGED
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
require 'rails'
|
|
2
2
|
|
|
3
3
|
module Resty
|
|
4
|
-
|
|
5
|
-
module TimeFormat
|
|
6
|
-
|
|
7
|
-
def as_json(options = nil)
|
|
8
|
-
strftime('%Y-%m-%dT%H:%M:%S.') + ("%06d" % usec) + strftime('%z')
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def as_html(options = nil)
|
|
12
|
-
strftime('%Y-%m-%d %H:%M:%S.') + ("%06d" % usec)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
end
|
|
16
|
-
|
|
17
4
|
class RestyRailtie < Rails::Railtie
|
|
18
5
|
|
|
19
6
|
config.generators do
|
|
@@ -32,16 +19,19 @@ module Resty
|
|
|
32
19
|
|
|
33
20
|
# get the time/date format right ;-) and match it with resty
|
|
34
21
|
class DateTime
|
|
35
|
-
|
|
22
|
+
def as_json(options = nil)
|
|
23
|
+
strftime('%Y-%m-%dT%H:%M:%S.') + ("%06d" % usec) + strftime('%z')
|
|
24
|
+
end
|
|
36
25
|
end
|
|
37
26
|
class ActiveSupport::TimeWithZone
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
include TimeFormat
|
|
27
|
+
def as_json(options = nil)
|
|
28
|
+
strftime('%Y-%m-%dT%H:%M:%S.') + ("%06d" % usec) + strftime('%z')
|
|
29
|
+
end
|
|
42
30
|
end
|
|
43
31
|
class Time
|
|
44
|
-
|
|
32
|
+
def as_json(options = nil)
|
|
33
|
+
strftime('%Y-%m-%dT%H:%M:%S.') + ("%06d" % usec) + strftime('%z')
|
|
34
|
+
end
|
|
45
35
|
end
|
|
46
36
|
end
|
|
47
37
|
end
|
metadata
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: resty-generators
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease:
|
|
5
|
-
version: 0.3.
|
|
5
|
+
version: 0.3.3
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- mkristian
|
|
@@ -21,7 +21,7 @@ dependencies:
|
|
|
21
21
|
requirements:
|
|
22
22
|
- - ">="
|
|
23
23
|
- !ruby/object:Gem::Version
|
|
24
|
-
version: 0.4.
|
|
24
|
+
version: 0.4.1
|
|
25
25
|
- - <
|
|
26
26
|
- !ruby/object:Gem::Version
|
|
27
27
|
version: 0.4.99999
|