rubiclifier 2.0.1 → 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 +4 -4
- data/Gemfile +6 -0
- data/lib/base_application.rb +14 -1
- data/lib/cli/rubiclifier_cli.rb +4 -0
- data/lib/cli/template_hydrator.rb +1 -0
- data/lib/feature.rb +1 -0
- data/lib/server.rb +13 -0
- data/project_template/lib/PROJECT_NAME.rb.erb +9 -0
- data/project_template/lib/server.rb +8 -0
- data/project_template/public/index.html.erb +12 -0
- metadata +10 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 28017918c897dbe2c073355b9a7fb68b868a76c7d171089fab957b63943bb106
|
|
4
|
+
data.tar.gz: f183ea8e536a1a889c3c210aa88f3b103276858bbb8e713b7a84d95e23f272a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 397b8a9dceedab109ef2335e6ad0d243bd355b1b776ef39120efbe181e075baba6cc55d597af05651feaada5ef3dff69572cabab4395437b24988dc058a0865a
|
|
7
|
+
data.tar.gz: 37f1383afa0fcd7d9a62803af517ef7136e8c546c9721a89be07500ef5e56ae9eafcd23c764fc27c087230852dbf0d374f9957f4cfbbe59918dab18ce7a4bb30
|
data/Gemfile
CHANGED
data/lib/base_application.rb
CHANGED
|
@@ -18,17 +18,30 @@ module Rubiclifier
|
|
|
18
18
|
def call
|
|
19
19
|
show_help if args.command == "help" || args.boolean("help", "h")
|
|
20
20
|
setup_or_fail if needs_setup?
|
|
21
|
-
|
|
21
|
+
if Feature.enabled?(Feature::SERVER)
|
|
22
|
+
run_server
|
|
23
|
+
else
|
|
24
|
+
run_application
|
|
25
|
+
end
|
|
22
26
|
end
|
|
23
27
|
|
|
24
28
|
def show_help
|
|
25
29
|
raise NotImplementedError
|
|
26
30
|
end
|
|
27
31
|
|
|
32
|
+
def run_server
|
|
33
|
+
raise NotImplementedError
|
|
34
|
+
end
|
|
35
|
+
|
|
28
36
|
def run_application
|
|
29
37
|
raise NotImplementedError
|
|
30
38
|
end
|
|
31
39
|
|
|
40
|
+
def run_server
|
|
41
|
+
server_class.hydrate
|
|
42
|
+
server_class.run!
|
|
43
|
+
end
|
|
44
|
+
|
|
32
45
|
def additional_setup
|
|
33
46
|
end
|
|
34
47
|
|
data/lib/cli/rubiclifier_cli.rb
CHANGED
|
@@ -45,6 +45,10 @@ class RubiclifierCli < Rubiclifier::BaseApplication
|
|
|
45
45
|
unless template_hydrator.feature_enabled?(Rubiclifier::Feature::DATABASE)
|
|
46
46
|
system("rm #{project_name}/migrations.rb")
|
|
47
47
|
end
|
|
48
|
+
unless template_hydrator.feature_enabled?(Rubiclifier::Feature::SERVER)
|
|
49
|
+
system("rm #{project_name}/lib/server.rb")
|
|
50
|
+
system("rm -rf #{project_name}/public")
|
|
51
|
+
end
|
|
48
52
|
puts("Finished creating project #{project_name}! Build out the application in #{project_name}/lib/#{project_name}.rb".green)
|
|
49
53
|
end
|
|
50
54
|
|
|
@@ -35,6 +35,7 @@ class TemplateHydrator
|
|
|
35
35
|
(Rubiclifier::Feature::DATABASE if (args.boolean("database") || include_settings?)),
|
|
36
36
|
(Rubiclifier::Feature::IDLE_DETECTION if args.boolean("idle-detection")),
|
|
37
37
|
(Rubiclifier::Feature::NOTIFICATIONS if args.boolean("notifications")),
|
|
38
|
+
(Rubiclifier::Feature::SERVER if args.boolean("server")),
|
|
38
39
|
].compact
|
|
39
40
|
end
|
|
40
41
|
|
data/lib/feature.rb
CHANGED
data/lib/server.rb
ADDED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
require "rubiclifier"
|
|
2
|
+
<%- if feature_enabled?(Rubiclifier::Feature::SERVER) -%>
|
|
3
|
+
require_relative "./server.rb"
|
|
4
|
+
<%- end -%>
|
|
2
5
|
|
|
3
6
|
class <%= project_name_camel_case %> < Rubiclifier::BaseApplication
|
|
4
7
|
def show_help
|
|
@@ -15,12 +18,18 @@ class <%= project_name_camel_case %> < Rubiclifier::BaseApplication
|
|
|
15
18
|
exit
|
|
16
19
|
end
|
|
17
20
|
|
|
21
|
+
<%- if feature_enabled?(Rubiclifier::Feature::SERVER) -%>
|
|
22
|
+
def server_class
|
|
23
|
+
Server
|
|
24
|
+
end
|
|
25
|
+
<%- else -%>
|
|
18
26
|
def run_application
|
|
19
27
|
while true
|
|
20
28
|
puts "Running!"
|
|
21
29
|
sleep 5
|
|
22
30
|
end
|
|
23
31
|
end
|
|
32
|
+
<%- end -%>
|
|
24
33
|
<%- if !features.empty? -%>
|
|
25
34
|
|
|
26
35
|
def features
|
metadata
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubiclifier
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kyle Grinstead
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-07-
|
|
11
|
+
date: 2020-07-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
|
-
description:
|
|
13
|
+
description:
|
|
14
14
|
email: kyleag@hey.com
|
|
15
15
|
executables:
|
|
16
16
|
- rubiclifier
|
|
@@ -31,6 +31,7 @@ files:
|
|
|
31
31
|
- lib/idle_detector.rb
|
|
32
32
|
- lib/notification.rb
|
|
33
33
|
- lib/rubiclifier.rb
|
|
34
|
+
- lib/server.rb
|
|
34
35
|
- lib/setting.rb
|
|
35
36
|
- project_template/.gitignore
|
|
36
37
|
- project_template/Gemfile
|
|
@@ -40,13 +41,15 @@ files:
|
|
|
40
41
|
- project_template/bin/PROJECT_NAME.erb
|
|
41
42
|
- project_template/lib/PROJECT_NAME.rb.erb
|
|
42
43
|
- project_template/lib/api.rb
|
|
44
|
+
- project_template/lib/server.rb
|
|
43
45
|
- project_template/migrations.rb
|
|
46
|
+
- project_template/public/index.html.erb
|
|
44
47
|
homepage: https://rubygems.org/gems/rubiclifier
|
|
45
48
|
licenses:
|
|
46
49
|
- MIT
|
|
47
50
|
metadata:
|
|
48
51
|
source_code_uri: https://github.com/MrGrinst/rubiclifier
|
|
49
|
-
post_install_message:
|
|
52
|
+
post_install_message:
|
|
50
53
|
rdoc_options: []
|
|
51
54
|
require_paths:
|
|
52
55
|
- lib
|
|
@@ -61,9 +64,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
61
64
|
- !ruby/object:Gem::Version
|
|
62
65
|
version: '0'
|
|
63
66
|
requirements: []
|
|
64
|
-
rubyforge_project:
|
|
67
|
+
rubyforge_project:
|
|
65
68
|
rubygems_version: 2.7.6.2
|
|
66
|
-
signing_key:
|
|
69
|
+
signing_key:
|
|
67
70
|
specification_version: 4
|
|
68
71
|
summary: Easily spin up new Ruby CLI applications with built-in backgrounding and
|
|
69
72
|
data storage.
|