jarvis-cli 0.1.1 → 0.1.2
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/lib/jarvis/application.rb +12 -0
- data/lib/jarvis/configuration.rb +10 -1
- data/lib/jarvis/server.rb +1 -1
- data/lib/jarvis/version.rb +1 -1
- data/templates/project/config/environment.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f266d47777e51ab5888d29053f1de1b0b4a45372
|
4
|
+
data.tar.gz: 8833d8a50ee08ec33b67716945b38311e3415476
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e5250e8d62c535dc25856d818e84024f9c963e33619125014ae4bedfb39b8f7f0a91f3eebb197e6cef06dceca4609c34c3acf38f9fe4b8d0029dba2dada9bdc
|
7
|
+
data.tar.gz: eb7f3ed466d2864126d386013ce99aa7696c9799b59e8b2799efd8c16f7e9bd4aedbca94411e3719c66856e7ddf05abf6d342f853e70eabbbec33f6d9d0b080c
|
data/lib/jarvis/application.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
module Jarvis
|
2
2
|
class Application
|
3
|
+
require 'active_support/dependencies'
|
4
|
+
|
3
5
|
def self.initialize!
|
6
|
+
add_jarvis_root_to_load_path
|
7
|
+
autoload_paths
|
4
8
|
require File.join Jarvis.root, "bot/server"
|
5
9
|
require_initializers
|
6
10
|
end
|
@@ -10,5 +14,13 @@ module Jarvis
|
|
10
14
|
require file
|
11
15
|
end
|
12
16
|
end
|
17
|
+
|
18
|
+
def self.autoload_paths
|
19
|
+
ActiveSupport::Dependencies.autoload_paths += Jarvis.config.autoload_paths
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.add_jarvis_root_to_load_path
|
23
|
+
$: << Jarvis.root
|
24
|
+
end
|
13
25
|
end
|
14
26
|
end
|
data/lib/jarvis/configuration.rb
CHANGED
@@ -6,11 +6,20 @@ module Jarvis
|
|
6
6
|
def self.included(base)
|
7
7
|
base.include ActiveSupport::Configurable
|
8
8
|
base.configure do |config|
|
9
|
+
|
10
|
+
# Bot Name
|
11
|
+
config.bot_name = "Jarvis"
|
12
|
+
|
13
|
+
# These messages can be overridden in the Application configuration. If an array of strings are provided,
|
14
|
+
# a random one will be selected
|
15
|
+
config.hello_message = "Hello, I'm #{config.bot_name}"
|
9
16
|
config.default_response = "What is this, I don't even"
|
10
17
|
config.unfit_environment_response = "I'm really sorry, but that service needs to be configured"
|
11
18
|
config.third_party_api_failure_respone = "Most unfortunately, that service is not working right now."
|
12
19
|
config.standard_error_response = "I'm sorry, Something went wrong."
|
13
|
-
|
20
|
+
|
21
|
+
# Autoload Services
|
22
|
+
config.autoload_paths = ["bot/services"]
|
14
23
|
end
|
15
24
|
end
|
16
25
|
end
|
data/lib/jarvis/server.rb
CHANGED
data/lib/jarvis/version.rb
CHANGED
@@ -7,6 +7,6 @@ Jarvis.configure do |config|
|
|
7
7
|
# config.default_response = "What is this, I don't even"
|
8
8
|
|
9
9
|
# Add additional autoload directories to autoload_paths
|
10
|
-
# config.autoload_paths
|
10
|
+
# config.autoload_paths += "bot/models"
|
11
11
|
end
|
12
12
|
Jarvis.bootstrap
|