ns_service_pack 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History +10 -0
- data/README +35 -0
- data/lib/ns_service_pack/version.rb +1 -1
- data/ns_service_pack.gemspec +2 -1
- metadata +5 -4
data/History
ADDED
data/README
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
##==NS Service Pack使用指南
|
2
|
+
|
3
|
+
*1 在你的rails3项目Gemfile中引入
|
4
|
+
gem 'ns_service_pack'
|
5
|
+
|
6
|
+
*2 启动控制台 rails c,运行命令
|
7
|
+
NsServicePack.install
|
8
|
+
|
9
|
+
*3 配置项目中的常量数据
|
10
|
+
|
11
|
+
*4 配置项目的controllers和models
|
12
|
+
4.1)在ApplicationController子类,如:
|
13
|
+
class AddressesController < ApplicationController
|
14
|
+
...
|
15
|
+
def model_class
|
16
|
+
#引用的模型类,是ActiveRecord的子类
|
17
|
+
end
|
18
|
+
|
19
|
+
def index
|
20
|
+
#定义@conds实例变量,组织查询的条件,默认支持分页
|
21
|
+
end
|
22
|
+
...
|
23
|
+
end
|
24
|
+
|
25
|
+
4.2)在ActiveRecord::Base子类中,如Customer
|
26
|
+
class Customer < ActiveRecord::Base
|
27
|
+
...
|
28
|
+
def self.field_maps
|
29
|
+
#buz-db field mapping
|
30
|
+
end
|
31
|
+
def self.get_map_value(k, v)
|
32
|
+
#value mapping
|
33
|
+
end
|
34
|
+
...
|
35
|
+
end
|
data/ns_service_pack.gemspec
CHANGED
@@ -10,11 +10,12 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.email = %q{cao7113@gmail.com}
|
11
11
|
s.files = Dir.glob("lib/**/*") + Dir.glob("config/**/*") + [
|
12
12
|
"Gemfile",
|
13
|
+
"History",
|
13
14
|
"ns_service_pack.gemspec",
|
14
15
|
"Rakefile",
|
15
16
|
"README"
|
16
17
|
]
|
17
|
-
s.homepage = %q{http://weibo.com/cao7113}
|
18
|
+
s.homepage = %q{http://github.com/cao7113?weibo=http://weibo.com/cao7113}
|
18
19
|
s.rdoc_options = ["--charset=UTF-8"]
|
19
20
|
s.require_paths = ["lib"]
|
20
21
|
s.summary = %q{common package for our service pack}
|
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.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -15,7 +15,7 @@ date: 2011-11-15 00:00:00.000000000Z
|
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
18
|
-
requirement: &
|
18
|
+
requirement: &82993730 !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: *82993730
|
27
27
|
description: Service package for our service lier
|
28
28
|
email: cao7113@gmail.com
|
29
29
|
executables: []
|
@@ -42,10 +42,11 @@ files:
|
|
42
42
|
- config/code_hashes.yml.sample
|
43
43
|
- config/initializers/ns_service_pack.rb
|
44
44
|
- Gemfile
|
45
|
+
- History
|
45
46
|
- ns_service_pack.gemspec
|
46
47
|
- Rakefile
|
47
48
|
- README
|
48
|
-
homepage: http://weibo.com/cao7113
|
49
|
+
homepage: http://github.com/cao7113?weibo=http://weibo.com/cao7113
|
49
50
|
licenses: []
|
50
51
|
post_install_message:
|
51
52
|
rdoc_options:
|