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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c00b9ecae0eade20f5d304fb6f9503d88f25896
4
- data.tar.gz: 6fe81131c111fc54d8271e4fdd730b7d2cf2fcf7
3
+ metadata.gz: f266d47777e51ab5888d29053f1de1b0b4a45372
4
+ data.tar.gz: 8833d8a50ee08ec33b67716945b38311e3415476
5
5
  SHA512:
6
- metadata.gz: 19ee2062a4a7eb861fffd094d1d9fa0ce7ccb867d0156ffeb92e86931080664fd0a63a4311fc5a3b737fae3f690caea7c23a451e1dda8636a61a89359d777718
7
- data.tar.gz: fa355662c6eef79d9547069e9e75430d7d7bb06cb54ea0e380ddf033bc1eef315fabe533da7381b87d0b6aa8c9d50668de17f8c935dd62a6084514639a75edd3
6
+ metadata.gz: 0e5250e8d62c535dc25856d818e84024f9c963e33619125014ae4bedfb39b8f7f0a91f3eebb197e6cef06dceca4609c34c3acf38f9fe4b8d0029dba2dada9bdc
7
+ data.tar.gz: eb7f3ed466d2864126d386013ce99aa7696c9799b59e8b2799efd8c16f7e9bd4aedbca94411e3719c66856e7ddf05abf6d342f853e70eabbbec33f6d9d0b080c
@@ -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
@@ -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
- config.autoload_paths = ["#{Jarvis.root}/app/services"]
20
+
21
+ # Autoload Services
22
+ config.autoload_paths = ["bot/services"]
14
23
  end
15
24
  end
16
25
  end
@@ -8,7 +8,7 @@ module Jarvis
8
8
  register Sinatra::MultiRoute
9
9
 
10
10
  get "/" do
11
- json text: "Hello, I'm Jarvis"
11
+ json text: Jarvis::ArrayResponder.new(Jarvis.config.hello_message).respond
12
12
  end
13
13
 
14
14
  route :get, :post, "/jarvis" do
@@ -1,3 +1,3 @@
1
1
  module Jarvis
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -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 << "#{Jarvis.root}/bot/models"
10
+ # config.autoload_paths += "bot/models"
11
11
  end
12
12
  Jarvis.bootstrap
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jarvis-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - DVG