hirefire-resource 0.3.9 → 0.3.10

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: 55b749a5f42d84e6bab55c403be81132b083753f
4
- data.tar.gz: 60e1543b6a620b45cc4dc25e38ca07c671db7695
3
+ metadata.gz: cb556134876dc1e32d0f159e747c8a2f5a33fade
4
+ data.tar.gz: 2e6efaf4187a91a5fef377a58d32851cf817bafe
5
5
  SHA512:
6
- metadata.gz: 9e6009e98f7debbda254a5632e5111127bd0f7fa56b59414c024e2cf9ebe1437925a9af14c2e4634dec0aa0d85b6412bd2ffa3d9b3a36b0a4c594566c9ac4e32
7
- data.tar.gz: b2cd03832e203d95728ef05055f074c3056758da9bfd8bac0d89dd5d623df7a15aa5682b3fa3ae797e849ab8f01c918018457b68526c19e44d565168ff9a3bd8
6
+ metadata.gz: 83c5c635ba8a52805f7bccf17253982e3a72ca39dc9e754a0b0b3b5a5e82c9484bf63bad620b236780e4dfed71329814de409ec9daa31510bbcdef9bd3e0e658
7
+ data.tar.gz: d3d3cbc5d63913dd8d396ce5efbd1fd27a9f8953ebb92e0200ff0b721786c90918991887e3abfd5e47618eb86a3a3f7e83a1cfad17e0a4f374a97f514d11ab5a
data/README.md CHANGED
@@ -11,6 +11,7 @@ It supports practically any worker library. We provide out-of-the-box support fo
11
11
  * Qu
12
12
  * QueueClassic
13
13
  * Sidekiq
14
+ * Bunny
14
15
 
15
16
  *Note that you can write your own worker queue logic for almost any other worker library as well.
16
17
  HireFire can scale multiple individual worker libraries at the same time, as well as multiple individual queues for any worker library.*
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = "hirefire-resource"
5
- gem.version = "0.3.9"
5
+ gem.version = "0.3.10"
6
6
  gem.platform = Gem::Platform::RUBY
7
7
  gem.authors = "Michael van Rooijen"
8
8
  gem.email = "michael@hirefire.io"
@@ -2,7 +2,7 @@
2
2
 
3
3
  module HireFire
4
4
  class Middleware
5
-
5
+
6
6
  # Frozen headers to save some memory
7
7
  TEST_HEADERS = {
8
8
  'Content-Type' => 'text/html'
@@ -20,6 +20,9 @@ module HireFire
20
20
  def initialize(app)
21
21
  @app = app
22
22
  @token = ENV["HIREFIRE_TOKEN"]
23
+ if defined?(Rails) && Rails.application.config.relative_url_root
24
+ @path_prefix = Regexp.new("^" + Regexp.escape(Rails.application.config.relative_url_root))
25
+ end
23
26
  end
24
27
 
25
28
  # Will respond to the request here if either the `test` or the `info` url was requested.
@@ -69,12 +72,22 @@ module HireFire
69
72
  "[#{dyno_data.sub(",","")}]"
70
73
  end
71
74
 
75
+
76
+ # Rack PATH_INFO with any RAILS_RELATIVE_URL_ROOT stripped off
77
+ def path
78
+ if @path_prefix
79
+ @env["PATH_INFO"].gsub(@path_prefix, "")
80
+ else
81
+ @env["PATH_INFO"]
82
+ end
83
+ end
84
+
72
85
  # Returns true if the PATH_INFO matches the test url.
73
86
  #
74
87
  # @return [Boolean] true if the requested url matches the test url.
75
88
  #
76
89
  def test?
77
- @env["PATH_INFO"] == "/hirefire/test"
90
+ path == "/hirefire/test"
78
91
  end
79
92
 
80
93
  # Returns true if the PATH_INFO matches the info url.
@@ -82,7 +95,7 @@ module HireFire
82
95
  # @return [Boolean] true if the requested url matches the info url.
83
96
  #
84
97
  def info?
85
- @env["PATH_INFO"] == "/hirefire/#{@token || "development"}/info"
98
+ path == "/hirefire/#{@token || "development"}/info"
86
99
  end
87
100
  end
88
101
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hirefire-resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael van Rooijen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-12 00:00:00.000000000 Z
11
+ date: 2016-03-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Load-based scaling, schedule-based scaling, dyno crash recovery, for
14
14
  web- and worker dynos.
@@ -57,9 +57,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
57
  version: '0'
58
58
  requirements: []
59
59
  rubyforge_project:
60
- rubygems_version: 2.4.5.1
60
+ rubygems_version: 2.5.1
61
61
  signing_key:
62
62
  specification_version: 4
63
63
  summary: Autoscaling for your Heroku dynos
64
64
  test_files: []
65
- has_rdoc: