mobile_workflow 0.5.0 → 0.5.5

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: db09862ea4eafb49f52d1d37ca42e97408b77e0e0d406d00d83fb83ab47e00a1
4
- data.tar.gz: f7720006c7171c7e4ca98861497de3f8064ffed9e4bad53c9a8205d35adf6624
3
+ metadata.gz: 59a42474dd2320d74da05ae06c5b5b143d7b916bc0be5672d5bbf9e725dadfa4
4
+ data.tar.gz: bd0c2418cfdb2c57f05c7cebe8caec037c96f4aa15bf9f1a0cd04e9fd531dad9
5
5
  SHA512:
6
- metadata.gz: c8935b569351f6f584d9587ca9e250425f44b8a8a2ed0829d04032d889216ad92c2333ceba287c354eb3d6d679716889a335e5dbecedeba4ee5cfa975d19b1fb
7
- data.tar.gz: 5c9856de14ffb565562078371a1b9b8bbef2529f80c2ae027378f4a73d41effe9737091563d567f911b9ff81d29ab668d6fb91ce753afb6f69e4d5514b1172af
6
+ metadata.gz: f95219a039c62458cd5e93a6d2ff859e4c2a8ff6bd39f8ae941e4d1cd63d9daf9b316ce1b9454a16969c84a16c8bb9e46a42dc6087425222613b971be359e524
7
+ data.tar.gz: 7b2b4f522160353494ba0b3ab1228622fb7e8cf8f104c5d76c2dc522023aacad57d67c3d773bb953d11615d2c2e460ec2a641d9785cef5ccc16d99714abe8e49
@@ -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
 
data/bin/mwf CHANGED
@@ -10,6 +10,7 @@ end
10
10
  if ARGV.empty?
11
11
  puts "USAGE: mwf <platform> <command> [options]"
12
12
  puts "Example: mwf rails create:app_server --help"
13
+ puts "Example: mwf rails destroy:app_server --help"
13
14
  exit 0
14
15
  elsif ['-v', '--version'].include? ARGV[0]
15
16
  puts MobileWorkflow::VERSION
@@ -5,12 +5,13 @@ module MobileWorkflow
5
5
  class InstallGenerator < Rails::Generators::Base
6
6
 
7
7
  # Schemas to avoid generating models for (static items from MW)
8
- SKIP_SCHEMAS = ["answer", "attachment", "ListItem", "DisplayItem", "DisplayText", "DisplayButton", "DisplayImage", "DisplayVideo"]
8
+ SKIP_SCHEMAS = ["attachment", "ListItem", "DisplayItem", "DisplayText", "DisplayButton", "DisplayImage", "DisplayVideo"]
9
9
 
10
10
  source_root File.expand_path("../templates", __FILE__)
11
11
 
12
12
  class_option :open_api_spec_path, type: :string, default: "config/open_api_spec.json"
13
13
  class_option :doorkeeper_oauth, type: :boolean, default: false
14
+ class_option :interactive, type: :boolean, default: false
14
15
 
15
16
  def create_api_controller
16
17
  template("api_controller.rb.erb", "app/controllers/api_controller.rb")
@@ -59,7 +60,7 @@ module MobileWorkflow
59
60
  end
60
61
 
61
62
  def generate_seeds
62
- template("seeds.rb.erb", "db/seeds.rb")
63
+ template("seeds.rb.erb", "db/seeds.rb", force: true)
63
64
  end
64
65
 
65
66
  private
@@ -77,16 +78,20 @@ module MobileWorkflow
77
78
 
78
79
  def read_openapi_spec
79
80
  say "Loading OpenAPI Spec: #{open_api_spec_path}"
80
- 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
81
82
  end
82
83
 
83
84
  def open_api_spec_path
84
85
  options[:open_api_spec_path]
85
86
  end
86
87
 
88
+ def interactive?
89
+ options[:interactive]
90
+ end
91
+
87
92
  def model_properties(name, schema)
88
93
  generated_properties_args = schema["properties"].keys.collect{|key| "#{key}:#{model_property_type(schema["properties"][key])}" }.join(" ")
89
- if yes?("Use generated schema #{name}(#{generated_properties_args})[yn]?")
94
+ if !interactive? || yes?("Use generated schema #{name}(#{generated_properties_args})[yn]?")
90
95
  generated_properties_args
91
96
  else
92
97
  ask "Specify schema for #{name}: (e.g. text:string image:attachment region:reference)"
@@ -4,11 +4,10 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
4
4
  ruby '2.6.6'
5
5
 
6
6
  # Core Gems
7
- gem 'rails', '~> 6.0.2', '>= 6.0.2.2'
8
- gem 'puma', '~> 4.1'
7
+ gem 'rails', '~> 6.1.0'
8
+ gem 'puma', '~> 5.0'
9
9
  gem 'sass-rails', '>= 6'
10
10
  gem 'turbolinks', '~> 5'
11
- gem 'bootsnap', '>= 1.4.2', require: false
12
11
 
13
12
  # Mobile Workflow
14
13
  #gem 'mobile_workflow', path: '../mobile_workflow'
@@ -36,8 +35,6 @@ gem 'aws-sdk-sns', '~> 1.23'
36
35
  group :development do
37
36
  gem 'web-console', '>= 3.3.0'
38
37
  gem 'listen', '>= 3.0.5', '< 3.2'
39
- gem 'spring'
40
- gem 'spring-watcher-listen', '~> 2.0.0'
41
38
  end
42
39
 
43
40
  group :development, :test do
@@ -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'
@@ -9,6 +9,7 @@ module MobileWorkflow::Cli
9
9
  class_option :skip_test, type: :boolean, default: true, desc: "Skip Test Unit"
10
10
  class_option :force, type: :boolean, default: true, desc: "Force overwrite"
11
11
  class_option :skip_webpack_install, type: :boolean, default: true, desc: "Skip webpacker installation"
12
+ class_option :skip_bootsnap, type: :boolean, default: true, desc: "Skip Bootsnap"
12
13
 
13
14
  class_option :version, type: :boolean, aliases: "-v", desc: "Show version number and quit"
14
15
  class_option :help, type: :boolean, aliases: '-h', desc: "Show this help message and quit"
@@ -30,14 +31,13 @@ module MobileWorkflow::Cli
30
31
  def finish_template
31
32
  super
32
33
  after_bundle do
33
- run "spring stop"
34
34
  build :procfiles
35
35
  build :rspec_generator
36
36
  build :ability_generator
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
- MobileWorkflowCli::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.0'
2
+ VERSION = '0.5.5'
3
3
  RUBY_VERSION = '2.5.5'
4
- RAILS_VERSION = '6.0.0'
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.0
4
+ version: 0.5.5
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-27 00:00:00.000000000 Z
11
+ date: 2020-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 6.0.0
19
+ version: 6.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 6.0.0
26
+ version: 6.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sqlite3
29
29
  requirement: !ruby/object:Gem::Requirement