rack-environmental 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -0
- data/LICENSE +1 -1
- data/README.rdoc +8 -1
- data/Rakefile +2 -2
- data/lib/rack-environmental.rb +2 -0
- data/test/rackapp/config.ru +1 -1
- metadata +38 -77
data/CHANGELOG
CHANGED
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License
|
2
2
|
|
3
|
-
Copyright (c) 2009, 2010 Wyatt M. Greene
|
3
|
+
Copyright (c) 2009, 2010, 2013 Wyatt M. Greene
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.rdoc
CHANGED
@@ -35,10 +35,17 @@ Each environment can be further configured:
|
|
35
35
|
Here's the full list of configuration options:
|
36
36
|
|
37
37
|
:url => a regular expression
|
38
|
-
:style => either :badge (a transparent, floating badge)
|
38
|
+
:style => either :badge (a transparent, floating badge), :banner (default), or :none (ignore this environment)
|
39
39
|
:color => a string that represents a CSS color, such as "red", "rgb(6,70,14)", or "#8e6630"
|
40
40
|
:size => :small, :medium, or :large; defaults to :medium
|
41
41
|
:opacity => a number from 0 (completely transparent) to 1; only works with the badge style
|
42
42
|
:top => distance in pixels from the top; only works with the badge style
|
43
43
|
:left => distance in pixels from the left; only works with the badge style
|
44
44
|
:background => true or false; when true, the body's background color is changed
|
45
|
+
|
46
|
+
== Ignoring environments
|
47
|
+
|
48
|
+
If there's a context where you want Rack::Environmental to specifically ignore your
|
49
|
+
requests, such as a Jasmine test runner which returns essentially empty files to be
|
50
|
+
built on by the test runner, you can "shut off" Rack::Environmental for that context
|
51
|
+
by adding `:style => :none` to its options.
|
data/Rakefile
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'rake'
|
2
|
-
require 'rake/gempackagetask'
|
3
2
|
require 'rubygems'
|
3
|
+
require 'rubygems/package_task'
|
4
4
|
|
5
5
|
begin
|
6
6
|
require 'jeweler'
|
7
7
|
Jeweler::Tasks.new do |s|
|
8
8
|
s.name = "rack-environmental"
|
9
|
-
s.version = "1.
|
9
|
+
s.version = "1.3.0"
|
10
10
|
s.add_dependency 'rack-plastic', '>= 0.1.1'
|
11
11
|
s.author = "Wyatt Greene"
|
12
12
|
s.email = "techiferous@gmail.com"
|
data/lib/rack-environmental.rb
CHANGED
@@ -48,6 +48,7 @@ module Rack
|
|
48
48
|
|
49
49
|
def create_sticker(doc)
|
50
50
|
return nil if @environment_name.nil?
|
51
|
+
return nil if @environment_options[:style] == :none
|
51
52
|
div = create_node(doc, "div", @environment_name.to_s)
|
52
53
|
div['id'] = 'rack_environmental'
|
53
54
|
div['style'] = style(@environment_options)
|
@@ -56,6 +57,7 @@ module Rack
|
|
56
57
|
|
57
58
|
def create_print_suppression_node(doc)
|
58
59
|
return nil if @environment_name.nil?
|
60
|
+
return nil if @environment_options[:style] == :none
|
59
61
|
style = create_node(doc, "style", '@media print { #rack_environmental {display:none;} }')
|
60
62
|
style['type'] = 'text/css'
|
61
63
|
style
|
data/test/rackapp/config.ru
CHANGED
metadata
CHANGED
@@ -1,49 +1,41 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-environmental
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 2
|
9
|
-
- 0
|
10
|
-
version: 1.2.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.3.0
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Wyatt Greene
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-08-25 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: rack-plastic
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
25
17
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 25
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
- 1
|
33
|
-
- 1
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
34
21
|
version: 0.1.1
|
35
22
|
type: :runtime
|
36
|
-
|
37
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.1.1
|
30
|
+
description: ! "\n Rack::Environmental indicates which environment your web application
|
31
|
+
is running\n in (staging, test, etc.).\n "
|
38
32
|
email: techiferous@gmail.com
|
39
33
|
executables: []
|
40
|
-
|
41
34
|
extensions: []
|
42
|
-
|
43
|
-
extra_rdoc_files:
|
35
|
+
extra_rdoc_files:
|
44
36
|
- LICENSE
|
45
37
|
- README.rdoc
|
46
|
-
files:
|
38
|
+
files:
|
47
39
|
- CHANGELOG
|
48
40
|
- LICENSE
|
49
41
|
- README.rdoc
|
@@ -106,60 +98,29 @@ files:
|
|
106
98
|
- test/railsapp/test/test_helper.rb
|
107
99
|
- test/railsapp/test/unit/helpers/tommy_boy_helper_test.rb
|
108
100
|
- test/sinatraapp/app.rb
|
109
|
-
has_rdoc: true
|
110
101
|
homepage: http://github.com/techiferous/rack-environmental
|
111
102
|
licenses: []
|
112
|
-
|
113
103
|
post_install_message:
|
114
|
-
rdoc_options:
|
115
|
-
|
116
|
-
require_paths:
|
104
|
+
rdoc_options: []
|
105
|
+
require_paths:
|
117
106
|
- lib
|
118
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
107
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
119
108
|
none: false
|
120
|
-
requirements:
|
121
|
-
- -
|
122
|
-
- !ruby/object:Gem::Version
|
123
|
-
|
124
|
-
|
125
|
-
- 0
|
126
|
-
version: "0"
|
127
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - ! '>='
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0'
|
113
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
114
|
none: false
|
129
|
-
requirements:
|
130
|
-
- -
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
|
133
|
-
|
134
|
-
- 0
|
135
|
-
version: "0"
|
136
|
-
requirements:
|
115
|
+
requirements:
|
116
|
+
- - ! '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
requirements:
|
137
120
|
- none
|
138
121
|
rubyforge_project:
|
139
|
-
rubygems_version: 1.
|
122
|
+
rubygems_version: 1.8.25
|
140
123
|
signing_key:
|
141
124
|
specification_version: 3
|
142
125
|
summary: Rack middleware that adds an indicator of your application environment
|
143
|
-
test_files:
|
144
|
-
- test/rackapp/app.rb
|
145
|
-
- test/railsapp/app/controllers/application_controller.rb
|
146
|
-
- test/railsapp/app/controllers/tommy_boy_controller.rb
|
147
|
-
- test/railsapp/app/helpers/application_helper.rb
|
148
|
-
- test/railsapp/app/helpers/tommy_boy_helper.rb
|
149
|
-
- test/railsapp/config/boot.rb
|
150
|
-
- test/railsapp/config/environment.rb
|
151
|
-
- test/railsapp/config/environments/development.rb
|
152
|
-
- test/railsapp/config/environments/production.rb
|
153
|
-
- test/railsapp/config/environments/test.rb
|
154
|
-
- test/railsapp/config/initializers/backtrace_silencers.rb
|
155
|
-
- test/railsapp/config/initializers/inflections.rb
|
156
|
-
- test/railsapp/config/initializers/mime_types.rb
|
157
|
-
- test/railsapp/config/initializers/new_rails_defaults.rb
|
158
|
-
- test/railsapp/config/initializers/session_store.rb
|
159
|
-
- test/railsapp/config/routes.rb
|
160
|
-
- test/railsapp/db/seeds.rb
|
161
|
-
- test/railsapp/test/functional/tommy_boy_controller_test.rb
|
162
|
-
- test/railsapp/test/performance/browsing_test.rb
|
163
|
-
- test/railsapp/test/test_helper.rb
|
164
|
-
- test/railsapp/test/unit/helpers/tommy_boy_helper_test.rb
|
165
|
-
- test/sinatraapp/app.rb
|
126
|
+
test_files: []
|