mr_common 2.0.0 → 2.1.0

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
  SHA256:
3
- metadata.gz: 54451845d3b9872d8263616b7cd840d794e9ec6c5ad523065e3a9706bb426e3e
4
- data.tar.gz: '0564509763ef97f22dbec7798998ad2c7f590387413e8a3842a094cec50d551f'
3
+ metadata.gz: be4b557cf949eb22351d276822ef1d6e1d0c2c50fb07c9dda2dbbf4a9bdea211
4
+ data.tar.gz: 8a4296767986573e96b47826ee32849da99b95cfe5d0fc8bd981f16a92d613ed
5
5
  SHA512:
6
- metadata.gz: ca8b97d5a0d98de6fc4d0fb955367df3d4460bccb8e01be610b9763af7c954415c7d393c9e6e2d9846f8245a00c1d803ed22b1cee7e78196b00bdb64aa488ce6
7
- data.tar.gz: 22e0354f7d4661a67529ecdc5fa26db58518c9f3c792183de385364596983c724377a99943f78fa8c181a1a819f76fc6287b20788e73c9eba7e8a9b2ee7af13c
6
+ metadata.gz: a9485c40bd7cd0f0af65c13c0b73e38da162099ee91b35632fe7d7089fa4d3c2d93bf73e5bfca9c272ab7b4dacefe911e2cd4a7226b69248f611c9db0dccbdaa
7
+ data.tar.gz: b15e5e28f6664b8e5f4a3569c674ddbbbd8a5951f3aa48aacbbbfd72fa40653d7ace9b8fb88d5ae167721b2456b4343cb770302ffc1d7924d5b1bddea0276808
data/README.md CHANGED
@@ -33,9 +33,17 @@ root to: "mr_common/registrations/public#new"
33
33
  Copy model/controller/views into the host app for overriding/customizing.
34
34
 
35
35
  ```
36
+ # Registration admin controllers + views
37
+ $ bin/rails g mr_common:admin
38
+ # Registration CSV export + renderer for customization
39
+ $ bin/rails g mr_common:csv (registrations csv export + decoration)
40
+ # Registration model (mostly for customizing validations)
36
41
  $ bin/rails g mr_common:models
42
+ # The public form and success pages
37
43
  $ bin/rails g mr_common:views
44
+ # All of the possible mailers
38
45
  $ bin/rails g mr_common:mailers
46
+ # The public registration and success controllers
39
47
  $ bin/rails g mr_common:controllers
40
48
  ```
41
49
 
@@ -0,0 +1,9 @@
1
+ Description:
2
+ Copy controllers into the host app for customization.
3
+
4
+ Example:
5
+ rails generate mr_common:admin
6
+
7
+ This will create controller overrides for customization at:
8
+ app/controllers/mr_common/registrations/public_controller.rb
9
+ app/controllers/mr_common/registrations/success_controller.rb
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MrCommon
4
+ class AdminGenerator < Rails::Generators::Base
5
+ source_root File.expand_path(MrCommon::Engine.root)
6
+
7
+ def copy_skeleton_views
8
+ template_paths.each do |file|
9
+ copy_file file, file
10
+ end
11
+ end
12
+
13
+ private
14
+
15
+ def template_paths
16
+ %w(
17
+ app/controllers/mr_common/registrations/registrations_controller.rb
18
+ app/views/mr_common/registrations/registrations/_form.html.erb
19
+ app/views/mr_common/registrations/registrations/edit.html.erb
20
+ app/views/mr_common/registrations/registrations/index.html.erb
21
+ app/views/mr_common/registrations/registrations/new.html.erb
22
+ app/views/mr_common/registrations/registrations/show.html.erb
23
+ )
24
+ end
25
+ end
26
+ end
@@ -2,8 +2,6 @@
2
2
 
3
3
  module MrCommon
4
4
  class ControllersGenerator < Rails::Generators::Base
5
- desc "Copy controllers into the host app for customization."
6
-
7
5
  source_root File.expand_path(MrCommon::Engine.root)
8
6
 
9
7
  def copy_skeleton_views
@@ -0,0 +1,10 @@
1
+ Description:
2
+ Copy CSV export controller & renderer into the host app for customization.
3
+
4
+ Example:
5
+ rails generate mr_common:csv
6
+
7
+ This will create controller overrides for customization at:
8
+ app/controllers/mr_common/registrations/export_controller.rb
9
+ app/models/mr_common/csv_renderer.rb
10
+ app/models/mr_common/registration_decorator.rb
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MrCommon
4
+ class CsvGenerator < Rails::Generators::Base
5
+ source_root File.expand_path(MrCommon::Engine.root)
6
+
7
+ def copy_skeleton_views
8
+ template_paths.each do |file|
9
+ copy_file file, file
10
+ end
11
+ end
12
+
13
+ private
14
+
15
+ def template_paths
16
+ %w(
17
+ app/controllers/mr_common/registrations/export_controller.rb
18
+ app/models/mr_common/csv_renderer.rb
19
+ app/models/mr_common/registration_decorator.rb
20
+ )
21
+ end
22
+ end
23
+ end
@@ -2,8 +2,6 @@
2
2
 
3
3
  module MrCommon
4
4
  class MailersGenerator < Rails::Generators::Base
5
- desc "Copy views into the host app for customization."
6
-
7
5
  source_root File.expand_path(MrCommon::Engine.root)
8
6
 
9
7
  def copy_skeleton_views
@@ -2,8 +2,6 @@
2
2
 
3
3
  module MrCommon
4
4
  class ModelsGenerator < Rails::Generators::Base
5
- desc "Copy models into the host app for customization."
6
-
7
5
  source_root File.expand_path(MrCommon::Engine.root)
8
6
 
9
7
  def copy_skeleton_views
@@ -2,8 +2,6 @@
2
2
 
3
3
  module MrCommon
4
4
  class ViewsGenerator < Rails::Generators::Base
5
- desc "Copy views into the host app for customization."
6
-
7
5
  source_root File.expand_path(MrCommon::Engine.root)
8
6
 
9
7
  def copy_skeleton_views
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MrCommon
4
- VERSION = "2.0.0"
4
+ VERSION = "2.1.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mr_common
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Smedstad
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-04 00:00:00.000000000 Z
11
+ date: 2019-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carmen
@@ -267,8 +267,12 @@ files:
267
267
  - db/migrate/20190124160301_add_include_to_reminders.rb
268
268
  - db/migrate/20190522151523_create_pre_registrations.rb
269
269
  - db/migrate/20190530220614_add_confirmed_to_registrations.rb
270
+ - lib/generators/mr_common/admin/USAGE
271
+ - lib/generators/mr_common/admin/admin_generator.rb
270
272
  - lib/generators/mr_common/controllers/USAGE
271
273
  - lib/generators/mr_common/controllers/controllers_generator.rb
274
+ - lib/generators/mr_common/csv/USAGE
275
+ - lib/generators/mr_common/csv/csv_generator.rb
272
276
  - lib/generators/mr_common/mailers/USAGE
273
277
  - lib/generators/mr_common/mailers/mailers_generator.rb
274
278
  - lib/generators/mr_common/models/USAGE
@@ -5139,7 +5143,6 @@ files:
5139
5143
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/zu/Zua9Nzq74BUujb4skry-D8dZbPuJms3YWQy3UEEn_rQ.cache
5140
5144
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/zu/zUAG32gIcSA9Az9BOe9s2Fv1WLrypTJLfPa4q2viYeA.cache
5141
5145
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/zu/zudaAzP8mfLrNZiXCXuyYy1vH7FHVHUpvkYS_1C29Ig.cache
5142
- - spec/dummy/tmp/pids/server.pid
5143
5146
  - spec/factories/registrations.rb
5144
5147
  - spec/factories/reminders.rb
5145
5148
  - spec/factories/users.rb
@@ -5240,7 +5243,6 @@ test_files:
5240
5243
  - spec/dummy/db/migrate/20190115195607_devise_create_users.rb
5241
5244
  - spec/dummy/log/test.log
5242
5245
  - spec/dummy/log/development.log
5243
- - spec/dummy/tmp/pids/server.pid
5244
5246
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/3k/3KOIYGeovinMBLKcNyG_gQnNVvEnYoT0V62l1UogXxk.cache
5245
5247
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/3k/3k-uuvY62W_Nusx-HgkUSUKGU1MhORHvHxTjAUdRHTo.cache
5246
5248
  - spec/dummy/tmp/cache/assets/sprockets/v3.0/5r/5RYNm-45D9gIsN2SRvR508cRlO-43Hdld9sag2QLIZw.cache
@@ -1 +0,0 @@
1
- 25191