jt-mobile-kit 1.1.8 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/jt +1 -42
- data/lib/jt-mobile-kit/project_creator.rb +46 -0
- data/lib/jt-mobile-kit/root_templates/gitignore +2 -0
- data/lib/jt-mobile-kit/version.rb +1 -1
- data/lib/jt-mobile-kit/www_rb/templates/.gitignore +2 -1
- data/lib/jt-mobile-kit/www_rb/templates/Gemfile +3 -1
- data/lib/jt-mobile-kit/www_rb/templates/Rakefile +5 -0
- data/lib/jt-mobile-kit/www_rb/templates/js/routes.js +2 -1
- metadata +13 -23
- checksums.yaml +0 -15
- data/bin/jtc +0 -4
- data/lib/jt-mobile-kit/gen_controller/gen_controller.rb +0 -18
- data/lib/jt-mobile-kit/gen_controller/templates/controller.js.erb +0 -6
- data/lib/jt-mobile-kit/gen_routing/gen_routing.rb +0 -20
- data/lib/jt-mobile-kit/gen_routing/templates/routing.js.erb +0 -5
- data/lib/jt-mobile-kit/gen_view/gen_view.rb +0 -19
- data/lib/jt-mobile-kit/gen_view/templates/view.haml.erb +0 -0
- data/lib/jt-mobile-kit/jt_generator.rb +0 -31
- data/lib/jt-mobile-kit/scaffold/scaffold.thor +0 -20
- data/lib/jt-mobile-kit/scaffold/templates/_list_page.haml +0 -7
- data/lib/jt-mobile-kit/scaffold/templates/_page.haml +0 -4
- data/lib/jt-mobile-kit/scaffold/templates/md_class.js +0 -9
- data/lib/jt-mobile-kit/scaffold/templates/md_list_class.js +0 -9
- data/lib/jt-mobile-kit/www_rb/templates/Gemfile.lock +0 -16
data/bin/jt
CHANGED
@@ -1,46 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require "thor"
|
5
|
-
require "thor/group"
|
6
|
-
|
7
|
-
@@project_name = ARGV[0]
|
8
|
-
|
9
|
-
class ProjectCreator < Thor::Group
|
10
|
-
include Thor::Actions
|
11
|
-
source_root File.expand_path("../", __FILE__)
|
12
|
-
def initialize(args=[], options={}, config={})
|
13
|
-
super
|
14
|
-
self.destination_root= ""
|
15
|
-
end
|
16
|
-
|
17
|
-
def create_project
|
18
|
-
empty_directory @@project_name
|
19
|
-
end
|
20
|
-
|
21
|
-
def create_www_folder
|
22
|
-
inside @@project_name do
|
23
|
-
run "jt_www_rb init"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def create_app_project
|
28
|
-
inside @@project_name do
|
29
|
-
run "jt_android init"
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def create_server_project
|
34
|
-
inside @@project_name do
|
35
|
-
run "rails new server"
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
def create_server_project_mobile_web_soft_link
|
40
|
-
inside "#{@@project_name}/server/public" do
|
41
|
-
run "ln -s ../../app/assets/www/ mobile"
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
3
|
+
require 'jt-mobile-kit/project_creator'
|
45
4
|
|
46
5
|
ProjectCreator.start
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require "thor"
|
2
|
+
require "thor/group"
|
3
|
+
|
4
|
+
class ProjectCreator < Thor::Group
|
5
|
+
include Thor::Actions
|
6
|
+
source_root File.expand_path("../root_templates", __FILE__)
|
7
|
+
|
8
|
+
argument :project_name
|
9
|
+
|
10
|
+
def initialize(args=[], options={}, config={})
|
11
|
+
super
|
12
|
+
self.destination_root= ""
|
13
|
+
end
|
14
|
+
|
15
|
+
def create_project
|
16
|
+
empty_directory project_name
|
17
|
+
end
|
18
|
+
|
19
|
+
def create_gitignore
|
20
|
+
copy_file "gitignore", "#{project_name}/.gitignore"
|
21
|
+
end
|
22
|
+
|
23
|
+
def create_www_folder
|
24
|
+
inside project_name do
|
25
|
+
run "jt_www_rb init"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def create_app_project
|
30
|
+
inside project_name do
|
31
|
+
run "jt_android init"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def create_server_project
|
36
|
+
inside project_name do
|
37
|
+
run "rails new server"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def create_server_project_mobile_web_soft_link
|
42
|
+
inside "#{project_name}/server/public" do
|
43
|
+
run "ln -s ../../app/assets/www/ mobile"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -3,9 +3,11 @@ source 'https://rubygems.org'
|
|
3
3
|
gem 'haml'
|
4
4
|
gem 'thor'
|
5
5
|
gem 'jt-partial', "1.0.3"
|
6
|
-
gem 'moode-haml-toolkit', "1.
|
6
|
+
gem 'moode-haml-toolkit', "1.2.0"
|
7
|
+
gem 'rake'
|
7
8
|
gem 'sinatra'
|
8
9
|
gem 'rack'
|
10
|
+
gem 'jt-mobile-kit-generator'
|
9
11
|
|
10
12
|
gem 'moode-haml-component-angular', "0.0.3"
|
11
13
|
|
metadata
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jt-mobile-kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- jtong
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2013-
|
12
|
+
date: 2013-12-31 00:00:00.000000000 Z
|
12
13
|
dependencies: []
|
13
|
-
description:
|
14
|
+
description: ' description'
|
14
15
|
email:
|
15
16
|
- jtong.kata@gmail.com
|
16
17
|
executables:
|
@@ -19,7 +20,6 @@ executables:
|
|
19
20
|
- jt_js
|
20
21
|
- jt_www_js
|
21
22
|
- jt_www_rb
|
22
|
-
- jtc
|
23
23
|
extensions: []
|
24
24
|
extra_rdoc_files: []
|
25
25
|
files:
|
@@ -30,7 +30,6 @@ files:
|
|
30
30
|
- bin/jt_new_js
|
31
31
|
- bin/jt_www_js
|
32
32
|
- bin/jt_www_rb
|
33
|
-
- bin/jtc
|
34
33
|
- lib/jt-mobile-kit/android/android.rb
|
35
34
|
- lib/jt-mobile-kit/android/templates/AndroidManifest.xml
|
36
35
|
- lib/jt-mobile-kit/android/templates/ant.properties
|
@@ -106,18 +105,8 @@ files:
|
|
106
105
|
- lib/jt-mobile-kit/android/templates/src/com/moode/sms/utils/Constants.java
|
107
106
|
- lib/jt-mobile-kit/android/templates/src/com/moode/sms/utils/JsonUtils.java
|
108
107
|
- lib/jt-mobile-kit/android/templates/src/com/moode/sms/utils/StringUtils.java
|
109
|
-
- lib/jt-mobile-kit/
|
110
|
-
- lib/jt-mobile-kit/
|
111
|
-
- lib/jt-mobile-kit/gen_routing/gen_routing.rb
|
112
|
-
- lib/jt-mobile-kit/gen_routing/templates/routing.js.erb
|
113
|
-
- lib/jt-mobile-kit/gen_view/gen_view.rb
|
114
|
-
- lib/jt-mobile-kit/gen_view/templates/view.haml.erb
|
115
|
-
- lib/jt-mobile-kit/jt_generator.rb
|
116
|
-
- lib/jt-mobile-kit/scaffold/scaffold.thor
|
117
|
-
- lib/jt-mobile-kit/scaffold/templates/_list_page.haml
|
118
|
-
- lib/jt-mobile-kit/scaffold/templates/_page.haml
|
119
|
-
- lib/jt-mobile-kit/scaffold/templates/md_class.js
|
120
|
-
- lib/jt-mobile-kit/scaffold/templates/md_list_class.js
|
108
|
+
- lib/jt-mobile-kit/project_creator.rb
|
109
|
+
- lib/jt-mobile-kit/root_templates/gitignore
|
121
110
|
- lib/jt-mobile-kit/version.rb
|
122
111
|
- lib/jt-mobile-kit/www_js/templates/_index.jade
|
123
112
|
- lib/jt-mobile-kit/www_js/templates/_pages.jade
|
@@ -154,7 +143,6 @@ files:
|
|
154
143
|
- lib/jt-mobile-kit/www_rb/templates/config.ru
|
155
144
|
- lib/jt-mobile-kit/www_rb/templates/css/index.css
|
156
145
|
- lib/jt-mobile-kit/www_rb/templates/Gemfile
|
157
|
-
- lib/jt-mobile-kit/www_rb/templates/Gemfile.lock
|
158
146
|
- lib/jt-mobile-kit/www_rb/templates/hamls/index.haml
|
159
147
|
- lib/jt-mobile-kit/www_rb/templates/img/logo.png
|
160
148
|
- lib/jt-mobile-kit/www_rb/templates/js/application.js
|
@@ -183,6 +171,7 @@ files:
|
|
183
171
|
- lib/jt-mobile-kit/www_rb/templates/lib/js/jt-notify.js/notify.js
|
184
172
|
- lib/jt-mobile-kit/www_rb/templates/lib/js/underscore/underscore-min.js
|
185
173
|
- lib/jt-mobile-kit/www_rb/templates/lib/js/zepto/zepto.js
|
174
|
+
- lib/jt-mobile-kit/www_rb/templates/Rakefile
|
186
175
|
- lib/jt-mobile-kit/www_rb/templates/spec/function_spec.js
|
187
176
|
- lib/jt-mobile-kit/www_rb/templates/spec/helper.js
|
188
177
|
- lib/jt-mobile-kit/www_rb/templates/spec/index.js
|
@@ -205,25 +194,26 @@ files:
|
|
205
194
|
- lib/jt-mobile-kit/www_rb/templates/res/.gitkeep
|
206
195
|
homepage: ''
|
207
196
|
licenses: []
|
208
|
-
metadata: {}
|
209
197
|
post_install_message:
|
210
198
|
rdoc_options: []
|
211
199
|
require_paths:
|
212
200
|
- lib
|
213
201
|
required_ruby_version: !ruby/object:Gem::Requirement
|
202
|
+
none: false
|
214
203
|
requirements:
|
215
|
-
- -
|
204
|
+
- - '>='
|
216
205
|
- !ruby/object:Gem::Version
|
217
206
|
version: '0'
|
218
207
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
208
|
+
none: false
|
219
209
|
requirements:
|
220
|
-
- -
|
210
|
+
- - '>='
|
221
211
|
- !ruby/object:Gem::Version
|
222
212
|
version: '0'
|
223
213
|
requirements: []
|
224
214
|
rubyforge_project:
|
225
|
-
rubygems_version:
|
215
|
+
rubygems_version: 1.8.28
|
226
216
|
signing_key:
|
227
|
-
specification_version:
|
217
|
+
specification_version: 3
|
228
218
|
summary: summary
|
229
219
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
OTM2ZDE2NDU4ZGNhNmU5MGJhMTU2ZTM2M2M4OGUxY2RmMmVjNzhhZQ==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
ZDk3MGQ2ZTBlMTNhYjhmYjRhNTkwMjg5MTU4YWQ4YzBmMzYzODdlOA==
|
7
|
-
!binary "U0hBNTEy":
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
MTFiZDNjNWQzODM3Y2Y3OTU3Y2MyM2ExMTAwYWI1Y2NjYzcyMDkyNjkzMDIz
|
10
|
-
NzJkYjZlMGM4MTQzYjFkN2I1NGE0ZjI3MzE4OGJmNTRiYmQwNDU2YjBiYWIx
|
11
|
-
YmU4MGYwY2FhOWUxOTljMmI5MDQzNjc1YWNmYWFkNDFiZDg3YjU=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
YWE3MTI2ZDNhMjM2NGRkMTI1M2NhZGQ4OWM5OTYyNGU4ZDkzNmM4NzE3YTI2
|
14
|
-
NmIxZmQwNzNkODNlMDEwOWU2YTZjM2QzNWMwM2VmMGM4OTA4NTUzNDViMDIw
|
15
|
-
OTRlOGEyZGRlYmEwZjViMzJmMWVjNzcwNzVkMDdhNTAzOGQzOTA=
|
data/bin/jtc
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'erb'
|
2
|
-
|
3
|
-
class GenController < Thor::Group
|
4
|
-
include Thor::Actions
|
5
|
-
source_root File.expand_path("../templates", __FILE__)
|
6
|
-
def initialize(args=[], options={}, config={})
|
7
|
-
super
|
8
|
-
self.destination_root= ""
|
9
|
-
end
|
10
|
-
|
11
|
-
argument :name
|
12
|
-
|
13
|
-
def gen
|
14
|
-
controller_name = name
|
15
|
-
content = ERB.new File.read("#{GenController.source_root}/controller.js.erb")
|
16
|
-
create_file "js/controller/#{controller_name}_controller.js", content.result(binding)
|
17
|
-
end
|
18
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'erb'
|
2
|
-
|
3
|
-
class GenRouting < Thor::Group
|
4
|
-
include Thor::Actions
|
5
|
-
source_root File.expand_path("../templates", __FILE__)
|
6
|
-
def initialize(args=[], options={}, config={})
|
7
|
-
super
|
8
|
-
self.destination_root= ""
|
9
|
-
end
|
10
|
-
|
11
|
-
argument :name
|
12
|
-
|
13
|
-
def gen
|
14
|
-
page_name = name
|
15
|
-
controller_name = name
|
16
|
-
content = ERB.new File.read("#{GenRouting.source_root}/routing.js.erb")
|
17
|
-
inject_into_file "js/routes.js",content.result(binding), :after => "//routing generate"
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'erb'
|
2
|
-
|
3
|
-
class GenView < Thor::Group
|
4
|
-
include Thor::Actions
|
5
|
-
source_root File.expand_path("../templates", __FILE__)
|
6
|
-
def initialize(args=[], options={}, config={})
|
7
|
-
super
|
8
|
-
self.destination_root= ""
|
9
|
-
end
|
10
|
-
|
11
|
-
argument :name
|
12
|
-
|
13
|
-
def gen
|
14
|
-
page_name = name
|
15
|
-
content = ERB.new File.read("#{GenView.source_root}/view.haml.erb")
|
16
|
-
create_file "hamls/pages/#{page_name}_page.haml", content.result(binding)
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
File without changes
|
@@ -1,31 +0,0 @@
|
|
1
|
-
require 'thor'
|
2
|
-
require 'jt-mobile-kit/gen_controller/gen_controller'
|
3
|
-
require 'jt-mobile-kit/gen_view/gen_view'
|
4
|
-
require 'jt-mobile-kit/gen_routing/gen_routing'
|
5
|
-
|
6
|
-
|
7
|
-
class JtGenerator < Thor
|
8
|
-
include Thor::Actions
|
9
|
-
source_root File.expand_path("../", __FILE__)
|
10
|
-
|
11
|
-
register GenController, :controller, "controller", "Generate Controller"
|
12
|
-
register GenView, :view, "view", "Generate view"
|
13
|
-
register GenRouting, :routing, "routing", "Generate routing"
|
14
|
-
|
15
|
-
desc :scaffold, "generate scaffold"
|
16
|
-
def scaffold name
|
17
|
-
GenController.start [name]
|
18
|
-
GenView.start [name]
|
19
|
-
GenRouting.start [name]
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
class JtMain < Thor
|
26
|
-
register JtGenerator, :g, "g", "Generate something"
|
27
|
-
end
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
@@ -1,20 +0,0 @@
|
|
1
|
-
class Scaffold < Thor
|
2
|
-
include Thor::Actions
|
3
|
-
source_root File.expand_path("../templates", __FILE__)
|
4
|
-
def initialize(args=[], options={}, config={})
|
5
|
-
super
|
6
|
-
self.destination_root= ""
|
7
|
-
end
|
8
|
-
|
9
|
-
desc "define_page_md_class", "create domain with class"
|
10
|
-
def define_page_md_class
|
11
|
-
scaffold_name = "test"
|
12
|
-
restful_url = "/#{scaffold_name}.json"
|
13
|
-
content = eval( File.read "templates/md_list_class.js" )
|
14
|
-
|
15
|
-
#content = content.gsub "@{scaffold_name}", scaffold_name
|
16
|
-
#content = content.gsub "@{restful_url}", "/#{scaffold_name}.json"
|
17
|
-
#create_file "public/mobile/js/#{scaffold_name}.js", content
|
18
|
-
puts content
|
19
|
-
end
|
20
|
-
end
|