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 +4 -4
- data/app/controllers/mobile_workflow/sns_notifications_controller.rb +1 -1
- data/bin/mwf +1 -0
- data/lib/generators/mobile_workflow/install/install_generator.rb +9 -4
- data/lib/generators/mobile_workflow/install/templates/Gemfile.erb +2 -5
- data/lib/mobile_workflow/cli/app_builder.rb +19 -0
- data/lib/mobile_workflow/cli/app_server_generator.rb +8 -23
- data/lib/mobile_workflow/version.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59a42474dd2320d74da05ae06c5b5b143d7b916bc0be5672d5bbf9e725dadfa4
|
4
|
+
data.tar.gz: bd0c2418cfdb2c57f05c7cebe8caec037c96f4aa15bf9f1a0cd04e9fd531dad9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f95219a039c62458cd5e93a6d2ff859e4c2a8ff6bd39f8ae941e4d1cd63d9daf9b316ce1b9454a16969c84a16c8bb9e46a42dc6087425222613b971be359e524
|
7
|
+
data.tar.gz: 7b2b4f522160353494ba0b3ab1228622fb7e8cf8f104c5d76c2dc522023aacad57d67c3d773bb953d11615d2c2e460ec2a641d9785cef5ccc16d99714abe8e49
|
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 = ["
|
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(
|
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.
|
8
|
-
gem 'puma', '~>
|
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
|
-
|
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
|
-
|
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
|
-
|
79
|
-
|
80
|
-
|
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
|
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.
|
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-
|
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.
|
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.
|
26
|
+
version: 6.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sqlite3
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|