unidom-common 1.8 → 1.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 160b4063d0e765826d03c06552720324af909359
4
- data.tar.gz: f22d9696f68bb1b47da5e12a91115dfb60ab54f5
3
+ metadata.gz: a39c274e0f9c5c3572704431ab88e4011c098c94
4
+ data.tar.gz: 7c87c54ad829788f50d9cac1b2c77487e17e52a5
5
5
  SHA512:
6
- metadata.gz: 2c57580fa426e2980b8ec027bb3970c19023d984dd1cec6cbef4767c7c8a12e4daaa8d56622811be0716e9485bff01612d4aadc3e1b8d4d5f6d55f10a1e4a681
7
- data.tar.gz: 0ccfdb1bebf50723b19942db1632970e2c41b3f3ba723d0f9cf1eab9f8fe8af87962f62f056cbe35a8e1d97a296cf6d88df4a118c0eb88de56fe65db316b7255
6
+ metadata.gz: 5b2bfaee716b742cc492ff05a5f52a7b8bda9d12f63c4f4e4b99491ebbb476bc0bc99315d92e92d522e9f9b5219d7f3f35369f9f5a0be7d810fe6010ef072202
7
+ data.tar.gz: d25023c343991eefb5d1239f4ae6f39ff3bf3912a61c6efce80e0f2e68af38a4686fe70f0626c9b013150bc8ded5763f905b5b121e71d67fb119fe99a8d5fed9
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Unidom Common 常用领域模型引擎
2
2
 
3
+ [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/unidom-common/frames)
3
4
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT)
5
+
4
6
  [![Gem Version](https://badge.fury.io/rb/unidom-common.svg)](https://badge.fury.io/rb/unidom-common)
5
7
  [![Dependency Status](https://gemnasium.com/badges/github.com/topbitdu/unidom-common.svg)](https://gemnasium.com/github.com/topbitdu/unidom-common)
6
8
 
@@ -1,3 +1,6 @@
1
+ ##
2
+ # AES 256 Cryptor 是基于 AES-256-CBC 算法的加密和解密逻辑关注点。
3
+
1
4
  module Unidom::Common::Concerns::Aes256Cryptor
2
5
 
3
6
  extend ActiveSupport::Concern
@@ -1,3 +1,6 @@
1
+ ##
2
+ # Argument Validation 是参数验证逻辑的关注点。
3
+
1
4
  module Unidom::Common::Concerns::ArgumentValidation
2
5
 
3
6
  extend ActiveSupport::Concern
@@ -1,3 +1,6 @@
1
+ ##
2
+ # Exact Column 是加密字段的生成和查询逻辑关注点。
3
+
1
4
  module Unidom::Common::Concerns::ExactColumn
2
5
 
3
6
  extend ActiveSupport::Concern
@@ -1,3 +1,6 @@
1
+ ##
2
+ # MD5 Digester 是封装 MD5 摘要算法的逻辑关注点。
3
+
1
4
  module Unidom::Common::Concerns::Md5Digester
2
5
 
3
6
  extend ActiveSupport::Concern
@@ -33,7 +33,7 @@ module Unidom::Common::Concerns::ModelExtension
33
33
  =end
34
34
 
35
35
  if columns_hash['ordinal'].present?&&:integer==columns_hash['ordinal'].type
36
- validates :ordinal, presence: true, numericality: { integer_only: true, greater_than: 0 }
36
+ validates :ordinal, presence: true, numericality: { only_integer: true, greater_than: 0 }
37
37
  scope :ordinal_is, ->(ordinal) { where ordinal: ordinal }
38
38
  end
39
39
 
@@ -47,14 +47,14 @@ module Unidom::Common::Concerns::ModelExtension
47
47
  end
48
48
 
49
49
  if columns_hash['grade'].present?&&:integer==columns_hash['grade'].type
50
- validates :grade, presence: true, numericality: { integer_only: true, greater_than_or_equal_to: 0 }
50
+ validates :grade, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 0 }
51
51
  scope :grade_is, ->(grade) { where grade: grade }
52
52
  scope :grade_higher_than, ->(grade) { where "grade > :grade", grade: grade }
53
53
  scope :grade_lower_than, ->(grade) { where "grade < :grade", grade: grade }
54
54
  end
55
55
 
56
56
  if columns_hash['priority'].present?&&:integer==columns_hash['priority'].type
57
- validates :priority, presence: true, numericality: { integer_only: true, greater_than_or_equal_to: 0 }
57
+ validates :priority, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 0 }
58
58
  scope :priority_is, ->(priority) { where priority: priority }
59
59
  scope :priority_higher_than, ->(priority) { where "priority > :priority", priority: priority }
60
60
  scope :priority_lower_than, ->(priority) { where "priority < :priority", priority: priority }
@@ -1,3 +1,6 @@
1
+ ##
2
+ # Notation Column 是封装 JSON 类型 NoSQL 算法的逻辑关注点。
3
+
1
4
  module Unidom::Common::Concerns::NotationColumn
2
5
 
3
6
  extend ActiveSupport::Concern
@@ -1,3 +1,6 @@
1
+ ##
2
+ # Secure Column 是封装存储加密算法的逻辑关注点。
3
+
1
4
  module Unidom::Common::Concerns::SecureColumn
2
5
 
3
6
  extend ActiveSupport::Concern
@@ -1,3 +1,6 @@
1
+ ##
2
+ # SHA-1 Digester 是封装 SHA-1 摘要算法的逻辑关注点。
3
+
1
4
  module Unidom::Common::Concerns::Sha1Digester
2
5
 
3
6
  extend ActiveSupport::Concern
@@ -1,3 +1,6 @@
1
+ ##
2
+ # SHA-256 Digester 是封装 SHA-256 摘要算法的逻辑关注点。
3
+
1
4
  module Unidom::Common::Concerns::Sha256Digester
2
5
 
3
6
  extend ActiveSupport::Concern
@@ -1,3 +1,6 @@
1
+ ##
2
+ # SHA-2 Digester 是封装 SHA-2 摘要算法的逻辑关注点。
3
+
1
4
  module Unidom::Common::Concerns::Sha2Digester
2
5
 
3
6
  extend ActiveSupport::Concern
@@ -1,3 +1,6 @@
1
+ ##
2
+ # SHA-384 Digester 是封装 SHA-384 摘要算法的逻辑关注点。
3
+
1
4
  module Unidom::Common::Concerns::Sha384Digester
2
5
 
3
6
  extend ActiveSupport::Concern
@@ -1,3 +1,6 @@
1
+ ##
2
+ # SHA-512 Digester 是封装 SHA-512 摘要算法的逻辑关注点。
3
+
1
4
  module Unidom::Common::Concerns::Sha512Digester
2
5
 
3
6
  extend ActiveSupport::Concern
@@ -1,3 +1,7 @@
1
+ ##
2
+ # Engine Extension 是为 Rails 引擎提供的扩展关注点。
3
+ # .enable_initializer 方法简化了知识层枚举和数据库迁移脚本的加载。
4
+
1
5
  module Unidom::Common::EngineExtension
2
6
 
3
7
  extend ActiveSupport::Concern
@@ -1,3 +1,6 @@
1
+ ##
2
+ # Numeration 是数字格式转换的辅助类。
3
+
1
4
  class Unidom::Common::Numeration
2
5
 
3
6
  def self.hex(data)
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Common
3
- VERSION = '1.8'.freeze
3
+ VERSION = '1.8.1'.freeze
4
4
  end
5
5
  end
@@ -1,3 +1,6 @@
1
+ ##
2
+ # YAML Helper 是用于加载知识层枚举的配置文件的辅助模块。
3
+
1
4
  module Unidom::Common::YamlHelper
2
5
 
3
6
  def self.load_enum(config: nil, root: nil)
data/lib/unidom/common.rb CHANGED
@@ -1,9 +1,7 @@
1
1
  require 'unidom/common/engine'
2
2
 
3
3
  require 'unidom/common/numeration'
4
-
5
4
  require 'unidom/common/yaml_helper'
6
-
7
5
  require 'unidom/common/engine_extension'
8
6
 
9
7
  module Unidom
@@ -18,5 +16,27 @@ module Unidom
18
16
  #FROM_DATE = '1970-01-01'.freeze
19
17
  #THRU_DATE = '3000-01-01'.freeze
20
18
 
19
+ =begin
20
+ mattr_accessor :options
21
+
22
+ def self.configure
23
+
24
+ options = {}
25
+ yield options
26
+
27
+ default_options = {
28
+ ignored_migration_namespaces: []
29
+ }
30
+ self.options = default_options.merge options
31
+
32
+ puts 'Unidom::Common:'
33
+ if self.options[:ignored_migration_namespaces].present?
34
+ puts '-- ignored_migration_namespaces'
35
+ puts " -> #{self.options[:ignored_migration_namespaces].join ', '}"
36
+ end
37
+
38
+ end
39
+ =end
40
+
21
41
  end
22
42
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-common
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.8'
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-28 00:00:00.000000000 Z
11
+ date: 2017-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails