resty-generators 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/resty/resty_railtie.rb +9 -19
  2. metadata +2 -2
@@ -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
- include TimeFormat
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
- include TimeFormat
39
- end
40
- class Date
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
- include TimeFormat
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.2
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.0
24
+ version: 0.4.1
25
25
  - - <
26
26
  - !ruby/object:Gem::Version
27
27
  version: 0.4.99999