excursion 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/excursion/configuration.rb +1 -0
- data/lib/excursion/pool.rb +6 -0
- data/lib/excursion/railtie.rb +9 -2
- data/lib/excursion/version.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: be2a3cb7d997adbc38933aedf823d0b00a1c44d9
|
4
|
+
data.tar.gz: cc763af9f9e4a9dfa69f72cdd6a379ad94d67d56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 477b67102b31003e5b4e8c08874ab6cf3932aa2f9c0a87db4fd2146c40657f1c692d0c5a6018a4e0bb1048acd1475048add444cc43cab01ab2cb61657f79dda3
|
7
|
+
data.tar.gz: 5256657d09ecb61edcad0a423e6bf670689e4eac4f2695eca351c4e4cc9ea102fffa2dcb96dc27005efd2fac38e48e9c435930a257c626fe5923cc5b15f5edf4
|
@@ -4,6 +4,7 @@ module Excursion
|
|
4
4
|
# TODO
|
5
5
|
# exclude_pattern: to exclude certain routes from being shared
|
6
6
|
# include_pattern: to only include certain routes
|
7
|
+
register_app: true, # whether or not to register the app automatically on init
|
7
8
|
default_url_options: {}, # default_url_options used when building routes for this app
|
8
9
|
retry_limit: 3 # retry limit for datasources that user remote servers
|
9
10
|
}
|
data/lib/excursion/pool.rb
CHANGED
@@ -21,6 +21,12 @@ module Excursion
|
|
21
21
|
datasource.set(name, @@applications[name].to_cache)
|
22
22
|
end
|
23
23
|
|
24
|
+
def self.remove_application(app)
|
25
|
+
name = app.class.name.underscore.split("/").first
|
26
|
+
datasource.delete(name)
|
27
|
+
@@applications.delete(name)
|
28
|
+
end
|
29
|
+
|
24
30
|
def self.datasource
|
25
31
|
raise NoDatasourceError, "You must configure excursion with a datasource." if Excursion.configuration.datasource.nil?
|
26
32
|
require "excursion/datasources/#{Excursion.configuration.datasource.to_s}"
|
data/lib/excursion/railtie.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
module Excursion
|
2
2
|
class Railtie < Rails::Railtie
|
3
3
|
config.after_initialize do |app|
|
4
|
-
|
5
|
-
|
4
|
+
unless Excursion.configuration.register_app == false
|
5
|
+
app.reload_routes!
|
6
|
+
Excursion::Pool.register_application(app)
|
7
|
+
end
|
6
8
|
end
|
7
9
|
|
8
10
|
rake_tasks do
|
@@ -11,6 +13,11 @@ module Excursion
|
|
11
13
|
task :register => :environment do
|
12
14
|
Excursion::Pool.register_application(Rails.application)
|
13
15
|
end
|
16
|
+
|
17
|
+
desc "Remove this app and it's routes from the route pool"
|
18
|
+
task :remove => :environment do
|
19
|
+
Excursion::Pool.remove_application(Rails.application)
|
20
|
+
end
|
14
21
|
end
|
15
22
|
end
|
16
23
|
end
|
data/lib/excursion/version.rb
CHANGED