rack-process-name 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +3 -5
  2. data/lib/rack-process-name.rb +11 -1
  3. metadata +18 -4
data/README.md CHANGED
@@ -15,15 +15,13 @@ The letter before the request method means:
15
15
  Installation
16
16
  ============
17
17
 
18
- In Rails, add to your Gemfile:
18
+ In Rails, just add to your Gemfile:
19
19
 
20
20
  gem 'rack-process-name'
21
21
 
22
- then in application.rb or in one of config/environments/*.rb:
22
+ the gem will include itself as middleware.
23
23
 
24
- config.middleware.use Rack::ProcessName
25
-
26
- If using config.ru:
24
+ If in Sinatra or using config.ru:
27
25
 
28
26
  require 'rack-process-name'
29
27
  use Rack::ProcessName
@@ -1,3 +1,5 @@
1
+ require "rack"
2
+
1
3
  module Rack
2
4
  class ProcessName
3
5
  def initialize(app)
@@ -17,7 +19,15 @@ module Rack
17
19
  end
18
20
 
19
21
  def set(info, state = nil)
20
- $0 = "#{@name} #{state} #{info}"
22
+ $0 = "Rack: #{state} #{info}"
23
+ end
24
+
25
+ if defined?(Rails::Railtie)
26
+ class Railtie < Rails::Railtie
27
+ initializer "rack_process_name.use_middleware" do |app|
28
+ app.config.middleware.use Rack::ProcessName
29
+ end
30
+ end
21
31
  end
22
32
  end
23
33
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-process-name
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Visnu Pitiyanuvath
@@ -34,6 +34,20 @@ dependencies:
34
34
  version: 0.9.0
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: sinatra
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 3
46
+ segments:
47
+ - 0
48
+ version: "0"
49
+ type: :development
50
+ version_requirements: *id002
37
51
  description: Rack::ProcessName is rack middleware to set the ruby process name to whatever request is currently being processed.
38
52
  email: visnupx@gmail.com
39
53
  executables: []
@@ -76,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
90
  requirements: []
77
91
 
78
92
  rubyforge_project:
79
- rubygems_version: 1.5.2
93
+ rubygems_version: 1.6.1
80
94
  signing_key:
81
95
  specification_version: 3
82
96
  summary: Rack::ProcessName is rack middleware to set the ruby process name to whatever request is currently being processed.