ns_service_pack 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,5 +1,9 @@
1
1
  #==============History:
2
2
 
3
+ #==0.1.3
4
+ * 为内置视图添加layout
5
+ * 添加对以前版本的兼容(load mapping时的键值变化)
6
+
3
7
  #==0.1.2
4
8
  * 测试和添加部分文档
5
9
 
data/README.rdoc CHANGED
@@ -10,41 +10,43 @@
10
10
  * 宿主应用的发布接口管理和测试
11
11
 
12
12
  == TODO LIST
13
-
13
+ * 将源码共享到本地svn上
14
14
  * REST接口测试平台开发
15
15
  如何用get请求模拟post请求?
16
16
  * 规划文档和内容调整
17
17
  * 写完整测试
18
18
  * index默认查询条件加入,传入条件的merge(目前已提供传入条件的精确搜索)
19
+ * 接口可见性优化,发布出来的接口加上前缀/ns/interfaces ?
19
20
 
20
21
  == 使用指南
21
22
 
22
- *1 在rails3项目中使用,命令行执行:
23
- gem install ns_service_pack
24
- nsp install
25
- bundle install
23
+ * 在rails3项目中使用,命令行执行:
24
+ `gem install ns_service_pack`
25
+ `nsp install`
26
+ `bundle install`
26
27
 
27
- *2 为某资源生成有service支持的scaffold,命令行:
28
- rake g ns:scaffold
28
+ * 为某资源生成有service支持的scaffold,命令行:
29
+ `rake g ns:scaffold`
29
30
 
30
- *提示:
31
- 常量引用和转换:GlobalConst.ns_statuses[key_or_value]
32
- 内置接口: /interfaces, /mappings, /constants
31
+ * 提示:
32
+ 常量引用和转换:GlobalConst.ns_statuses[key_or_value]
33
+ 内置接口: /interfaces, /mappings, /constants
33
34
 
34
35
  == 项目引用0.0.x到0.1.x升级帮助(仅需四步,5~10分钟,绝对无痛哦!)
35
36
 
36
37
  * 获取最新版本: gem install ns_service_pack
37
38
  * rails项目根目录下: nsp install && bundle install(此步检查下Gemfile,确保引用最新,或gem 'ns_service_pack', '~>0.1')
38
- * Models中明确引用: include FieldMapping
39
+ * 相关Models中明确引用: include FieldMapping
39
40
  * ApplicationController或!子类!中添加引用: include ControllerServicable
40
- = 验证是否成功?
41
- * 访问: http://xxx/,非生产环境会重定向到/interfaces, 点击示例中的链接(动态生成)
42
- = 相关背景
41
+
42
+ # 验证是否成功?
43
+ * 访问: http://service_post:port/, 非生产环境会重定向到/interfaces, 点击示例中的链接(动态生成)
44
+ # 相关背景
43
45
  * 已停止支持 nclient gem, 相关功能会融合在nsp中
44
46
  * 扩展为rails的engine,包含自己的生成器等
45
47
  * 以后有时间时,可以开发内部接口测试和性能监控平台,进行有效的集中管理和共有问题处理;对数据库层进行更好的封装
46
48
 
47
- == 相关问题更新和反馈
49
+ == 问题和反馈
48
50
 
49
51
  == 版本历史
50
52
 
data/Rakefile CHANGED
@@ -22,6 +22,7 @@ Jeweler::Tasks.new do |gem|
22
22
  gem.description = %Q{abstract some common pattern to service pack}
23
23
  gem.email = "cao7113@hotmail.com"
24
24
  gem.authors = ["Caory, Shang, Geogeous"]
25
+ gem.extra_rdoc_files = %w(README.rdoc CHANGELOG LICENSE.txt)
25
26
  # dependencies defined in Gemfile
26
27
  end
27
28
  Jeweler::RubygemsDotOrgTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -1,5 +1,7 @@
1
1
  #encoding: utf-8
2
2
  class Ns::InfoController < ApplicationController
3
+ layout "ns_service_pack"
4
+
3
5
  unloadable #??? 什么意思?
4
6
  #动态查看该模块发布接口列表
5
7
  def interfaces
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Ns Service Pack--Service基础管理</title>
5
+ <%= stylesheet_link_tag "application" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+ <%= yield %>
11
+ <hr/>
12
+ <div>
13
+ Report bugs: <%=link_to "http://weibo.com/cao7113", "http://weibo.com/cao7113", :target=>"_blank"%>
14
+ or Email: cao7113@hotmail.com! Powered by caory!
15
+ </div>
16
+ </body>
17
+ </html>
data/bin/nsp CHANGED
@@ -80,7 +80,7 @@ gem 'ns_service_pack' #use our service pack
80
80
  #for explicit control
81
81
  [ 'config/code_hashes/code_hash.yml.sample',
82
82
  'config/initializers/ns_service_pack.rb',
83
- 'config/initializers/oracle_db_config.rb',
83
+ #'config/initializers/oracle_db_config.rb',
84
84
  'config/ns_services.yml'
85
85
  ]
86
86
  end
@@ -88,3 +88,4 @@ gem 'ns_service_pack' #use our service pack
88
88
  end
89
89
 
90
90
  Cli.start
91
+
@@ -50,7 +50,9 @@ module GlobalConst
50
50
  if @@global_data.key?(k)
51
51
  puts "==>Warning: new value(from #{hash_or_file.inspect}) is set for key:#{k}! Please check that!"
52
52
  end
53
- @@global_data[k] = CodeHash.new(nh[k])
53
+ #FIXME 兼容一下以前的版本,以前吧mapping文件的键值定义为:<class_name>_fileds
54
+ _new_key = k.to_s =~ /_fields$/ ? k.to_s.gsub("_fields", "_mapping").to_sym : k
55
+ @@global_data[_new_key] = CodeHash.new(nh[k])
54
56
  end
55
57
  end
56
58
 
@@ -5,15 +5,16 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "ns_service_pack"
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Caory, Shang, Geogeous"]
12
- s.date = "2011-12-01"
12
+ s.date = "2011-12-03"
13
13
  s.description = "abstract some common pattern to service pack"
14
14
  s.email = "cao7113@hotmail.com"
15
15
  s.executables = ["nsp"]
16
16
  s.extra_rdoc_files = [
17
+ "CHANGELOG",
17
18
  "LICENSE.txt",
18
19
  "README.rdoc"
19
20
  ]
@@ -27,6 +28,7 @@ Gem::Specification.new do |s|
27
28
  "Rakefile",
28
29
  "VERSION",
29
30
  "app/controllers/ns/info_controller.rb",
31
+ "app/views/layouts/ns_service_pack.html.erb",
30
32
  "app/views/ns/info/interfaces.html.erb",
31
33
  "app/views/ns/info/mappings.html.erb",
32
34
  "bin/nsp",
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.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-01 00:00:00.000000000Z
12
+ date: 2011-12-03 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
16
- requirement: &88082070 !ruby/object:Gem::Requirement
16
+ requirement: &77899050 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.6.7
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *88082070
24
+ version_requirements: *77899050
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: thor
27
- requirement: &88081830 !ruby/object:Gem::Requirement
27
+ requirement: &77898760 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.14.6
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *88081830
35
+ version_requirements: *77898760
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: shoulda
38
- requirement: &88081570 !ruby/object:Gem::Requirement
38
+ requirement: &77898450 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *88081570
46
+ version_requirements: *77898450
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
- requirement: &88081310 !ruby/object:Gem::Requirement
49
+ requirement: &77898110 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.0.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *88081310
57
+ version_requirements: *77898110
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: jeweler
60
- requirement: &88081070 !ruby/object:Gem::Requirement
60
+ requirement: &77897810 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.6.4
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *88081070
68
+ version_requirements: *77897810
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rcov
71
- requirement: &88080830 !ruby/object:Gem::Requirement
71
+ requirement: &77897530 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,13 +76,14 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *88080830
79
+ version_requirements: *77897530
80
80
  description: abstract some common pattern to service pack
81
81
  email: cao7113@hotmail.com
82
82
  executables:
83
83
  - nsp
84
84
  extensions: []
85
85
  extra_rdoc_files:
86
+ - CHANGELOG
86
87
  - LICENSE.txt
87
88
  - README.rdoc
88
89
  files:
@@ -95,6 +96,7 @@ files:
95
96
  - Rakefile
96
97
  - VERSION
97
98
  - app/controllers/ns/info_controller.rb
99
+ - app/views/layouts/ns_service_pack.html.erb
98
100
  - app/views/ns/info/interfaces.html.erb
99
101
  - app/views/ns/info/mappings.html.erb
100
102
  - bin/nsp
@@ -139,7 +141,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
139
141
  version: '0'
140
142
  segments:
141
143
  - 0
142
- hash: -792238463
144
+ hash: 552104851
143
145
  required_rubygems_version: !ruby/object:Gem::Requirement
144
146
  none: false
145
147
  requirements: