eworld 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eworld.rb +53 -5
- data/lib/routes/generate_api_entities.rb +35 -0
- data/lib/routes/generate_ui_routes.rb +51 -0
- data/lib/version.rb +1 -1
- data/opt/config/schema.yml +36 -2
- data/opt/config/template.yml +10 -1
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dabd36b84d249c382e7f1fd077f927536f491ae5
|
4
|
+
data.tar.gz: 70f52a1bbce657d4a73ebf8d6dae044989bbd520
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe007a4bd2286e8d6f7452144040d46e2a2b32d4546893799c527837648ee96568c36a7cdcb98a5f702075be401d92afdee4e7643b0f9a187d20a1ff8e06fb44
|
7
|
+
data.tar.gz: b300fefc9711e4c9d042947f6007afbcce95ae671c85dce82e92c7b9acb28dd6081b5897dce7d024d1ead16a8068b87199b3caaa9d55c234726a8af7558c3c48
|
data/lib/eworld.rb
CHANGED
@@ -20,6 +20,7 @@ module App
|
|
20
20
|
|
21
21
|
unless ARGV[0] == 'config' || ARGV[0] == 'x'
|
22
22
|
Blufin::Config::init(SCHEMA_FILE, TEMPLATE_FILE, CONFIG_FILE, GEM_NAME)
|
23
|
+
Blufin::Projects.new(Blufin::Config::get['Projects'])
|
23
24
|
end
|
24
25
|
|
25
26
|
Convoy::App.create do |eworld|
|
@@ -28,14 +29,61 @@ module App
|
|
28
29
|
eworld.summary <<TEMPLATE
|
29
30
|
\x1B[48;5;89m\x1B[38;5;255m eWorld-CLI \x1B[0m\x1B[0m \x1B[38;5;89m\xe2\x80\x94 eWorld Commmand-Line Interface\x1B[38;5;248m
|
30
31
|
|
31
|
-
_
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
__ __ _ _ _ _
|
33
|
+
__\\ \\ / /__ _ __| | __| | ___| (_)
|
34
|
+
/ _ \\ \\ /\\ / / _ \\| '__| |/ _` |_____ / __| | |
|
35
|
+
| __/\\ V V / (_) | | | | (_| |_____| (__| | |
|
36
|
+
\\___| \\_/\\_/ \\___/|_| |_|\\__,_| \\___|_|_|\x1B[0m
|
36
37
|
TEMPLATE
|
37
38
|
eworld.description "\x1B[38;5;240mAn internal tool intended for improving/automating development tasks.\x1B[0m"
|
38
39
|
|
40
|
+
# g - GENERATE
|
41
|
+
eworld.command :generate, :aliases => [:g] do |generate|
|
42
|
+
generate.summary 'Generate boiler-plate code'
|
43
|
+
# a - GENERATE API
|
44
|
+
generate.command :api, :aliases => [:a] do |generate_api|
|
45
|
+
generate_api.summary 'Generate API code'
|
46
|
+
# e - GENERATE API ENTITIES
|
47
|
+
generate_api.command :api_entities, :aliases => [:e] do |generate_api_entities|
|
48
|
+
generate_api_entities.summary 'Generate boiler-plate entity code'
|
49
|
+
generate_api_entities.action do |opts, args|
|
50
|
+
AppCommand::GenerateApiEntities.new(opts, args).execute
|
51
|
+
end
|
52
|
+
end
|
53
|
+
# GENERATE API (Default)
|
54
|
+
generate_api.action do
|
55
|
+
system("#{App::GEM_NAME} g a -h")
|
56
|
+
end
|
57
|
+
end
|
58
|
+
# generate - GENERATE UI
|
59
|
+
generate.command :ui, :aliases => [:u] do |generate_ui|
|
60
|
+
generate_ui.summary 'Generate UI code'
|
61
|
+
# r - GENERATE UI ROUTES
|
62
|
+
generate_ui.command :ui_routes, :aliases => [:r] do |generate_ui_routes|
|
63
|
+
generate_ui_routes.summary 'Generate routes.js (and blank routes if not exists)'
|
64
|
+
generate_ui_routes.action do |opts, args|
|
65
|
+
AppCommand::GenerateUiRoutes.new(opts, args).execute
|
66
|
+
end
|
67
|
+
end
|
68
|
+
# GENERATE UI (Default)
|
69
|
+
generate_ui.action do
|
70
|
+
system("#{App::GEM_NAME} g u -h")
|
71
|
+
end
|
72
|
+
end
|
73
|
+
# GENERATE (Default)
|
74
|
+
generate.action do
|
75
|
+
system("#{App::GEM_NAME} g -h")
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# u - UPDATE
|
80
|
+
eworld.command :update, :aliases => [:u] do |update|
|
81
|
+
update.summary 'Check for updates'
|
82
|
+
update.action do
|
83
|
+
Blufin::Update::run(App::GEM_NAME)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
39
87
|
# x - CONFIG
|
40
88
|
eworld.command :config, :aliases => [:x] do |config|
|
41
89
|
config.summary 'Setup your configuration file'
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module AppCommand
|
2
|
+
|
3
|
+
class GenerateApiEntities < ::Convoy::ActionCommand::Base
|
4
|
+
|
5
|
+
def execute
|
6
|
+
|
7
|
+
begin
|
8
|
+
|
9
|
+
@opts = command_options
|
10
|
+
@args = arguments
|
11
|
+
|
12
|
+
opts_validate
|
13
|
+
opts_routing
|
14
|
+
|
15
|
+
rescue => e
|
16
|
+
|
17
|
+
Blufin::Terminal::print_exception(e)
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def opts_validate
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
def opts_routing
|
28
|
+
|
29
|
+
raise RuntimeError, 'Not yet implemented!'
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module AppCommand
|
2
|
+
|
3
|
+
class GenerateUiRoutes < ::Convoy::ActionCommand::Base
|
4
|
+
|
5
|
+
def execute
|
6
|
+
|
7
|
+
begin
|
8
|
+
|
9
|
+
@opts = command_options
|
10
|
+
@args = arguments
|
11
|
+
|
12
|
+
opts_validate
|
13
|
+
opts_routing
|
14
|
+
|
15
|
+
rescue => e
|
16
|
+
|
17
|
+
Blufin::Terminal::print_exception(e)
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def opts_validate
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
def opts_routing
|
28
|
+
|
29
|
+
ui_projects = Blufin::Projects.get_projects_as_array(type: Blufin::Projects::TYPE_UI)
|
30
|
+
project = Blufin::Projects.show_project_prompt(ui_projects)
|
31
|
+
|
32
|
+
@errors, @warnings = Blufin::GenerateUiRoutes::run(project)
|
33
|
+
|
34
|
+
# TODO - Have a way to display these.
|
35
|
+
# puts @errors.inspect
|
36
|
+
# puts @warnings.inspect
|
37
|
+
|
38
|
+
# Display errors, if any.
|
39
|
+
if @errors.any?
|
40
|
+
Blufin::Terminal::error('Please fix the following issues:', nil, false)
|
41
|
+
@errors.each { |error| puts " #{error}" }
|
42
|
+
puts
|
43
|
+
exit 1
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
data/lib/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
EWORLD_VERSION = '1.
|
1
|
+
EWORLD_VERSION = '1.2.0'
|
data/opt/config/schema.yml
CHANGED
@@ -1,4 +1,38 @@
|
|
1
1
|
type: map
|
2
2
|
mapping:
|
3
|
-
|
4
|
-
|
3
|
+
Databases:
|
4
|
+
type: seq
|
5
|
+
required: yes
|
6
|
+
sequence:
|
7
|
+
- type: map
|
8
|
+
mapping:
|
9
|
+
Name:
|
10
|
+
required: yes
|
11
|
+
Type:
|
12
|
+
required: yes
|
13
|
+
enum: [MySQL, MSSQL, Oracle]
|
14
|
+
Host:
|
15
|
+
required: yes
|
16
|
+
User:
|
17
|
+
required: yes
|
18
|
+
Password:
|
19
|
+
required: yes
|
20
|
+
DefaultSchema:
|
21
|
+
required: yes
|
22
|
+
Projects:
|
23
|
+
type: map
|
24
|
+
mapping:
|
25
|
+
Local:
|
26
|
+
type: map
|
27
|
+
mapping:
|
28
|
+
File:
|
29
|
+
required: yes
|
30
|
+
S3Bucket:
|
31
|
+
type: map
|
32
|
+
mapping:
|
33
|
+
Name:
|
34
|
+
required: yes
|
35
|
+
File:
|
36
|
+
required: yes
|
37
|
+
Region:
|
38
|
+
required: yes
|
data/opt/config/template.yml
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eworld
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Albert Rannetsperger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blufin-lib
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.8.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: 1.
|
26
|
+
version: 1.8.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: columnist
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -64,6 +64,8 @@ files:
|
|
64
64
|
- bin/eworld
|
65
65
|
- lib/core/opt.rb
|
66
66
|
- lib/eworld.rb
|
67
|
+
- lib/routes/generate_api_entities.rb
|
68
|
+
- lib/routes/generate_ui_routes.rb
|
67
69
|
- lib/version.rb
|
68
70
|
- opt/config/schema.yml
|
69
71
|
- opt/config/template.yml
|
@@ -87,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
89
|
version: '0'
|
88
90
|
requirements: []
|
89
91
|
rubyforge_project:
|
90
|
-
rubygems_version: 2.
|
92
|
+
rubygems_version: 2.5.1
|
91
93
|
signing_key:
|
92
94
|
specification_version: 4
|
93
95
|
summary: eWorld-CLI.
|