rack-environmental 1.3.1 → 1.3.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1545f4895988a787962d2a44ee25f417f38164fb
4
+ data.tar.gz: e52c29a6cf54241d5590a02b287be230b9487034
5
+ SHA512:
6
+ metadata.gz: 0697696347aaaff9d343d043e7223d9228898bdb702591c5ee509f7fd90263e4d1be200c94724ab5479fb796eab1231bc236b5edc190408d3309c937a542feb4
7
+ data.tar.gz: 57d44526cfb820ecde7c3ebd7ad61fef8c618c58f05904afaae12764af3b163530908f5bf0659f806fd385f21d6804cf9447fb1ba441ada923e7d83e7a5057e6
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 1.3.2 (November 22, 2015)
2
+ * BUGFIX: Prevented throwing an error if no body present in HTTP response.
3
+ * Better installation instructions.
4
+
1
5
  1.3.1 (October 6, 2013)
2
6
  * Prevented any markup request changes from happening with Ajax requests.
3
7
 
@@ -6,10 +6,20 @@ Never again will you accidentally delete production data! Rack::Environmental a
6
6
  an indicator badge to your web application so that you can tell whether you're
7
7
  working with the staging, test, development or production version of your web app.
8
8
 
9
+ == Installation
10
+
11
+ For bundler-managed applications just include Rack::Environmental in your Gemfile:
12
+
13
+ gem 'rack-environmental'
14
+
15
+ Alternatively, you can install Rack::Environmental manually:
16
+
17
+ $ gem install rack-environmental
18
+
9
19
  == Usage
10
20
 
11
21
  This Rack middleware can be used with any Rack application, but here's how you would
12
- use it in Rails. Put the following in config/environment.rb:
22
+ use it in Rails. Put the following in config/application.rb:
13
23
 
14
24
  config.middleware.use Rack::Environmental,
15
25
  :staging => { :url => /^staging.+$/ },
@@ -48,4 +58,4 @@ Here's the full list of configuration options:
48
58
  If there's a context where you want Rack::Environmental to specifically ignore your
49
59
  requests, such as a Jasmine test runner which returns essentially empty files to be
50
60
  built on by the test runner, you can "shut off" Rack::Environmental for that context
51
- by adding `:style => :none` to its options.
61
+ by adding `:style => :none` to its options.
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ begin
6
6
  require 'jeweler'
7
7
  Jeweler::Tasks.new do |s|
8
8
  s.name = "rack-environmental"
9
- s.version = "1.3.1"
9
+ s.version = "1.3.2"
10
10
  s.add_dependency 'rack-plastic', '>= 0.1.1'
11
11
  s.author = "Wyatt Greene"
12
12
  s.email = "techiferous@gmail.com"
@@ -4,12 +4,12 @@ module Rack
4
4
  class Environmental < Plastic
5
5
 
6
6
  def change_nokogiri_doc(doc)
7
- return doc if request.xhr?
7
+ body = doc.at_css("body")
8
+ return doc if request.xhr? || body.nil?
8
9
  initialize_environment_options
9
10
  add_to_top_of_web_page(doc, create_sticker(doc))
10
11
  add_to_top_of_web_page(doc, create_print_suppression_node(doc))
11
12
  if @environment_options[:background]
12
- body = doc.at_css("body")
13
13
  background_style = "background-color: #{@environment_options[:color] || default_color};"
14
14
  if body['style']
15
15
  body['style'] << ";#{background_style}"
metadata CHANGED
@@ -1,33 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-environmental
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
5
- prerelease:
4
+ version: 1.3.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Wyatt Greene
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-10-06 00:00:00.000000000 Z
11
+ date: 2015-11-22 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rack-plastic
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: 0.1.1
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: 0.1.1
30
- description: ! "\n Rack::Environmental indicates which environment your web application
27
+ description: "\n Rack::Environmental indicates which environment your web application
31
28
  is running\n in (staging, test, etc.).\n "
32
29
  email: techiferous@gmail.com
33
30
  executables: []
@@ -100,27 +97,26 @@ files:
100
97
  - test/sinatraapp/app.rb
101
98
  homepage: http://github.com/techiferous/rack-environmental
102
99
  licenses: []
100
+ metadata: {}
103
101
  post_install_message:
104
102
  rdoc_options: []
105
103
  require_paths:
106
104
  - lib
107
105
  required_ruby_version: !ruby/object:Gem::Requirement
108
- none: false
109
106
  requirements:
110
- - - ! '>='
107
+ - - ">="
111
108
  - !ruby/object:Gem::Version
112
109
  version: '0'
113
110
  required_rubygems_version: !ruby/object:Gem::Requirement
114
- none: false
115
111
  requirements:
116
- - - ! '>='
112
+ - - ">="
117
113
  - !ruby/object:Gem::Version
118
114
  version: '0'
119
115
  requirements:
120
116
  - none
121
117
  rubyforge_project:
122
- rubygems_version: 1.8.25
118
+ rubygems_version: 2.2.2
123
119
  signing_key:
124
- specification_version: 3
120
+ specification_version: 4
125
121
  summary: Rack middleware that adds an indicator of your application environment
126
122
  test_files: []