unidom-common 1.9 → 1.9.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad1d0c055e4f13bc289e6240df3dae2a26709b39
4
- data.tar.gz: 2a7990041421f9e424064f6c49196c9b363c7348
3
+ metadata.gz: 0bd08cfd199d4f29c2097191bf24f73d3291aae1
4
+ data.tar.gz: 566e2ee9e74cbb4faf9b2e63bc7e6fd3ffea75cf
5
5
  SHA512:
6
- metadata.gz: e35ed9517822efd61fa2dcfa76ccb92506c03d379dff91843b2d80f173a3622db60c6110ab0c1bf98078478c9b70c04573ff488471f3b7ac02681fa6a9e78f38
7
- data.tar.gz: 9a9bfcc2f17fd5bfac5d4a0249a5b8f6a7ebdf33d5841f6a84e60ee495cc902d4253d9493cdfe290d90e27d80195d1b3d8d14f12960256e4ef5d9fd9bc4b5a4e
6
+ metadata.gz: 05ec87e12d971df5e1ff1ab7680375af71b0476a134d05f71f64a6eea713713fb0ef009e47da54a2169fea3febe384cf26b19623a3c0fe44e69226b4918f62c6
7
+ data.tar.gz: 4c8ae78ce001e40575d426621164b0871d34eed2310e031cda53ccb7355713a9285735b5d38fb7b8ef4028510ca1b924f635441d37055c5f3e87c7f2eb82c288
@@ -1,6 +1,3 @@
1
- ##
2
- # Application controller 是模块内所有控制器的基类。
3
-
4
1
  class Unidom::Common::ApplicationController < ActionController::Base
5
2
  protect_from_forgery with: :exception
6
3
  end
@@ -1,5 +1,2 @@
1
- ##
2
- # Application job 是模块内所有异步任务的基类。
3
-
4
1
  class Unidom::Common::ApplicationJob < ActiveJob::Base
5
2
  end
@@ -1,6 +1,3 @@
1
- ##
2
- # Application mailer 是模块内所有电子邮件发送类的基类。
3
-
4
1
  class Unidom::Common::ApplicationMailer < ActionMailer::Base
5
2
  default from: 'from@example.com'
6
3
  layout 'mailer'
@@ -1,6 +1,3 @@
1
- ##
2
- # Application record 是模块内所有模型的抽象基类。
3
-
4
1
  class Unidom::Common::ApplicationRecord < ActiveRecord::Base
5
2
  self.abstract_class = true
6
3
  end
@@ -1,6 +1,3 @@
1
- ##
2
- # Exact Column 是加密字段的生成和查询逻辑关注点。
3
-
4
1
  module Unidom::Common::Concerns::ExactColumn
5
2
 
6
3
  extend ActiveSupport::Concern
@@ -1,6 +1,3 @@
1
- ##
2
- # MD5 Digester 是封装 MD5 摘要算法的逻辑关注点。
3
-
4
1
  module Unidom::Common::Concerns::Md5Digester
5
2
 
6
3
  extend ActiveSupport::Concern
@@ -1,6 +1,3 @@
1
- ##
2
- # Notation Column 是封装 JSON 类型 NoSQL 算法的逻辑关注点。
3
-
4
1
  module Unidom::Common::Concerns::NotationColumn
5
2
 
6
3
  extend ActiveSupport::Concern
@@ -1,6 +1,3 @@
1
- ##
2
- # Secure Column 是封装存储加密算法的逻辑关注点。
3
-
4
1
  module Unidom::Common::Concerns::SecureColumn
5
2
 
6
3
  extend ActiveSupport::Concern
@@ -30,7 +27,7 @@ module Unidom::Common::Concerns::SecureColumn
30
27
  name = name.to_sym
31
28
  return unless respond_to? name
32
29
  json = send(name)
33
- return if json['encoded'].blank?||json['signature'].blank?||json['encryption_algorithm'].blank?
30
+ return if json.blank?||json['encoded'].blank?||json['signature'].blank?||json['encryption_algorithm'].blank?
34
31
  return if self.class.encryption_algorithm!=json['encryption_algorithm']
35
32
  aes_key = Digest::SHA512::digest self.class.exact_signature(self.class, name, '')
36
33
  content = decrypt Unidom::Common::Numeration.rev_hex(json['encoded']), key: aes_key
@@ -1,6 +1,3 @@
1
- ##
2
- # SHA-1 Digester 是封装 SHA-1 摘要算法的逻辑关注点。
3
-
4
1
  module Unidom::Common::Concerns::Sha1Digester
5
2
 
6
3
  extend ActiveSupport::Concern
@@ -1,6 +1,3 @@
1
- ##
2
- # SHA-256 Digester 是封装 SHA-256 摘要算法的逻辑关注点。
3
-
4
1
  module Unidom::Common::Concerns::Sha256Digester
5
2
 
6
3
  extend ActiveSupport::Concern
@@ -1,6 +1,3 @@
1
- ##
2
- # SHA-2 Digester 是封装 SHA-2 摘要算法的逻辑关注点。
3
-
4
1
  module Unidom::Common::Concerns::Sha2Digester
5
2
 
6
3
  extend ActiveSupport::Concern
@@ -1,6 +1,3 @@
1
- ##
2
- # SHA-384 Digester 是封装 SHA-384 摘要算法的逻辑关注点。
3
-
4
1
  module Unidom::Common::Concerns::Sha384Digester
5
2
 
6
3
  extend ActiveSupport::Concern
@@ -1,6 +1,3 @@
1
- ##
2
- # SHA-512 Digester 是封装 SHA-512 摘要算法的逻辑关注点。
3
-
4
1
  module Unidom::Common::Concerns::Sha512Digester
5
2
 
6
3
  extend ActiveSupport::Concern
@@ -1,7 +1,8 @@
1
1
  class Unidom::Common::Neglection
2
2
 
3
3
  def self.namespace_neglected?(class_name)
4
- Unidom::Common.options[:neglected_namespaces].include? class_name.to_s.deconstantize
4
+ neglected_namespaces = Unidom::Common.options[:neglected_namespaces]
5
+ neglected_namespaces.present? ? neglected_namespaces.include?(class_name.to_s.deconstantize) : false
5
6
  end
6
7
 
7
8
  end
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Common
3
- VERSION = '1.9'.freeze
3
+ VERSION = '1.9.1'.freeze
4
4
  end
5
5
  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.9'
4
+ version: 1.9.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: 2017-01-20 00:00:00.000000000 Z
11
+ date: 2017-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails