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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 70d3b67fdc9a21e72d9d1c5571f3a2c3010f45a2
4
- data.tar.gz: ebdec9417ed30b61d4eaa1eb966ea406a0ea6821
3
+ metadata.gz: be2a3cb7d997adbc38933aedf823d0b00a1c44d9
4
+ data.tar.gz: cc763af9f9e4a9dfa69f72cdd6a379ad94d67d56
5
5
  SHA512:
6
- metadata.gz: 057db352ba02d3f2c41507b88237cb6ab6afb7c7c1b52cc526e6c4d99a117fd3408a1490b8936281c69b0f2d4953bac810d4af339e60d0212dd81792b6d00451
7
- data.tar.gz: 3d3b389f2d04646bc130f9c970a34764864979cf7e546dcf8cafade41dcea0c64e2041e26ab9d3a69c4b77754f7cf0b18715c1ecbc28348eb7e3d4ec51688570
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
  }
@@ -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}"
@@ -1,8 +1,10 @@
1
1
  module Excursion
2
2
  class Railtie < Rails::Railtie
3
3
  config.after_initialize do |app|
4
- app.reload_routes!
5
- Excursion::Pool.register_application(app)
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
@@ -1,3 +1,3 @@
1
1
  module Excursion
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excursion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rebec