mobile_workflow 0.5.1 → 0.5.6

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: a1d55314927070ee5d1b4498b99b760952214839e146ae0e271bc2ff49a1fce9
4
- data.tar.gz: e666ed9c786f10335e1d30505a4f62059636034821d3e4e2d17d532929bfee93
3
+ metadata.gz: a2a4d13fe23a8f256052b54fa14424c54d847bb327bf57128159b9dd8ffd334a
4
+ data.tar.gz: 0aa96388f99ac5f8ae69a1e6a06559c58c9eab58c355f877b259137472a3b176
5
5
  SHA512:
6
- metadata.gz: 80da58aa822183db3273fd34e89b9563040349bc17b60f8817f467f59561e2d7e1684ecaa48b85f88e3993ac7819538fb0515b0aeaddf513727f3f033117b5be
7
- data.tar.gz: 6ad8369700ca16b92de687238fabad59f9bd695c9b8941d85beae13edd38d338a658edc5e5085439c3944d63f855f5ae3078ed4cd17467283dd121b7d4b8e848
6
+ metadata.gz: 7f5890bf8381f177530fe3607e5ec4fe276258638f4a28213665c7c2dab5724ed14fb4a9f3ea3027581c41499c4fb995701e4b08138d0d31466f4781aa8f279e
7
+ data.tar.gz: 7b5c52f4a9b754078eb0c1a70b6213bf5b33f9825f1c67ce0325199b5c2bc1038cde0044b951baccdb6120c7fa2b46546349258c444cca4db7b438a96dbd5b3f
@@ -1,5 +1,5 @@
1
1
  module MobileWorkflow
2
- class SnsNotificationsController < ApiController
2
+ class SnsNotificationsController < ActionController::API
3
3
  if Object.const_defined?("Aws::S3") && Object.const_defined?("Aws::SNS")
4
4
  before_action :verify_request_authenticity
5
5
 
@@ -78,7 +78,7 @@ module MobileWorkflow
78
78
 
79
79
  def read_openapi_spec
80
80
  say "Loading OpenAPI Spec: #{open_api_spec_path}"
81
- return JSON.parse(File.read(File.join(Rails.root, open_api_spec_path))).with_indifferent_access
81
+ return JSON.parse(File.read(open_api_spec_path)).with_indifferent_access
82
82
  end
83
83
 
84
84
  def open_api_spec_path
@@ -11,7 +11,8 @@ gem 'turbolinks', '~> 5'
11
11
 
12
12
  # Mobile Workflow
13
13
  #gem 'mobile_workflow', path: '../mobile_workflow'
14
- gem 'mobile_workflow', github: 'FutureWorkshops/mobile_workflow'
14
+ #gem 'mobile_workflow', github: 'FutureWorkshops/mobile_workflow'
15
+ gem 'mobile_workflow', '0.5.5'
15
16
 
16
17
  # Authorisation / Authentication
17
18
  <%- if options[:doorkeeper_oauth] %>
@@ -16,6 +16,25 @@ module MobileWorkflow::Cli
16
16
  def rspec_generator
17
17
  generate 'rspec:install'
18
18
  end
19
+
20
+ def administrate_generator
21
+ Bundler.with_unbundled_env { generate 'administrate:install' }
22
+
23
+ file 'app/assets/config/manifest.js', <<-CODE
24
+ //= link administrate/application.css
25
+ //= link administrate/application.js
26
+ CODE
27
+
28
+ file 'app/controllers/admin/application_controller.rb', <<-CODE
29
+ module Admin
30
+ class ApplicationController < Administrate::ApplicationController
31
+ http_basic_authenticate_with(name: ENV["ADMIN_USER"], password: ENV["ADMIN_PASSWORD"])
32
+ end
33
+ end
34
+ CODE
35
+
36
+ Bundler.with_unbundled_env { generate 'administrate:routes' }
37
+ end
19
38
 
20
39
  def ability_generator
21
40
  copy_file 'ability.rb', 'app/models/ability.rb'
@@ -37,7 +37,7 @@ module MobileWorkflow::Cli
37
37
  build :active_storage if options[:s3_storage]
38
38
  build :mobile_workflow_generator, ARGV[1]
39
39
  setup_db
40
- generate_administrate
40
+ build :administrate_generator
41
41
 
42
42
  generate_dot_env
43
43
  initial_git_commit
@@ -51,33 +51,18 @@ module MobileWorkflow::Cli
51
51
  protected
52
52
 
53
53
  def get_builder_class
54
- MobileWorkflow::Cli::AppBuilder
54
+ ::MobileWorkflow::Cli::AppBuilder
55
55
  end
56
56
 
57
57
  # Todo: MBS - move these methods to the builder class
58
58
  # Ideally override RailsBuilder methods
59
59
  private
60
- def generate_administrate
61
- generate 'administrate:install'
62
- file 'app/assets/config/manifest.js', <<-CODE
63
- //= link administrate/application.css
64
- //= link administrate/application.js
65
- CODE
66
-
67
- file 'app/controllers/admin/application_controller.rb', <<-CODE
68
- module Admin
69
- class ApplicationController < Administrate::ApplicationController
70
- http_basic_authenticate_with(name: ENV["ADMIN_USER"], password: ENV["ADMIN_PASSWORD"])
71
- end
72
- end
73
- CODE
74
- generate 'administrate:routes'
75
- end
76
-
77
60
  def setup_db
78
- rails_command "db:drop"
79
- rails_command "db:create"
80
- rails_command "db:migrate"
61
+ Bundler.with_unbundled_env do
62
+ rails_command("db:drop")
63
+ rails_command("db:create")
64
+ rails_command("db:migrate")
65
+ end
81
66
  end
82
67
 
83
68
  def initial_git_commit
@@ -1,5 +1,5 @@
1
1
  module MobileWorkflow
2
- VERSION = '0.5.1'
2
+ VERSION = '0.5.6'
3
3
  RUBY_VERSION = '2.5.5'
4
4
  RAILS_VERSION = '6.1.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mobile_workflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brooke-Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-28 00:00:00.000000000 Z
11
+ date: 2020-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails