resty-generators 0.4.0 → 0.5.0
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/generators/resty/model/model_generator.rb +1 -1
- data/lib/generators/resty/scaffold/scaffold_generator.rb +47 -30
- data/lib/generators/resty/setup/setup_generator.rb +11 -0
- data/lib/generators/resty/setup/templates/ActivityPlace.java +8 -4
- data/lib/generators/resty/setup/templates/ActivityPlaceActivityMapper.java +3 -3
- data/lib/generators/resty/setup/templates/BreadCrumbsPanel.java +3 -6
- data/lib/generators/resty/setup/templates/EntryPoint.java +22 -17
- data/lib/generators/resty/setup/templates/LoginPlace.java +3 -3
- data/lib/generators/resty/setup/templates/LoginView.ui.xml +1 -1
- data/lib/generators/resty/setup/templates/Mavenfile +1 -1
- data/lib/generators/resty/setup/templates/MenuPanel.java +27 -0
- data/lib/generators/resty/setup/templates/PlaceHistoryMapper.java +37 -4
- data/lib/generators/resty/setup/templates/SessionActivityPlaceActivityMapper.java +10 -10
- data/lib/generators/resty/setup/templates/authentication.rb +1 -1
- data/lib/generators/resty/templates/Activity.java +63 -17
- data/lib/generators/resty/templates/Model.java +2 -2
- data/lib/generators/resty/templates/Place.java +7 -2
- data/lib/generators/resty/templates/PlaceTokenizer.java +3 -8
- data/lib/generators/resty/templates/RestService.java +4 -2
- data/lib/generators/resty/templates/View.java +16 -2
- data/lib/generators/resty/templates/View.ui.xml +31 -19
- data/lib/generators/resty/templates/ViewImpl.java +131 -28
- data/lib/resty-generators.rb +1 -1
- metadata +9 -12
- data/lib/generators/resty/setup/templates/monkey_patch.rb +0 -47
- data/lib/generators/resty/templates/ColumnDefinitionsImpl.java +0 -24
- data/lib/resty/child_path.rb +0 -31
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: resty-generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.5.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- mkristian
|
@@ -10,21 +10,21 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-09-05 00:00:00 +05:30
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
|
-
name: ixtlan-
|
17
|
+
name: ixtlan-generators
|
18
18
|
prerelease: false
|
19
19
|
requirement: &id001 !ruby/object:Gem::Requirement
|
20
20
|
none: false
|
21
21
|
requirements:
|
22
22
|
- - ">="
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version: 0.
|
24
|
+
version: 0.1.1
|
25
25
|
- - <
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.
|
27
|
+
version: 0.1.99999
|
28
28
|
type: :runtime
|
29
29
|
version_requirements: *id001
|
30
30
|
- !ruby/object:Gem::Dependency
|
@@ -95,7 +95,6 @@ files:
|
|
95
95
|
- MIT-LICENSE
|
96
96
|
- lib/resty-generators.rb
|
97
97
|
- lib/resty/resty_railtie.rb
|
98
|
-
- lib/resty/child_path.rb
|
99
98
|
- lib/generators/resty/base.rb
|
100
99
|
- lib/generators/resty/controller/controller_generator.rb
|
101
100
|
- lib/generators/resty/model/model_generator.rb
|
@@ -115,7 +114,6 @@ files:
|
|
115
114
|
- lib/generators/resty/setup/templates/User.java
|
116
115
|
- lib/generators/resty/setup/templates/authentication.rb
|
117
116
|
- lib/generators/resty/setup/templates/ActivityPlace.java
|
118
|
-
- lib/generators/resty/setup/templates/monkey_patch.rb
|
119
117
|
- lib/generators/resty/setup/templates/LoginViewImpl.java
|
120
118
|
- lib/generators/resty/setup/templates/LoginPlace.java
|
121
119
|
- lib/generators/resty/setup/templates/session.rb
|
@@ -127,12 +125,12 @@ files:
|
|
127
125
|
- lib/generators/resty/setup/templates/SessionRestService.java
|
128
126
|
- lib/generators/resty/setup/templates/Mavenfile
|
129
127
|
- lib/generators/resty/setup/templates/PlaceHistoryMapper.java
|
128
|
+
- lib/generators/resty/setup/templates/MenuPanel.java
|
130
129
|
- lib/generators/resty/scaffold/scaffold_generator.rb
|
131
130
|
- lib/generators/resty/templates/PlaceTokenizer.java
|
132
131
|
- lib/generators/resty/templates/Model.java
|
133
132
|
- lib/generators/resty/templates/View.java
|
134
133
|
- lib/generators/resty/templates/View.ui.xml
|
135
|
-
- lib/generators/resty/templates/ColumnDefinitionsImpl.java
|
136
134
|
- lib/generators/resty/templates/RestService.java
|
137
135
|
- lib/generators/resty/templates/Activity.java
|
138
136
|
- lib/generators/resty/templates/ViewImpl.java
|
@@ -142,9 +140,8 @@ homepage: http://github.com/mkristian/ixtlan-guard
|
|
142
140
|
licenses:
|
143
141
|
- MIT-LICENSE
|
144
142
|
post_install_message:
|
145
|
-
rdoc_options:
|
146
|
-
|
147
|
-
- README.textile
|
143
|
+
rdoc_options: []
|
144
|
+
|
148
145
|
require_paths:
|
149
146
|
- lib
|
150
147
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -165,6 +162,6 @@ rubyforge_project:
|
|
165
162
|
rubygems_version: 1.5.1
|
166
163
|
signing_key:
|
167
164
|
specification_version: 3
|
168
|
-
summary:
|
165
|
+
summary: rails3 generators which use restygwt to communicate from GWT with rails
|
169
166
|
test_files: []
|
170
167
|
|
@@ -1,47 +0,0 @@
|
|
1
|
-
require 'action_dispatch/http/request'
|
2
|
-
require 'active_support/core_ext/hash/indifferent_access'
|
3
|
-
|
4
|
-
module ActionDispatch
|
5
|
-
class ParamsParser
|
6
|
-
|
7
|
-
alias :call_old :call
|
8
|
-
def call(env)
|
9
|
-
request = Request.new(env)
|
10
|
-
mime_type = content_type_from_legacy_post_data_format_header(env) ||
|
11
|
-
request.content_mime_type
|
12
|
-
|
13
|
-
case mime_type
|
14
|
-
when Mime::JSON
|
15
|
-
data = ActiveSupport::JSON.decode(request.body)
|
16
|
-
request.body.rewind if request.body.respond_to?(:rewind)
|
17
|
-
data = {:_json => data} unless data.is_a?(Hash)
|
18
|
-
env["action_dispatch.request.request_parameters"] = {:json => data}.with_indifferent_access
|
19
|
-
|
20
|
-
@app.call(env)
|
21
|
-
else
|
22
|
-
call_old(env)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
module ActionController
|
29
|
-
class Base
|
30
|
-
def from_java(map)
|
31
|
-
result = map.dup
|
32
|
-
map.each do |k,v|
|
33
|
-
result.delete(k)
|
34
|
-
result[k.underscore] = v.is_a?(Hash) ? from_java(v) : v
|
35
|
-
end
|
36
|
-
result
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
::ActionController::Base.send(:before_filter) do
|
42
|
-
json = params.delete(:json)
|
43
|
-
if json
|
44
|
-
params[params[:controller].singularize] = from_java(json)
|
45
|
-
end
|
46
|
-
true
|
47
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
package <%= views_package %>;
|
2
|
-
|
3
|
-
import java.util.ArrayList;
|
4
|
-
|
5
|
-
import <%= gwt_rails_package %>.ColumnDefinition;
|
6
|
-
import <%= models_package %>.<%= class_name %>;
|
7
|
-
|
8
|
-
@SuppressWarnings("serial")
|
9
|
-
public class <%= class_name.pluralize %>ColumnDefinitionsImpl extends
|
10
|
-
ArrayList<ColumnDefinition<<%= class_name %>>> {
|
11
|
-
|
12
|
-
protected <%= class_name.pluralize %>ColumnDefinitionsImpl() {
|
13
|
-
|
14
|
-
this.add(new ColumnDefinition<<%= class_name %>>() {
|
15
|
-
public void render(<%= class_name %> c, StringBuilder sb) {
|
16
|
-
sb.append("<div id='" + c.id + "'>" + "TODO" + "</div>");
|
17
|
-
}
|
18
|
-
|
19
|
-
public boolean isClickable() {
|
20
|
-
return true;
|
21
|
-
}
|
22
|
-
});
|
23
|
-
}
|
24
|
-
}
|
data/lib/resty/child_path.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
module Resty
|
2
|
-
class ChildPath
|
3
|
-
def initialize(app, rootpath)
|
4
|
-
@app = app
|
5
|
-
@rootpath = rootpath
|
6
|
-
end
|
7
|
-
|
8
|
-
def call(env)
|
9
|
-
is_json = (env['CONTENT_TYPE'] || env['HTTP_ACCEPT']) =~ /^application\/json/
|
10
|
-
is_child = false
|
11
|
-
['REQUEST_PATH','PATH_INFO','REQUEST_URI','SCRIPT_NAME'].each do |key|
|
12
|
-
if(is_json || env[key] =~ /\.json([?].*)?$/)
|
13
|
-
is_json = true
|
14
|
-
value = env[key]
|
15
|
-
if value
|
16
|
-
is_child = is_child || value =~ /^\/#{@rootpath}\//
|
17
|
-
value.gsub!(/^\/#{@rootpath}\//, "/")
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
status, headers, response = @app.call(env)
|
22
|
-
if is_child && headers['Location']
|
23
|
-
uri = URI(headers['Location'])
|
24
|
-
uri.path.gsub!(/^\//, "/#{@rootpath}/")
|
25
|
-
headers['Location'] = uri.to_s
|
26
|
-
end
|
27
|
-
headers['Content-Type'] = 'application/json' if is_json
|
28
|
-
[status, headers, response]
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|