web47core 0.4.0 → 0.4.2

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
  SHA256:
3
- metadata.gz: 6ad058425df9daebb9a66852109bec488f5f3062cb654236c4d97680757acc65
4
- data.tar.gz: 8aae556d6fd90da4a6bea7259aeefc47fcc3f5e30c6f062cf215f227598f2b35
3
+ metadata.gz: d0668289593ebb640039ea238c5d21c7a295c8a4bce44f8f6408f4a16a5c2de1
4
+ data.tar.gz: 5ad884eade18f580dbc6fe4c6170e1c83ef86a48a94bc99234c99050e596b108
5
5
  SHA512:
6
- metadata.gz: 4f1bdd1eacf5288ca19c548141c31b7b3393a24f12be3aa6009329f387572873e5ede3b14de35f76d11c8f7af7134f404ef0b88f9d01f58702d2a29259d91087
7
- data.tar.gz: b64175e0a61c1ebd84ca5082b5d4d1f1721c8b2d34df4c7e5345f30f0a3d21d45f5fbf393e8c9643d9d0d61bec77c7d7a1caece939a1521304e00b7e8340aafc
6
+ metadata.gz: 5623f9e7e0116b31542a0b4a424390216b3c91d44952b73ec9652af18ebe510f9c317f0e8a87083608f402f9b20c3744abbf2cdcd72314db53c47f6d9f113e57
7
+ data.tar.gz: 5876f57a15e5ad4c48622f3d5c9b635b8b970a60073b5f9596c058c7fecff83c4284492aeca4590a7fab21ceee8fcf947dcf3640c4f56eb7dc2b39180a39a20e
data/README.md CHANGED
@@ -3,14 +3,14 @@ Core components used commonly among all web apps for both App47 and RedMonocle
3
3
 
4
4
  ## We don't need no sticking badges
5
5
 
6
- * [![Codacy Badge](https://api.codacy.com/project/badge/Grade/acc591f31c214849959f71e210e7edbd)](https://www.codacy.com?utm_source=github.com&utm_medium=referral&utm_content=App47/web47core&utm_campaign=Badge_Grade)
7
- * [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/acc591f31c214849959f71e210e7edbd)](https://www.codacy.com?utm_source=github.com&utm_medium=referral&utm_content=App47/web47core&utm_campaign=Badge_Coverage)
8
- * Develop: [![CircleCI](https://circleci.com/gh/App47/web47core/tree/develop.svg?style=svg&circle-token=9999e0634dd96ad5414f4f3e56c39ba6d3e0e4e6)](https://circleci.com/gh/App47/web47core/tree/develop)
9
- * Master: [![CircleCI](https://circleci.com/gh/App47/web47core/tree/master.svg?style=svg&circle-token=9999e0634dd96ad5414f4f3e56c39ba6d3e0e4e6)](https://circleci.com/gh/App47/web47core/tree/master)
6
+ * [![Codacy Badge](https://api.codacy.com/project/badge/Grade/acc591f31c214849959f71e210e7edbd)](https://www.codacy.com?utm_source=github.com&utm_medium=referral&utm_content=App47/web47core&utm_campaign=Badge_Grade)
7
+ * [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/acc591f31c214849959f71e210e7edbd)](https://www.codacy.com?utm_source=github.com&utm_medium=referral&utm_content=App47/web47core&utm_campaign=Badge_Coverage)
8
+ * Develop: [![CircleCI](https://circleci.com/gh/App47/web47core/tree/develop.svg?style=svg&circle-token=9999e0634dd96ad5414f4f3e56c39ba6d3e0e4e6)](https://circleci.com/gh/App47/web47core/tree/develop)
9
+ * Master: [![CircleCI](https://circleci.com/gh/App47/web47core/tree/master.svg?style=svg&circle-token=9999e0634dd96ad5414f4f3e56c39ba6d3e0e4e6)](https://circleci.com/gh/App47/web47core/tree/master)
10
10
 
11
11
  ## Requirements
12
12
 
13
- * Ruby 2.4.1
13
+ * Ruby 2.4.1
14
14
 
15
15
  ### Working with Bundler and RVM
16
16
 
@@ -44,9 +44,9 @@ bundle exec rake test
44
44
  ## Deployment
45
45
  The `web47core` project is a gem that will be deployed via [Ruby Gems](https://rubygems.org). When an update is ready, the following steps should be followed
46
46
 
47
- 1. Build the gem `gem build web47core.gemspec`
48
- 2. Push the new gem to [Ruby Gems](https://rubygems.org) `gem push web47core-version.gem`
49
- 3. There may be a delay when using the gem file
47
+ 1. Build the gem `gem build web47core.gemspec`
48
+ 2. Push the new gem to [Ruby Gems](https://rubygems.org) `gem push web47core-version.gem`
49
+ 3. There may be a delay when using the gem file
50
50
 
51
51
  ## Usage
52
52
  ### Importing the gem
@@ -69,31 +69,31 @@ gem 'web47core', git: 'git@github.com:App47/web47core.git', branch: :develop
69
69
  _Please do not ship to production code using the git repo, as the production servers will not have keys to pull from the web47core repo_
70
70
 
71
71
  ### Remove the following files
72
- 1. `StandardModel` - Includes the common set of includes, Mongoid, Auditable, AutoClearCache, etc.
73
- 2. `CdnUrl` - Provide CDN URLs of your classes URLs when cdn_url is configured in system configuration
74
- 3. `AutoClearCache` - Clears your objects cache out of Rails.cache using the object's id
75
- 4. `Formable` - Consolidated into StandardModel, was used to provide common form operations for mongoid documents
76
- 5. `EmailNotification`
77
- 6. `EmailTemplate`
78
- 7. `Notification`
79
- 8. `NotificationTemplate`
80
- 9. `SlackNotification`
81
- 10. `SmsNotification`
82
- 11. `Template`
83
- 12. `App47Logger` and `App47LoggerTest`
84
- 13. `Emailable` or `EmailAble` and `EamailbleTest`, be sure to change `Emailable` to `EmailAble`
85
- 14. `RedisConfiguration` and `RedisConfgurationTest`
86
- 15. `Searchable` and `SearchableTest`, be sure to change `Searchable` to `SearchAble`
87
- 16. `TimezoneAble` and `TimezoneAbleTest`
88
- 17. `CronJobServer` and `CronJobServerTest`
89
- 18. `JobCronTab` and `JobCronTabTest`
90
- 19. `CronTab`
72
+ 1. `StandardModel` - Includes the common set of includes, Mongoid, Auditable, AutoClearCache, etc.
73
+ 2. `CdnUrl` - Provide CDN URLs of your classes URLs when cdn_url is configured in system configuration
74
+ 3. `AutoClearCache` - Clears your objects cache out of Rails.cache using the object's id
75
+ 4. `Formable` - Consolidated into StandardModel, was used to provide common form operations for mongoid documents
76
+ 5. `EmailNotification`
77
+ 6. `EmailTemplate`
78
+ 7. `Notification`
79
+ 8. `NotificationTemplate`
80
+ 9. `SlackNotification`
81
+ 10. `SmsNotification`
82
+ 11. `Template`
83
+ 12. `App47Logger` and `App47LoggerTest`
84
+ 13. `Emailable` or `EmailAble` and `EamailbleTest`, be sure to change `Emailable` to `EmailAble`
85
+ 14. `RedisConfiguration` and `RedisConfgurationTest`
86
+ 15. `Searchable` and `SearchableTest`, be sure to change `Searchable` to `SearchAble`
87
+ 16. `TimezoneAble` and `TimezoneAbleTest`
88
+ 17. `CronJobServer` and `CronJobServerTest`
89
+ 18. `JobCronTab` and `JobCronTabTest`
90
+ 19. `CronTab`
91
91
 
92
92
  #### Models
93
93
  ##### Concerns
94
- 1. `StandardModel` - Includes the common set of includes, Mongoid, etc.
95
- 2. `CoreSystemConfiguration` - Base system configuration to be included in the app's SystemConfiguration Object
96
- 3. `CoreAccount` - Base account object that is related to notifications and the ilk.
94
+ 1. `StandardModel` - Includes the common set of includes, Mongoid, etc.
95
+ 2. `CoreSystemConfiguration` - Base system configuration to be included in the app's SystemConfiguration Object
96
+ 3. `CoreAccount` - Base account object that is related to notifications and the ilk.
97
97
  ##### System Configuration
98
98
  Define a `SystemConfiguration` class in your project and import the core concern.
99
99
 
@@ -120,9 +120,9 @@ end
120
120
  ```
121
121
  ##### Cron
122
122
  Cron infrastructure for running jobs every minute, hour, day, week, month or some combination
123
- 1. Remove `config/initializers/job_cron_tabs.rb` that was previous used to ensure cron tabs, they will be loaded automatically now
124
- 2. Remove the `Delayed::Backend::Mongoid::Job` class definition, not the settings from `config/initializers/delayed_job.rb`, these are included in this gem now.
125
- 3. Cron jobs should extend from `Cron::Job` now and specify `cron_tab_entry` within the class.
123
+ 1. Remove `config/initializers/job_cron_tabs.rb` that was previous used to ensure cron tabs, they will be loaded automatically now
124
+ 2. Remove the `Delayed::Backend::Mongoid::Job` class definition, not the settings from `config/initializers/delayed_job.rb`, these are included in this gem now.
125
+ 3. Cron jobs should extend from `Cron::Job` now and specify `cron_tab_entry` within the class.
126
126
  ```ruby
127
127
  module Cron
128
128
  class MyJob < Job
@@ -134,12 +134,12 @@ module Cron
134
134
  end
135
135
  ```
136
136
  Allowed values of cron_tab_entry are
137
- * `:always` - run every minute
138
- * `:hourly` - run every hour
139
- * `:daily` - run every day
140
- * `:weekly` - run every week on Sunday
141
- * `:monthly` - run every month on the first day of the month
142
- * `'*/5 1,3 * 2 *'` - Run according to unix crontab entry format. This would run every tuesday on the 1st and 3rd hour, for any minute divisible by 5, so 0, 5, 10, 15, etc..
137
+ * `:always` Run every minute
138
+ * `:hourly` Run every hour
139
+ * `:daily` Run every day
140
+ * `:weekly` Run every week on Sunday
141
+ * `:monthly` Run every month on the first day of the month
142
+ * `'*/5 1,3 * 2 *'` Run according to unix crontab entry format. This would run every tuesday on the 1st and 3rd hour, for any minute divisible by 5, so 0, 5, 10, 15, etc..
143
143
 
144
144
  Before starting the server, you need to run the database command
145
145
  ```mongo
@@ -63,6 +63,6 @@ module CoreHelper
63
63
  end
64
64
 
65
65
  def current_user
66
- User.new
66
+ @current_user || User.new
67
67
  end
68
68
  end
@@ -14,7 +14,6 @@ module Cron
14
14
  # Provide a friendly command structure for managing the cron server
15
15
  #
16
16
  class Command
17
-
18
17
  #
19
18
  # Initialize the command
20
19
  #
@@ -34,6 +34,7 @@ module Cron
34
34
  rescue StandardError
35
35
  allowed_time
36
36
  end
37
+
37
38
  #
38
39
  # Allowed time the amount of time allowed to exists before deleting
39
40
  #
@@ -20,7 +20,7 @@ class AuditLog
20
20
  #
21
21
  # Validations
22
22
  #
23
- validates :action, inclusion: {in: ALL_ACTIONS}
23
+ validates :action, inclusion: { in: ALL_ACTIONS }
24
24
 
25
25
  def self.sort_order
26
26
  [:created_at, -1]
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CoreSystemConfiguration
4
+ extend ActiveSupport::Concern
4
5
  #
5
6
  # The System configuration. Various configuration items that can be updated/defined at run time
6
7
  #
@@ -13,8 +14,6 @@ module CoreSystemConfiguration
13
14
  # unless you are updating via the Admin or Stack UI, or during testing to setup a specific configuration
14
15
  # for that.
15
16
  #
16
- extend ActiveSupport::Concern
17
-
18
17
  def self.included(base)
19
18
  base.class_eval do
20
19
  #
@@ -4,11 +4,11 @@
4
4
  # Constants for a role
5
5
  #
6
6
  module RoleAble
7
- ROLE_NONE = 'none'.freeze unless defined? ROLE_NONE
8
- ROLE_VIEW = 'view'.freeze unless defined? ROLE_VIEW
9
- ROLE_EDIT = 'edit'.freeze unless defined? ROLE_EDIT
10
- ROLE_ADMIN = 'admin'.freeze unless defined? ROLE_ADMIN
11
- ROLE_SUPER_ADMIN = 'super_admin'.freeze unless defined? ROLE_SUPER_ADMIN
7
+ ROLE_NONE = 'none' unless defined? ROLE_NONE
8
+ ROLE_VIEW = 'view' unless defined? ROLE_VIEW
9
+ ROLE_EDIT = 'edit' unless defined? ROLE_EDIT
10
+ ROLE_ADMIN = 'admin' unless defined? ROLE_ADMIN
11
+ ROLE_SUPER_ADMIN = 'super_admin' unless defined? ROLE_SUPER_ADMIN
12
12
  ALL_ROLES = [ROLE_NONE, ROLE_VIEW, ROLE_EDIT, ROLE_ADMIN].freeze unless defined? ALL_ROLES
13
13
  unless defined? ALL_SUPER_ROLES
14
14
  ALL_SUPER_ROLES = [ROLE_NONE, ROLE_VIEW, ROLE_EDIT, ROLE_ADMIN, ROLE_SUPER_ADMIN].freeze
@@ -38,6 +38,7 @@ class UserAuditLog < AuditLog
38
38
  #
39
39
  def record_names
40
40
  return if user.blank?
41
+
41
42
  self.raw_user_name = user.name
42
43
  self.raw_email = user.email
43
44
  end
@@ -1,3 +1,6 @@
1
+ #
2
+ # Add the rails engine to the gem
3
+ #
1
4
  module Web47core
2
5
  class Engine < Rails::Engine; end
3
6
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Web47core
4
- VERSION = '0.4.0'
4
+ VERSION = '0.4.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web47core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Schroeder