ruby-extjs 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +84 -0
- data/Rakefile +1 -0
- data/bin/ruby-extjs +11 -0
- data/lib/USAGE +59 -0
- data/lib/prepare.rb +226 -0
- data/lib/ruby-extjs/templates/app.erb +39 -0
- data/lib/ruby-extjs/templates/controller/controller.erb +33 -0
- data/lib/ruby-extjs/templates/model/model.erb +20 -0
- data/lib/ruby-extjs/templates/store/store.erb +12 -0
- data/lib/ruby-extjs/templates/util/Controller.js +165 -0
- data/lib/ruby-extjs/templates/util/Defined.js +79 -0
- data/lib/ruby-extjs/templates/util/List.js +108 -0
- data/lib/ruby-extjs/templates/util/Notification.js +392 -0
- data/lib/ruby-extjs/templates/util/Override.js +165 -0
- data/lib/ruby-extjs/templates/util/Shortcut.js +213 -0
- data/lib/ruby-extjs/templates/util/Store.js +35 -0
- data/lib/ruby-extjs/templates/util/TabCloseMenu.js +141 -0
- data/lib/ruby-extjs/templates/util/TextMask.js +423 -0
- data/lib/ruby-extjs/templates/util/Util.js +441 -0
- data/lib/ruby-extjs/templates/util/function.js +26 -0
- data/lib/ruby-extjs/templates/view/edit.erb +133 -0
- data/lib/ruby-extjs/templates/view/filtro.erb +111 -0
- data/lib/ruby-extjs/templates/view/list.erb +31 -0
- data/lib/ruby-extjs/version.rb +3 -0
- data/lib/ruby-extjs.rb +97 -0
- data/ruby-extjs.gemspec +19 -0
- metadata +33 -3
@@ -0,0 +1,31 @@
|
|
1
|
+
/**
|
2
|
+
* @Autor: Maciel Sousa
|
3
|
+
* @Email: macielcr7@gmail.com
|
4
|
+
**/
|
5
|
+
<%
|
6
|
+
@a = @opcoes.size
|
7
|
+
@b = 1
|
8
|
+
%>
|
9
|
+
Ext.define('<%=@nameApp%>.view.<%=@modulo.downcase%>.List', {
|
10
|
+
extend: 'Abstract.util.List',
|
11
|
+
alias: 'widget.<%=@modulo.downcase%>list',
|
12
|
+
|
13
|
+
id: 'Grid<%=@modulo.capitalize%>',
|
14
|
+
modulo: '<%=@modulo.downcase%>',
|
15
|
+
store: '<%=@modulo.capitalize%>',
|
16
|
+
|
17
|
+
columns: [
|
18
|
+
<%
|
19
|
+
@opcoes.each do |key, value|
|
20
|
+
@c = typeList(value)
|
21
|
+
%>
|
22
|
+
{
|
23
|
+
xtype: 'gridcolumn',
|
24
|
+
dataIndex: '<%=key%>',
|
25
|
+
text: '<%=key.capitalize%>',<% if @c[0]==true %>
|
26
|
+
renderer: <%=@c[2]%>,<% end %>
|
27
|
+
width: 140
|
28
|
+
}<% if @a != @b %>,<% @b = @b + 1 end %><% end %>
|
29
|
+
]
|
30
|
+
|
31
|
+
});
|
data/lib/ruby-extjs.rb
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
require "ruby-extjs/version"
|
2
|
+
require "prepare"
|
3
|
+
require "rubygems"
|
4
|
+
require "thor"
|
5
|
+
require "fileutils"
|
6
|
+
|
7
|
+
|
8
|
+
module Ruby
|
9
|
+
class Extjs < Thor
|
10
|
+
|
11
|
+
argument :nameApp , :type => :string, :default => "MacielSousa"
|
12
|
+
argument :generateTipo , :type => :string, :required => false
|
13
|
+
argument :modulo , :type => :string, :required => false
|
14
|
+
argument :opcoes , :type => :hash , :required => false
|
15
|
+
|
16
|
+
map '--g' => :generate
|
17
|
+
map '--v' => :version
|
18
|
+
map '--u' => :usage
|
19
|
+
|
20
|
+
desc 'version', 'Versao Atual RubyExtJs'
|
21
|
+
def version
|
22
|
+
puts "Ruby-ExtJs: #{RubyExtjs::VERSION}"
|
23
|
+
end
|
24
|
+
|
25
|
+
desc 'generate', 'Generate ExtJs Parse Hash-Arguments'
|
26
|
+
def generate
|
27
|
+
@prepare = Prepare.new(nameApp, generateTipo, modulo, opcoes)
|
28
|
+
@prepare.verifyArguments
|
29
|
+
end
|
30
|
+
|
31
|
+
desc 'usage', 'Modo de Usar'
|
32
|
+
def usage
|
33
|
+
puts "
|
34
|
+
/**
|
35
|
+
*
|
36
|
+
* Modo de Usar
|
37
|
+
*
|
38
|
+
* Model
|
39
|
+
* ruby-extjs --g MacielSousa model Contatos id:int
|
40
|
+
* contato:string email:string
|
41
|
+
*
|
42
|
+
* Controller
|
43
|
+
* ruby-extjs --g MacielSousa controller Contatos
|
44
|
+
* ch:id dr:contato cb:true
|
45
|
+
*
|
46
|
+
* Store
|
47
|
+
* ruby-extjs --g MacielSousa store Contatos
|
48
|
+
*
|
49
|
+
* View
|
50
|
+
* ruby-extjs --g MacielSousa view Contatos id:ch
|
51
|
+
* nome:no email:ve telefone:m_fone
|
52
|
+
*
|
53
|
+
* App
|
54
|
+
* ruby-extjs --g MacielSousa app
|
55
|
+
*
|
56
|
+
* Parametros
|
57
|
+
* 1 - nameApp
|
58
|
+
* 2 - generateTipo
|
59
|
+
* * app
|
60
|
+
* * controller
|
61
|
+
* * model
|
62
|
+
* * store
|
63
|
+
* * view
|
64
|
+
* 3 - modulo ~> Nome da tabela Ex.: Contato
|
65
|
+
* 4 - options
|
66
|
+
*
|
67
|
+
* * generateTipo => App
|
68
|
+
*
|
69
|
+
* * generateTipo => Controller
|
70
|
+
* ch:id dr:nome cb: true
|
71
|
+
* Obs.:
|
72
|
+
* ch -> Chave Primaria
|
73
|
+
* dr -> Ex.: Deseja deletar: record.get('nome')?
|
74
|
+
* cb -> se o modulo tera um storeCombo
|
75
|
+
*
|
76
|
+
* * generateTipo => Model
|
77
|
+
* id:int nome:string email:string telefone:string
|
78
|
+
*
|
79
|
+
* * generateTipo => Store
|
80
|
+
*
|
81
|
+
* * generateTipo => View
|
82
|
+
* id:ch nome:no email:ve telefone:m_fone
|
83
|
+
*
|
84
|
+
* Obs.:
|
85
|
+
* key => nome do campo
|
86
|
+
* values =>
|
87
|
+
* no -> sem condincoes
|
88
|
+
* ch -> chave primaria
|
89
|
+
* ve -> valid Email
|
90
|
+
* tp -> campo de senha
|
91
|
+
* r_{modulo} -> combobox {modulo} => tabela referencia
|
92
|
+
* m_{tipo} -> mascara {tipo} => fone,cep,cpf,cnpj,money
|
93
|
+
*
|
94
|
+
**/"
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
data/ruby-extjs.gemspec
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'ruby-extjs/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "ruby-extjs"
|
8
|
+
gem.version = RubyExtJs::VERSION
|
9
|
+
gem.authors = ["macielcr7"]
|
10
|
+
gem.email = ["macielcr7@gmail.com"]
|
11
|
+
gem.description = %q{Gera ExtJs4 para Ruby MVC}
|
12
|
+
gem.summary = %q{Gera ExtJs4 para Ruby MVC}
|
13
|
+
gem.homepage = "https://github.com/macielcr7/ruby-extjs"
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-extjs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,10 +14,40 @@ dependencies: []
|
|
14
14
|
description: Gera ExtJs4 para Ruby MVC
|
15
15
|
email:
|
16
16
|
- macielcr7@gmail.com
|
17
|
-
executables:
|
17
|
+
executables:
|
18
|
+
- ruby-extjs
|
18
19
|
extensions: []
|
19
20
|
extra_rdoc_files: []
|
20
|
-
files:
|
21
|
+
files:
|
22
|
+
- .gitignore
|
23
|
+
- Gemfile
|
24
|
+
- LICENSE.txt
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
27
|
+
- bin/ruby-extjs
|
28
|
+
- lib/USAGE
|
29
|
+
- lib/prepare.rb
|
30
|
+
- lib/ruby-extjs.rb
|
31
|
+
- lib/ruby-extjs/templates/app.erb
|
32
|
+
- lib/ruby-extjs/templates/controller/controller.erb
|
33
|
+
- lib/ruby-extjs/templates/model/model.erb
|
34
|
+
- lib/ruby-extjs/templates/store/store.erb
|
35
|
+
- lib/ruby-extjs/templates/util/Controller.js
|
36
|
+
- lib/ruby-extjs/templates/util/Defined.js
|
37
|
+
- lib/ruby-extjs/templates/util/List.js
|
38
|
+
- lib/ruby-extjs/templates/util/Notification.js
|
39
|
+
- lib/ruby-extjs/templates/util/Override.js
|
40
|
+
- lib/ruby-extjs/templates/util/Shortcut.js
|
41
|
+
- lib/ruby-extjs/templates/util/Store.js
|
42
|
+
- lib/ruby-extjs/templates/util/TabCloseMenu.js
|
43
|
+
- lib/ruby-extjs/templates/util/TextMask.js
|
44
|
+
- lib/ruby-extjs/templates/util/Util.js
|
45
|
+
- lib/ruby-extjs/templates/util/function.js
|
46
|
+
- lib/ruby-extjs/templates/view/edit.erb
|
47
|
+
- lib/ruby-extjs/templates/view/filtro.erb
|
48
|
+
- lib/ruby-extjs/templates/view/list.erb
|
49
|
+
- lib/ruby-extjs/version.rb
|
50
|
+
- ruby-extjs.gemspec
|
21
51
|
homepage: https://github.com/macielcr7/ruby-extjs
|
22
52
|
licenses: []
|
23
53
|
post_install_message:
|