usman 0.3.24 → 0.3.25

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: 58b44b778d452ed6091870274ebe07eee259b955
4
- data.tar.gz: 6b861e63e0b1fe9b15c237fcf9cc942adb38de68
3
+ metadata.gz: 00f8b99360de48eb40662b9a493d9e2919444e23
4
+ data.tar.gz: 0b322710c79ca0746362c5beab0606454a118672
5
5
  SHA512:
6
- metadata.gz: d99f6f25b5a0abbd550dd782a8feac4cfeb3e7e2336b3c0ed0185c43a66903c31a85b169c79f6f02899f2de733b0566c1d12472da5e5c47124034243dc9e3fc5
7
- data.tar.gz: 12715344385c0f2357623a416af99cb94b8b4f45d7d2c7e38398ea2f4669b2d3a36fae6108093cffbc2ee5ca5b5e89fb20358dba56fe7a8d8b21b9365e79d0c4
6
+ metadata.gz: a65b90b6f52f4e591538db1b25ff94d2309bbb0443ca66dd13f88e1717f51365273ae6478b3a8abe954245fd7feb4f1ecde5eb6a9451b68f0fa7ecc973b6555f
7
+ data.tar.gz: a38a3e54a76fc1ca1c45925a58e3b91dfb5174a1d126ddd099934a09465d6ad7a8425477a70b8b344bdb8d89e22d512e7bea2bae465980e6d18780955d5fc014
data/IMPORT.md ADDED
@@ -0,0 +1,69 @@
1
+ # Importing the data
2
+
3
+ Basic Usage
4
+
5
+ ## Importing Master Data
6
+
7
+ Use the following scripts to import master data - Roles
8
+
9
+ role data is a csv file.
10
+
11
+ pass verbose=false to avoid printing more details while running these commands.
12
+
13
+ ### Importing roles
14
+
15
+ This will import roles parsing the csv file 'roles.csv' located in db/master_data
16
+ ```rails usman:import:master_data:roles```
17
+
18
+
19
+ ## Importing Dummy Data
20
+
21
+ Use the following scripts to import dummy data - User, Features, Roles & Permissions
22
+
23
+ All dummy data should be in a csv file and should be located in db/import_data/dummy.
24
+
25
+ pass verbose=false to avoid printing more details while running these commands.
26
+
27
+ ### Importing users
28
+
29
+ ```rails usman:import:data:dummy:users```
30
+
31
+ This will import users parsing the csv file 'users.csv' located in db/data/dummy
32
+
33
+ ### Importing features
34
+
35
+ ```rails import:data:dummy:features```
36
+
37
+ This will import features parsing the csv file 'features.csv' located in db/data/dummy
38
+
39
+ ### Importing roles
40
+
41
+ ```rails usman:import:data:dummy:roles```
42
+
43
+ This will import roles parsing the csv file 'roles.csv' located in db/data/dummy
44
+
45
+ ### Importing permissions
46
+
47
+ ```rails usman:import:data:dummy:permissions```
48
+
49
+ This will import permissions parsing the csv file 'permissions.csv' located in db/data/dummy
50
+
51
+
52
+ ### Importing all together in one line
53
+
54
+ ```rails usman:import:data:dummy:users usman:import:data:dummy:features usman:import:data:dummy:roles usman:import:data:dummy:permissions```
55
+
56
+ This can also be achieved in a single task
57
+
58
+ ```rails usman:import:data:dummy:all```
59
+
60
+
61
+ ## Importing Real Data for Production
62
+
63
+ All real data should be in a csv file and should be located in db/data.
64
+
65
+ ```rails usman:import:data:users```
66
+ ```rails usman:import:data:features```
67
+ ```rails usman:import:data:roles```
68
+ ```rails usman:import:data:permissions```
69
+
data/lib/usman/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Usman
2
- VERSION = '0.3.24'
2
+ VERSION = '0.3.25'
3
3
  end
@@ -0,0 +1,18 @@
1
+ FactoryGirl.define do
2
+
3
+ factory :contact, class: Usman::Contact do
4
+
5
+ association :done_deal_user, :factory => :user
6
+ association :owner, :factory => :user
7
+ association :device, :factory => :device
8
+
9
+ name "Some Name"
10
+ account_type "com.google"
11
+
12
+ email "something@domain.com"
13
+ address "Some Address"
14
+
15
+ contact_number_1 "9912345678"
16
+ end
17
+
18
+ end
@@ -0,0 +1,33 @@
1
+ FactoryGirl.define do
2
+
3
+ factory :device do
4
+ user
5
+ registration
6
+
7
+ uuid {SecureRandom.hex}
8
+ device_token {SecureRandom.hex}
9
+ device_name "Apple iPhone"
10
+ device_type "iPhone 7 Plus"
11
+ operating_system "iPhone 7 Plus"
12
+ software_version "Apple iOS"
13
+
14
+ last_accessed_at {Time.now}
15
+ last_accessed_api "/api/v1/register"
16
+ end
17
+
18
+ factory :pending_device, parent: :device do
19
+ status "pending"
20
+ end
21
+
22
+ factory :verified_device, parent: :device do
23
+ status "verified"
24
+ otp nil
25
+ otp_sent_at { Time.now }
26
+ otp_verified_at { Time.now }
27
+ end
28
+
29
+ factory :blocked_device, parent: :device do
30
+ status "blocked"
31
+ end
32
+
33
+ end
@@ -0,0 +1,20 @@
1
+ FactoryGirl.define do
2
+
3
+ factory :feature do
4
+ name "Feature Name"
5
+ categorisable false
6
+ end
7
+
8
+ factory :published_feature, parent: :feature do
9
+ status "published"
10
+ end
11
+
12
+ factory :unpublished_feature, parent: :feature do
13
+ status "unpublished"
14
+ end
15
+
16
+ factory :removed_feature, parent: :feature do
17
+ status "removed"
18
+ end
19
+
20
+ end
@@ -0,0 +1,6 @@
1
+ FactoryGirl.define do
2
+ factory :feature_image, :class => Image::ProfilePicture do
3
+ image { Rack::Test::UploadedFile.new('spec/dummy/spec/factories/test.jpeg', 'image/jpg') }
4
+ association :imageable, :factory => :user
5
+ end
6
+ end
@@ -0,0 +1,30 @@
1
+ FactoryGirl.define do
2
+ factory :permission do
3
+ user
4
+ feature
5
+
6
+ can_create false
7
+ can_read true
8
+ can_update false
9
+ can_delete false
10
+ end
11
+
12
+ factory :create_permission, parent: :permission do
13
+ can_create true
14
+ end
15
+
16
+ factory :update_permission, parent: :permission do
17
+ can_update true
18
+ end
19
+
20
+ factory :delete_permission, parent: :permission do
21
+ can_delete true
22
+ end
23
+
24
+ factory :all_permission, parent: :permission do
25
+ can_create true
26
+ can_read true
27
+ can_update true
28
+ can_delete true
29
+ end
30
+ end
@@ -0,0 +1,6 @@
1
+ FactoryGirl.define do
2
+ factory :profile_picture, :class => Image::ProfilePicture do
3
+ image { Rack::Test::UploadedFile.new('spec/dummy/spec/factories/test.jpeg', 'image/jpg') }
4
+ association :imageable, :factory => :user
5
+ end
6
+ end
@@ -0,0 +1,32 @@
1
+ require 'pattana/factories.rb'
2
+
3
+ FactoryGirl.define do
4
+
5
+ factory :registration do
6
+
7
+ user
8
+ country
9
+ city
10
+
11
+ dialing_prefix "+971"
12
+ mobile_number "501122333"
13
+
14
+ after :build do |reg|
15
+ reg.country = reg.city.country if reg.city
16
+ end
17
+
18
+ end
19
+
20
+ factory :pending_registration, parent: :registration do
21
+ status "pending"
22
+ end
23
+
24
+ factory :verified_registration, parent: :registration do
25
+ status "verified"
26
+ end
27
+
28
+ factory :suspended_registration, parent: :registration do
29
+ status "suspended"
30
+ end
31
+
32
+ end
@@ -0,0 +1,7 @@
1
+ FactoryGirl.define do
2
+
3
+ factory :role do
4
+ name "Role Name"
5
+ end
6
+
7
+ end
@@ -0,0 +1,7 @@
1
+ title,venue,description,date,starts_at,ends_at,featured,status
2
+ word power make easy book ,Ali Masthan Hall,Some Description,1/1/17,9:00,10:00,TRUE,published
3
+ Manaing people book,Zabeel Park,Some Description,1/1/17,9:00,10:00,FALSE,published
4
+ solve your problems birbal book ,DP World Museum,Some Description,1/1/17,9:00,10:00,FALSE,unpublished
5
+ public speeking book ,Apsara Kalyanamandapam,Some Description,1/1/17,9:00,10:00,TRUE,published
6
+ qdds book,Crown Plaza,Some Description,1/1/17,9:00,10:00,FALSE,removed
7
+ bANKRUPT BOOK,Audi Showroom Premises,Some Description,1/1/17,9:00,10:00,FALSE,archived
Binary file
@@ -0,0 +1,46 @@
1
+ FactoryGirl.define do
2
+
3
+ sequence(:email) {|n| "user.#{n}@domain.com" }
4
+ sequence(:username) {|n| "username#{n}" }
5
+
6
+ factory :user do
7
+
8
+ name "First Middle Last"
9
+ username
10
+ email
11
+
12
+ phone "123-456-7890"
13
+ designation "My Designation"
14
+ date_of_birth "01/01/1980"
15
+
16
+ password_digest { SecureRandom.hex }
17
+ password ConfigCenter::Defaults::PASSWORD
18
+ password_confirmation ConfigCenter::Defaults::PASSWORD
19
+
20
+ auth_token {SecureRandom.hex}
21
+ token_created_at {Time.now}
22
+
23
+ gender User::MALE
24
+
25
+ dummy false
26
+
27
+ end
28
+
29
+ factory :pending_user, parent: :user do
30
+ status "pending"
31
+ end
32
+
33
+ factory :approved_user, parent: :user do
34
+ status "approved"
35
+ end
36
+
37
+ factory :suspended_user, parent: :user do
38
+ status "suspended"
39
+ end
40
+
41
+ factory :super_admin_user, parent: :user do
42
+ status "approved"
43
+ super_admin true
44
+ end
45
+
46
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.24
4
+ version: 0.3.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - kpvarma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-28 00:00:00.000000000 Z
11
+ date: 2017-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -384,6 +384,7 @@ executables: []
384
384
  extensions: []
385
385
  extra_rdoc_files: []
386
386
  files:
387
+ - IMPORT.md
387
388
  - MIT-LICENSE
388
389
  - README.md
389
390
  - Rakefile
@@ -598,6 +599,17 @@ files:
598
599
  - lib/usman/engine.rb
599
600
  - lib/usman/factories.rb
600
601
  - lib/usman/version.rb
602
+ - spec/dummy/spec/factories/contact.rb
603
+ - spec/dummy/spec/factories/device.rb
604
+ - spec/dummy/spec/factories/feature.rb
605
+ - spec/dummy/spec/factories/feature_image.rb
606
+ - spec/dummy/spec/factories/permission.rb
607
+ - spec/dummy/spec/factories/profile_picture.rb
608
+ - spec/dummy/spec/factories/registration.rb
609
+ - spec/dummy/spec/factories/role.rb
610
+ - spec/dummy/spec/factories/test.csv
611
+ - spec/dummy/spec/factories/test.jpeg
612
+ - spec/dummy/spec/factories/user.rb
601
613
  homepage: https://github.com/right-solutions/usman
602
614
  licenses:
603
615
  - MIT