lathe 0.0.5 → 0.0.6

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.
@@ -0,0 +1,13 @@
1
+ # -*- coding: utf-8 -*-
2
+ module <%=package%>
3
+ module ApiV1<%=app_name.camelize%>
4
+ def self.included(api)
5
+ # api.namespace :<%=app_name%> do
6
+ # get nil do
7
+ # ret = {:apps=> MiniApp.apps}
8
+ # end
9
+ #end
10
+ end
11
+
12
+ end
13
+ end
@@ -6,6 +6,9 @@ jQuery(function($) {
6
6
  },
7
7
  afterRender: function() {},
8
8
  validate: function() {
9
+ if(this.$(".title").val().length==0){
10
+ return "标题不允许为空";
11
+ }
9
12
  return true;
10
13
  },
11
14
  getProperties: function() {
@@ -3,8 +3,15 @@ module <%=package%>
3
3
  class Engine < ::Rails::Engine
4
4
  isolate_namespace <%=package%>
5
5
 
6
- initializer 'my_engine.interact_with_routes', :after=> :disable_dependency_loading do |app|
7
- MiniApp.apps << {:title=>"发出考题",:create_url=>'/mini_apps/<%=app_name%>s/new',:icon=> ActionController::Base.helpers.asset_path('<%=app_path%>/<%=app_name%>_white.png')}
6
+ initializer '<%=app_path%>.before' do |app|
7
+ #这儿的代码在rails启动是最先执行
8
+ end
9
+ initializer '<%=app_path%>.behind', :after=> :disable_dependency_loading do |app|
10
+ #这儿的代码在rails加载器都加载完成以后再执行
11
+ #加载API
12
+ ::API.send "include",<%=package%>::ApiV1<%=app_name.camelize%>
13
+
14
+ MiniApp.apps << {:title=>I18n.t("ft.mini_app.<%=app_name%>.app_text"),:create_url=>'/mini_apps/<%=app_name%>s/new',:icon=> ActionController::Base.helpers.asset_path('<%=app_path%>/<%=app_name%>_white.png')}
8
15
  end
9
16
  end
10
17
  end
data/lib/lathe/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lathe
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lathe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-09 00:00:00.000000000 Z
12
+ date: 2013-09-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -48,6 +48,7 @@ files:
48
48
  - lib/lathe/generators/mini_app/Gemfile
49
49
  - lib/lathe/generators/mini_app/README.md.tt
50
50
  - lib/lathe/generators/mini_app/Rakefile.tt
51
+ - lib/lathe/generators/mini_app/app/api/%app_path%/api_v1_%app_name%.rb.tt
51
52
  - lib/lathe/generators/mini_app/app/assets/images/%app_path%/%app_name%.png
52
53
  - lib/lathe/generators/mini_app/app/assets/images/%app_path%/%app_name%_active.png
53
54
  - lib/lathe/generators/mini_app/app/assets/images/%app_path%/%app_name%_white.png