resty-generators 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
data/lib/resty/resty_railtie.rb
CHANGED
@@ -1,6 +1,19 @@
|
|
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
|
+
|
4
17
|
class RestyRailtie < Rails::Railtie
|
5
18
|
|
6
19
|
config.generators do
|
@@ -19,24 +32,16 @@ module Resty
|
|
19
32
|
|
20
33
|
# get the time/date format right ;-) and match it with resty
|
21
34
|
class DateTime
|
22
|
-
|
23
|
-
strftime('%Y-%m-%dT%H:%M:%S.%N%z')
|
24
|
-
end
|
35
|
+
include TimeFormat
|
25
36
|
end
|
26
37
|
class ActiveSupport::TimeWithZone
|
27
|
-
|
28
|
-
strftime('%Y-%m-%dT%H:%M:%S.%N%z')
|
29
|
-
end
|
38
|
+
include TimeFormat
|
30
39
|
end
|
31
40
|
class Date
|
32
|
-
|
33
|
-
strftime('%Y-%m-%dT%H:%M:%S.%N%z')
|
34
|
-
end
|
41
|
+
include TimeFormat
|
35
42
|
end
|
36
43
|
class Time
|
37
|
-
|
38
|
-
strftime('%Y-%m-%dT%H:%M:%S.%N%z')
|
39
|
-
end
|
44
|
+
include TimeFormat
|
40
45
|
end
|
41
46
|
end
|
42
47
|
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.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- mkristian
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-07-
|
13
|
+
date: 2011-07-24 00:00:00 +05:30
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -108,14 +108,12 @@ files:
|
|
108
108
|
- lib/generators/resty/setup/templates/GinModule.java
|
109
109
|
- lib/generators/resty/setup/templates/sessions_controller.rb
|
110
110
|
- lib/generators/resty/setup/templates/LoginView.ui.xml
|
111
|
-
- lib/generators/resty/setup/templates/empty.css
|
112
111
|
- lib/generators/resty/setup/templates/page.html
|
113
112
|
- lib/generators/resty/setup/templates/LoginActivity.java
|
114
113
|
- lib/generators/resty/setup/templates/ActivityPlaceActivityMapper.java
|
115
114
|
- lib/generators/resty/setup/templates/BreadCrumbsPanel.java
|
116
115
|
- lib/generators/resty/setup/templates/User.java
|
117
116
|
- lib/generators/resty/setup/templates/authentication.rb
|
118
|
-
- lib/generators/resty/setup/templates/initializer.rb
|
119
117
|
- lib/generators/resty/setup/templates/ActivityPlace.java
|
120
118
|
- lib/generators/resty/setup/templates/monkey_patch.rb
|
121
119
|
- lib/generators/resty/setup/templates/LoginViewImpl.java
|
@@ -1,17 +0,0 @@
|
|
1
|
-
.notice
|
2
|
-
{
|
3
|
-
background-color:lightgoldenRodYellow;
|
4
|
-
border:1px solid darkgoldenrod;
|
5
|
-
color:darkgoldenrod;
|
6
|
-
margin-left:35%;
|
7
|
-
margin-right:35%;
|
8
|
-
padding-left:5%;
|
9
|
-
width:30%;
|
10
|
-
padding-right:5%;
|
11
|
-
padding-top:.5em;
|
12
|
-
padding-bottom:.5em;
|
13
|
-
overflow:auto;;
|
14
|
-
position:absolute;
|
15
|
-
top:3em;
|
16
|
-
opacity:.9;
|
17
|
-
}
|
@@ -1,28 +0,0 @@
|
|
1
|
-
require 'resty/child_path'
|
2
|
-
|
3
|
-
Rails.application.config.middleware.use Resty::ChildPath, '<%= application_name.underscore %>'
|
4
|
-
|
5
|
-
ActiveRecord::Base.include_root_in_json = false
|
6
|
-
|
7
|
-
# get the time/date format right ;-)
|
8
|
-
class DateTime
|
9
|
-
def as_json(options = nil)
|
10
|
-
strftime('%Y-%m-%dT%H:%M:%S.%s%z')
|
11
|
-
end
|
12
|
-
end
|
13
|
-
class ActiveSupport::TimeWithZone
|
14
|
-
def as_json(options = nil)
|
15
|
-
strftime('%Y-%m-%dT%H:%M:%S.%s%z')
|
16
|
-
end
|
17
|
-
end
|
18
|
-
class Date
|
19
|
-
def as_json(options = nil)
|
20
|
-
strftime('%Y-%m-%dT%H:%M:%S.%s%z')
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
class Time
|
25
|
-
def as_json(options = nil)
|
26
|
-
strftime('%Y-%m-%dT%H:%M:%S.%s%z')
|
27
|
-
end
|
28
|
-
end
|