ns_service_pack 0.0.3 → 0.0.4
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/History +13 -0
- data/README +11 -2
- data/lib/ns_service_pack/version.rb +1 -1
- metadata +3 -3
data/History
CHANGED
|
@@ -8,3 +8,16 @@
|
|
|
8
8
|
|
|
9
9
|
#==0.0.2
|
|
10
10
|
* 增加使用指南README,测试gem更新
|
|
11
|
+
|
|
12
|
+
#==0.0.3 20111116
|
|
13
|
+
* 添加自动生成可配置的field_map,在控制台中运行:
|
|
14
|
+
Customer.dump_field_map
|
|
15
|
+
* 自动生成为客户端new资源时的初始结构
|
|
16
|
+
Customer.dump_init_hash
|
|
17
|
+
生成到<app>/data/customer_field.yml中
|
|
18
|
+
|
|
19
|
+
* 统一用建立在CodeHash基础上的GlobalConst管理常量数据
|
|
20
|
+
<app>/config/code_hashes/**/*.yml文件会被初始化时加载
|
|
21
|
+
* 将对ApplicationController和ActiveRecord::Base的扩展放在
|
|
22
|
+
initializers/ns_service_pack.rb中,便于项目做定制
|
|
23
|
+
|
data/README
CHANGED
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
##==NS Service Pack使用指南
|
|
2
2
|
|
|
3
|
-
*1
|
|
3
|
+
*1 在rails3项目Gemfile中引入
|
|
4
4
|
gem 'ns_service_pack'
|
|
5
5
|
|
|
6
6
|
*2 启动控制台 rails c,运行命令
|
|
7
7
|
NsServicePack.install
|
|
8
8
|
|
|
9
9
|
*3 配置项目中的常量数据
|
|
10
|
+
config/code_hashes/**/*.yml中数据会作为CodeHash加载
|
|
11
|
+
可在控制台下用以下命令辅助生成:
|
|
12
|
+
<ModelName>.dump_field_map
|
|
13
|
+
生成buz-db field_mapping,可配置, --><app>/config/code_hashes
|
|
14
|
+
|
|
15
|
+
<ModelName>.dump_init_hash
|
|
16
|
+
为远端客户端生成初始项hash结构,--> <app>/data/*.yml
|
|
17
|
+
常量的使用:
|
|
18
|
+
GlobalConst.ns_statuses[key_or_value]
|
|
10
19
|
|
|
11
20
|
*4 配置项目的controllers和models
|
|
12
21
|
4.1)在ApplicationController子类,如:
|
|
13
22
|
class AddressesController < ApplicationController
|
|
14
23
|
...
|
|
15
24
|
def model_class
|
|
16
|
-
#引用的模型类,是ActiveRecord
|
|
25
|
+
#引用的模型类,是ActiveRecord::Base子类
|
|
17
26
|
end
|
|
18
27
|
|
|
19
28
|
def index
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ns_service_pack
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -15,7 +15,7 @@ date: 2011-11-16 00:00:00.000000000Z
|
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: rails
|
|
18
|
-
requirement: &
|
|
18
|
+
requirement: &85806930 !ruby/object:Gem::Requirement
|
|
19
19
|
none: false
|
|
20
20
|
requirements:
|
|
21
21
|
- - ! '>='
|
|
@@ -23,7 +23,7 @@ dependencies:
|
|
|
23
23
|
version: 3.1.0
|
|
24
24
|
type: :development
|
|
25
25
|
prerelease: false
|
|
26
|
-
version_requirements: *
|
|
26
|
+
version_requirements: *85806930
|
|
27
27
|
description: Service package for our service lier
|
|
28
28
|
email: cao7113@gmail.com
|
|
29
29
|
executables: []
|