unidom-contact-china 1.0 → 1.0.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: 2bbc3f605882dd5fe87d3682ccb8e7a05ab9f2f0
4
- data.tar.gz: cfda62842bd5d640e37eba46e4a97f82732b8828
3
+ metadata.gz: 46d0beca414b04af04c8ed05236b46add1461af5
4
+ data.tar.gz: 82f78bf53a34c7f8867c33f85616fd2d23ef2ac1
5
5
  SHA512:
6
- metadata.gz: 5204905251053172737659e9b3b0d1f2b7bc85e06da079b62dfd3d351f33621a246f1d8799b0dc54110a0bb05ed773e6baf2ffc17fda72875a633ec7b4b21d94
7
- data.tar.gz: a0388333d458e1c4c95fccec317bffc37e23314c2f649c7b0b8f1af7856b3c73a4d5b5367822380ce82af2243065d1986910b84b061eb8eb7573971d5e27a400
6
+ metadata.gz: 86b552f71bed0785a8b995b29a0cb7ecfaf62e0a228963a36ca943670f50009520e0c88b2fa2fad8ddac6c674ac37b53543f889935173e9ea47a4bc9f5de373a
7
+ data.tar.gz: 24ccd84b63aa7e89c0c410a6290c1e5cc131b275aa3280139a7290833c9248b147da309360055d5aa5a0920fe1167d080e8b6d0bf2ce6b320fa01250703c515d
data/README.md CHANGED
@@ -2,26 +2,39 @@
2
2
 
3
3
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT)
4
4
  [![Gem Version](https://badge.fury.io/rb/unidom-contact-china.svg)](https://badge.fury.io/rb/unidom-contact-china)
5
+ [![Dependency Status](https://gemnasium.com/badges/github.com/topbitdu/unidom-contact-china.svg)](https://gemnasium.com/github.com/topbitdu/unidom-contact-china)
5
6
 
6
7
  Unidom (UNIfied Domain Object Model) is a series of domain model engines. The China Contact domain model engine includes China Mobile Phone Number and its relative models.
7
8
  Unidom (统一领域对象模型)是一系列的领域模型引擎。中国行政区划领域模型引擎包括中国大陆的手机号码及其相关的模型。
8
9
 
10
+
11
+
9
12
  ## Recent Update
13
+
10
14
  Check out the [Road Map](ROADMAP.md) to find out what's the next.
11
15
  Check out the [Change Log](CHANGELOG.md) to find out what's new.
12
16
 
17
+
18
+
13
19
  ## Usage in Gemfile
20
+
14
21
  ```ruby
15
22
  gem 'unidom-contact-china'
16
23
  ```
17
24
 
25
+
26
+
18
27
  ## Run the Database Migration
28
+
19
29
  ```shell
20
30
  rake db:migrate
21
31
  ```
22
32
  The migration versions start with 2001039156.
23
33
 
34
+
35
+
24
36
  ## Call the Model
37
+
25
38
  ```ruby
26
39
  phone_number = Unidom::Contact::China::MobilePhoneNumber.new phone_number: '13912345678'
27
40
  phone_number.save!
@@ -29,12 +42,15 @@ phone_number.save!
29
42
  Unidom::Contact::China::MobilePhoneNumber.valid_at.alive.first # Get all active China mobile phone numbers
30
43
  ```
31
44
 
45
+
46
+
32
47
  ## Include the Concerns
48
+
33
49
  ```ruby
34
- include Unidom::Contact::Concerns::AsContact
35
- include Unidom::Contact::Concerns::AsSubscriber
50
+ include Unidom::Contact::China::Concerns::AsMobilePhoneNumberSubscriber
36
51
  ```
37
52
 
38
53
  ### As Mobile Phone Number Subscriber concern
54
+
39
55
  The As Mobile Phone Number Subscriber concern do the following tasks for the includer automatically:
40
56
  1. Define the has_many :china_mobile_phone_numbers macro as: ``has_many :china_mobile_phone_numbers, through: :contact_subscriptions, source: :contact, source_type: 'Unidom::Contact::China::MobilePhoneNumber'``
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
10
10
  rdoc.rdoc_dir = 'rdoc'
11
11
  rdoc.title = 'Unidom Contact China'
12
12
  rdoc.options << '--line-numbers'
13
- rdoc.rdoc_files.include('README.rdoc')
13
+ rdoc.rdoc_files.include('README.md')
14
14
  rdoc.rdoc_files.include('lib/**/*.rb')
15
15
  end
16
16
 
@@ -20,5 +20,5 @@ load 'rails/tasks/statistics.rake'
20
20
 
21
21
 
22
22
 
23
- Bundler::GemHelper.install_tasks
23
+ require 'bundler/gem_tasks'
24
24
 
@@ -0,0 +1,2 @@
1
+ //= link_directory ../javascripts/unidom/contact/china .js
2
+ //= link_directory ../stylesheets/unidom/contact/china .css
@@ -5,7 +5,7 @@
5
5
  // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
6
  //
7
7
  // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
- // compiled file.
8
+ // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
9
  //
10
10
  // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
11
  // about supported directives.
@@ -6,9 +6,9 @@
6
6
  * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
7
  *
8
8
  * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
- * compiled file so the styles you add here take precedence over styles defined in any styles
10
- * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
- * file per style scope.
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
12
  *
13
13
  *= require_self
14
14
  */
@@ -1,2 +1,3 @@
1
1
  class Unidom::Contact::China::ApplicationController < ActionController::Base
2
+ protect_from_forgery with: :exception
2
3
  end
@@ -0,0 +1,2 @@
1
+ class Unidom::Contact::China::ApplicationJob < ActiveJob::Base
2
+ end
@@ -0,0 +1,4 @@
1
+ class Unidom::Contact::China::ApplicationMailer < ActionMailer::Base
2
+ default from: 'from@example.com'
3
+ layout 'mailer'
4
+ end
@@ -0,0 +1,3 @@
1
+ class Unidom::Contact::China::ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
@@ -1,6 +1,6 @@
1
1
  # China Mobile Phone Number 是中国移动电话号码。
2
2
 
3
- class Unidom::Contact::China::MobilePhoneNumber < ActiveRecord::Base
3
+ class Unidom::Contact::China::MobilePhoneNumber < Unidom::Contact::China::ApplicationRecord
4
4
 
5
5
  FORMAT_VALIDATION_REGEX = /\A1[3-9]\d{9}\z/
6
6
 
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <title>China</title>
4
+ <title>Unidom Contact China</title>
5
5
  <%= stylesheet_link_tag "china/application", media: "all" %>
6
6
  <%= csrf_meta_tags %>
7
7
  </head>
@@ -1,7 +1,7 @@
1
1
  module Unidom
2
2
  module Contact
3
3
  module China
4
- VERSION = '1.0'.freeze
4
+ VERSION = '1.0.1'.freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,43 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-contact-china
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: 1.0.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-08-15 00:00:00.000000000 Z
11
+ date: 2016-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: unidom-common
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '1.0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '1.0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: unidom-contact
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
17
  - - ">="
32
18
  - !ruby/object:Gem::Version
33
- version: '1.1'
19
+ version: '1.3'
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
24
  - - ">="
39
25
  - !ruby/object:Gem::Version
40
- version: '1.1'
26
+ version: '1.3'
41
27
  description: Unidom (UNIfied Domain Object Model) is a series of domain model engines.
42
28
  The China Region domain model engine includes Region and its relative models. Unidom
43
29
  (统一领域对象模型)是一系列的领域模型引擎。中国联系方式领域模型引擎包括中国大陆的移动电话号码及其相关的模型。
@@ -50,10 +36,14 @@ files:
50
36
  - MIT-LICENSE
51
37
  - README.md
52
38
  - Rakefile
39
+ - app/assets/config/unidom-contact-china_manifest.js
53
40
  - app/assets/javascripts/unidom/contact/china/application.js
54
41
  - app/assets/stylesheets/unidom/contact/china/application.css
55
42
  - app/controllers/unidom/contact/china/application_controller.rb
56
43
  - app/helpers/unidom/contact/china/application_helper.rb
44
+ - app/jobs/unidom/contact/china/application_job.rb
45
+ - app/mailers/unidom/contact/china/application_mailer.rb
46
+ - app/models/unidom/contact/china/application_record.rb
57
47
  - app/models/unidom/contact/china/concerns/as_mobile_phone_number_subscriber.rb
58
48
  - app/models/unidom/contact/china/mobile_phone_number.rb
59
49
  - app/views/layouts/unidom/contact/china/application.html.erb