visual-environments 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +2 -9
- data/Gemfile.lock +15 -16
- data/README.md +120 -0
- data/Rakefile +6 -43
- data/lib/visual-environments.rb +3 -0
- data/spec/spec_helper.rb +0 -7
- data/spec/test_helper.rb +4 -0
- data/spec/visual-environments_spec.rb +9 -2
- data/visual-environments.gemspec +19 -44
- metadata +64 -108
- data/README.rdoc +0 -106
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 608aaf0f2b99a59cdee58ff4ef22ae5063fc244b
|
4
|
+
data.tar.gz: bb20896de66d944c43f00394773c1a1ae9ee61e4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8bf2df301992d110eccaf1a590f7815101aa2c347726c431a0d2dcf811651d32fad223d8d9fe66f81091b40f28788477a152c2353344306aa5b5e453786fcb21
|
7
|
+
data.tar.gz: 2e3e571138d1d920963cd2869d541bef38bd526cc555241daedd5ee23e5a65c762549b6d8a8f27cd363749723bdac0b98c76f738989ecfcbcde81476f5e846be
|
data/Gemfile
CHANGED
@@ -1,15 +1,8 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
|
-
# Add dependencies required to use your gem here.
|
3
2
|
|
4
|
-
|
5
|
-
gem 'activesupport', '>= 3.0.5'
|
3
|
+
gemspec
|
6
4
|
|
7
|
-
|
8
|
-
# Include everything needed to run rake, tests, features, etc.
|
9
|
-
group :development, :test do
|
5
|
+
group :test do
|
10
6
|
gem "rspec-rails"
|
11
|
-
gem "bundler", "~> 1.0.0"
|
12
|
-
gem "jeweler", "~> 1.5.2"
|
13
|
-
gem "rcov", ">= 0"
|
14
7
|
gem "webrat"
|
15
8
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
visual-environments (0.3.4)
|
5
|
+
activesupport
|
6
|
+
rails
|
7
|
+
|
1
8
|
GEM
|
2
9
|
remote: http://rubygems.org/
|
3
10
|
specs:
|
@@ -28,25 +35,20 @@ GEM
|
|
28
35
|
activemodel (= 3.0.5)
|
29
36
|
activesupport (= 3.0.5)
|
30
37
|
activesupport (3.0.5)
|
31
|
-
arel (2.0.
|
38
|
+
arel (2.0.10)
|
32
39
|
builder (2.1.2)
|
33
40
|
diff-lcs (1.1.2)
|
34
41
|
erubis (2.6.6)
|
35
42
|
abstract (>= 1.0.0)
|
36
|
-
git (1.2.5)
|
37
43
|
i18n (0.5.0)
|
38
|
-
|
39
|
-
bundler (~> 1.0.0)
|
40
|
-
git (>= 1.2.5)
|
41
|
-
rake
|
42
|
-
mail (2.2.15)
|
44
|
+
mail (2.2.19)
|
43
45
|
activesupport (>= 2.3.6)
|
44
46
|
i18n (>= 0.4.0)
|
45
47
|
mime-types (~> 1.16)
|
46
48
|
treetop (~> 1.4.8)
|
47
|
-
mime-types (1.
|
49
|
+
mime-types (1.22)
|
48
50
|
nokogiri (1.4.4)
|
49
|
-
polyglot (0.3.
|
51
|
+
polyglot (0.3.3)
|
50
52
|
rack (1.2.2)
|
51
53
|
rack-mount (0.6.14)
|
52
54
|
rack (>= 1.0.0)
|
@@ -66,7 +68,6 @@ GEM
|
|
66
68
|
rake (>= 0.8.7)
|
67
69
|
thor (~> 0.14.4)
|
68
70
|
rake (0.8.7)
|
69
|
-
rcov (0.9.9)
|
70
71
|
rspec (2.5.0)
|
71
72
|
rspec-core (~> 2.5.0)
|
72
73
|
rspec-expectations (~> 2.5.0)
|
@@ -81,7 +82,8 @@ GEM
|
|
81
82
|
railties (~> 3.0)
|
82
83
|
rspec (~> 2.5.0)
|
83
84
|
thor (0.14.6)
|
84
|
-
treetop (1.4.
|
85
|
+
treetop (1.4.12)
|
86
|
+
polyglot
|
85
87
|
polyglot (>= 0.3.1)
|
86
88
|
tzinfo (0.3.25)
|
87
89
|
webrat (0.7.3)
|
@@ -93,10 +95,7 @@ PLATFORMS
|
|
93
95
|
ruby
|
94
96
|
|
95
97
|
DEPENDENCIES
|
96
|
-
|
97
|
-
bundler (~> 1.0.0)
|
98
|
-
jeweler (~> 1.5.2)
|
99
|
-
rails (>= 3.0.5)
|
100
|
-
rcov
|
98
|
+
rake
|
101
99
|
rspec-rails
|
100
|
+
visual-environments!
|
102
101
|
webrat
|
data/README.md
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
# visual-environments
|
2
|
+
|
3
|
+
Automatic visual, in-browser cues about your current environment for Rails 3 applications!
|
4
|
+
|
5
|
+
If you're a developer accustomed to working across multiple development and staging environments, you have certainly been in the position where you have multiple browser windows/tabs open with the same site but pointing at different environments. This gem aims to help you keep your contexts straight!
|
6
|
+
|
7
|
+
This is a configurable means for showing, via an updated <title> tag or CSS corner banner overlay, what the current runtime environment is (development, staging, test, etc.) This functionality is never enabled for production, and fully configurable to exclude other environments as well.
|
8
|
+
|
9
|
+
# Install & Configuration
|
10
|
+
|
11
|
+
Add the following to your Rails application's Gemfile
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'visual-environments'
|
15
|
+
```
|
16
|
+
|
17
|
+
...and run `bundle install`. Then use the visual-environments generator to install the configuration file to your `config/initializers` directory:
|
18
|
+
```sh
|
19
|
+
$ rails g visual_environments:install
|
20
|
+
```
|
21
|
+
|
22
|
+
There should now be a new file `config/initializers/visual-environments.rb` with the content:
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
VisualEnvironments.setup do |config|
|
26
|
+
# Turns on the display of the current environment in the title tag of each page in the app
|
27
|
+
config.enable_env_in_title = true
|
28
|
+
|
29
|
+
# Uncomment the line below and select which side to display the banner on. Current possible
|
30
|
+
# values are (:right, :left) corresponding to upper-right and upper-left corners, respectively
|
31
|
+
# config.corner_banner_side = :right
|
32
|
+
|
33
|
+
# By default, the full environment name is used in the visual cues (development, test, etc.) You
|
34
|
+
# can map environment names by using the below setting to alias one environment name to another.
|
35
|
+
# Using the option below configures the alias for both the title tag and the corner banner display;
|
36
|
+
# if you would like different strings for each area then see the next section.
|
37
|
+
# Example: 'development' -> 'dev' or 'preproduction' -> 'preprod'
|
38
|
+
# config.aliases = { 'development' => 'dev' }
|
39
|
+
|
40
|
+
# You may alternatively declare different aliases for the title tag versus the corner banner
|
41
|
+
# using the options below.
|
42
|
+
# config.title_aliases = { 'development' => 'dev' }
|
43
|
+
# config.corner_banner_aliases = { 'preproduction' => 'preprod' }
|
44
|
+
|
45
|
+
# By default, the visual-environments will be enabled for all environments except production;
|
46
|
+
# to exclude additional environments, uncomment the line below and add them to the collection
|
47
|
+
# config.excluded_environments = []
|
48
|
+
end
|
49
|
+
```
|
50
|
+
|
51
|
+
By default, visual environments are enabled in the page title but disabled for corner banner display. Also, by default only production environments are excluded from the gem functionality.
|
52
|
+
|
53
|
+
## Excluding Environments
|
54
|
+
|
55
|
+
You can add additional environments to be excluded by adding their names to the `excluded_environments` collection. For example, let's say you have an app with a test-oriented staging environment as well as a 'almost-ready-for-prime-time' preproduction environment. In this case you may want the visual cues on the staging but not on preproduction. In that case you can edit the initializer to:
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
config.excluded_environments = ['preproduction']
|
59
|
+
```
|
60
|
+
|
61
|
+
And now preproduction will not use the visual-environments functionality.
|
62
|
+
|
63
|
+
## Corner Banner & Changing the Side of the Banner
|
64
|
+
|
65
|
+
The corner banner is not included by default. To enable it, choose which side it should be displayed on via the `corner_banner_side` option in `config/initializers/visual-environments.rb`:
|
66
|
+
|
67
|
+
```ruby
|
68
|
+
config.corner_banner_side = :right
|
69
|
+
```
|
70
|
+
|
71
|
+
Valid options are currently `:left` and `:right`, corresponding to the upper-left and upper-right corners, respectively.
|
72
|
+
|
73
|
+
## Aliasing Environment Names
|
74
|
+
|
75
|
+
Having the string "[development]" prepended to your title may make things a bit unwieldy for some people. In that case, you may use the aliasing option to change such an identifier to something shorter (but still identifiable with the environment in question). For example, you can alias 'development' to 'dev' or 'D', which would result in "[dev]" or "[D]" being prepended to the page title.
|
76
|
+
|
77
|
+
To add an alias that is used both in the title and the banner, uncomment and set the `aliases` setting as follows:
|
78
|
+
|
79
|
+
```ruby
|
80
|
+
config.aliases = { 'development' => 'dev', 'preproduction' => 'preprod' }
|
81
|
+
```
|
82
|
+
|
83
|
+
The above example would show use 'dev' in a development environment and 'preprod' in a preproduction environment. The point is, you can alias any environment you may use, not just the out-of-the-box environments Rails uses (development, test, production).
|
84
|
+
|
85
|
+
You can also set the aliases for ONLY the title or ONLY the corner banner. For example, I like the full environment used in the banner but like the title identifier to be much shorter:
|
86
|
+
|
87
|
+
```ruby
|
88
|
+
config.title_aliases = { 'development' => 'D', 'staging' => 'S' }
|
89
|
+
```
|
90
|
+
|
91
|
+
You can do the same to change the alias of the corner banner:
|
92
|
+
|
93
|
+
```ruby
|
94
|
+
config.corner_banner_aliases = { 'development' => 'dev', 'preproduction' => 'preprod' }
|
95
|
+
```
|
96
|
+
|
97
|
+
# Contributing to visual-environments
|
98
|
+
|
99
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
100
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
101
|
+
* Fork the project
|
102
|
+
* Start a feature/bugfix branch
|
103
|
+
* Commit and push until you are happy with your contribution
|
104
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
105
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
106
|
+
|
107
|
+
# Changelog
|
108
|
+
|
109
|
+
* 3 April, 2013: Update README formatting, modernize gemspec definitions.
|
110
|
+
* 14 March, 2011: Added tests. Run <tt>rake spec</tt> to run 'em.
|
111
|
+
* 5 March, 2011: Changed format of initializer, added ability to alias title and corner banner strings independently, refactored internal structure of the module, updated docs. This is a NON-BACKWARDS COMPATIBLE update; you must rerun <tt>rails g visual_environments:install</tt> to regenerate a new initializer file and then reset your options.
|
112
|
+
* 27 February, 2011: Updated source_root definition, fixing bug in initializer
|
113
|
+
* 20 February, 2011: Added generator, documented configuration options, added ability to switch corner banner from left to right side
|
114
|
+
* 19 February, 2011: Initial revision- a result of the MadRailers Coding Day!
|
115
|
+
|
116
|
+
# Copyright
|
117
|
+
|
118
|
+
Copyright © 2011-2013 Zachery Moneypenny, David van Leeuwen. See LICENSE.txt for further details.
|
119
|
+
|
120
|
+
Many thanks to the Mad-Railers for their idea for this gem! If you're coding Ruby/Rails in the Madison, Wisconsin area search for [MadRailers on meetup.com](http://www.meetup.com/Mad-Railers/) or check out the [Google Group at http://groups.google.com/group/Mad-Railers](http://groups.google.com/group/Mad-Railers).
|
data/Rakefile
CHANGED
@@ -1,50 +1,13 @@
|
|
1
|
-
require 'rubygems'
|
2
1
|
require 'bundler'
|
3
|
-
begin
|
4
|
-
Bundler.setup(:default, :development)
|
5
|
-
rescue Bundler::BundlerError => e
|
6
|
-
$stderr.puts e.message
|
7
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
-
exit e.status_code
|
9
|
-
end
|
10
|
-
require 'rake'
|
11
|
-
|
12
|
-
require 'jeweler'
|
13
|
-
Jeweler::Tasks.new do |gem|
|
14
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
-
gem.name = "visual-environments"
|
16
|
-
gem.homepage = "http://github.com/madrailers/visual-environments"
|
17
|
-
gem.license = "MIT"
|
18
|
-
gem.summary = %Q{Automatic visual, in-browser cues about your current environment}
|
19
|
-
gem.description = %Q{This gem provides a configurable means for showing, via an updated <title> tag or CSS corner banner, what the current runtime environment is (development, staging, test, etc.) This functionality is never enabled for production, and for all other environments you can exclude specific ones.}
|
20
|
-
gem.email = "whazzmaster@gmail.com"
|
21
|
-
gem.authors = ["Zachery Moneypenny, David van Leeuwen"]
|
22
|
-
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
23
|
-
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
24
|
-
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
25
|
-
# gem.add_development_dependency 'rspec', '> 1.2.3'
|
26
|
-
end
|
27
|
-
Jeweler::RubygemsDotOrgTasks.new
|
28
|
-
|
29
|
-
require 'rspec/core'
|
30
2
|
require 'rspec/core/rake_task'
|
31
|
-
RSpec::Core::RakeTask.new(:spec) do |spec|
|
32
|
-
spec.pattern = FileList['spec/**/*_spec.rb']
|
33
|
-
end
|
34
3
|
|
35
|
-
|
36
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
37
|
-
spec.rcov = true
|
38
|
-
end
|
4
|
+
Bundler::GemHelper.install_tasks
|
39
5
|
|
6
|
+
desc 'Default: run specs.'
|
40
7
|
task :default => :spec
|
41
8
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
rdoc.rdoc_dir = 'rdoc'
|
47
|
-
rdoc.title = "visual-environments #{version}"
|
48
|
-
rdoc.rdoc_files.include('README*')
|
49
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
9
|
+
desc "Run specs"
|
10
|
+
RSpec::Core::RakeTask.new do |t|
|
11
|
+
t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
|
12
|
+
# Put spec opts in a file named .rspec in root
|
50
13
|
end
|
data/lib/visual-environments.rb
CHANGED
@@ -40,6 +40,9 @@ module VisualEnvironments
|
|
40
40
|
def shim_visual_environments
|
41
41
|
unless Rails.env == 'production' || (VisualEnvironments.excluded_environments && VisualEnvironments.excluded_environments.include?(Rails.env))
|
42
42
|
|
43
|
+
# Only mess with HTML
|
44
|
+
return unless response.content_type == 'text/html'
|
45
|
+
|
43
46
|
if VisualEnvironments.enable_env_in_title
|
44
47
|
current_env = Rails.env
|
45
48
|
current_env = VisualEnvironments.title_aliases[current_env] if !VisualEnvironments.title_aliases.nil? && VisualEnvironments.title_aliases.has_key?(current_env)
|
data/spec/spec_helper.rb
CHANGED
@@ -10,12 +10,5 @@ require 'visual-environments'
|
|
10
10
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
11
11
|
|
12
12
|
RSpec.configure do |config|
|
13
|
-
# == Mock Framework
|
14
|
-
#
|
15
|
-
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
16
|
-
#
|
17
|
-
# config.mock_with :mocha
|
18
|
-
# config.mock_with :flexmock
|
19
|
-
# config.mock_with :rr
|
20
13
|
config.mock_with :rspec
|
21
14
|
end
|
data/spec/test_helper.rb
CHANGED
@@ -106,8 +106,15 @@ describe MyController do
|
|
106
106
|
get :index
|
107
107
|
response.body.should_not contain( sprintf(@corner_banner_format, Rails.env) )
|
108
108
|
end
|
109
|
-
|
110
|
-
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
it 'should only display if the response is HTML' do
|
113
|
+
VisualEnvironments.stub(:corner_banner_side).and_return(:right)
|
114
|
+
get :image
|
115
|
+
response.body.should_not contain( sprintf(@corner_banner_format, Rails.env) )
|
116
|
+
end
|
117
|
+
|
111
118
|
end
|
112
119
|
|
113
120
|
|
data/visual-environments.gemspec
CHANGED
@@ -1,26 +1,35 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
$:.push File.join(File.dirname(__FILE__), '.', 'lib')
|
4
|
+
|
5
|
+
require 'visual-environments/version'
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
8
|
s.name = %q{visual-environments}
|
8
|
-
s.version =
|
9
|
+
s.version = VisualEnvironments::VERSION
|
10
|
+
s.platform = Gem::Platform::RUBY
|
11
|
+
s.licenses = ["MIT"]
|
9
12
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
13
|
s.authors = ["Zachery Moneypenny, David van Leeuwen"]
|
12
|
-
s.date = %q{2011-04-01}
|
13
|
-
s.description = %q{This gem provides a configurable means for showing, via an updated <title> tag or CSS corner banner, what the current runtime environment is (development, staging, test, etc.) This functionality is never enabled for production, and for all other environments you can exclude specific ones.}
|
14
14
|
s.email = %q{whazzmaster@gmail.com}
|
15
|
+
s.homepage = %q{http://github.com/madrailers/visual-environments}
|
16
|
+
s.summary = %q{Automatic visual, in-browser cues about your current environment}
|
17
|
+
s.description = %q{This gem provides a configurable means for showing, via an updated <title> tag or CSS corner banner, what the current runtime environment is (development, staging, test, etc.) This functionality is never enabled for production, and for all other environments you can exclude specific ones.}
|
18
|
+
|
19
|
+
s.add_dependency "rails"
|
20
|
+
s.add_dependency "activesupport"
|
21
|
+
|
22
|
+
s.add_development_dependency "rake"
|
23
|
+
|
15
24
|
s.extra_rdoc_files = [
|
16
25
|
"LICENSE.txt",
|
17
|
-
"README.
|
26
|
+
"README.md"
|
18
27
|
]
|
19
28
|
s.files = [
|
20
29
|
"Gemfile",
|
21
30
|
"Gemfile.lock",
|
22
31
|
"LICENSE.txt",
|
23
|
-
"README.
|
32
|
+
"README.md",
|
24
33
|
"Rakefile",
|
25
34
|
"VERSION",
|
26
35
|
"lib/generators/visual_environments/USAGE",
|
@@ -32,45 +41,11 @@ Gem::Specification.new do |s|
|
|
32
41
|
"spec/visual-environments_spec.rb",
|
33
42
|
"visual-environments.gemspec"
|
34
43
|
]
|
35
|
-
s.homepage = %q{http://github.com/madrailers/visual-environments}
|
36
|
-
s.licenses = ["MIT"]
|
37
|
-
s.require_paths = ["lib"]
|
38
|
-
s.rubygems_version = %q{1.5.2}
|
39
|
-
s.summary = %q{Automatic visual, in-browser cues about your current environment}
|
40
44
|
s.test_files = [
|
41
45
|
"spec/spec_helper.rb",
|
42
46
|
"spec/test_helper.rb",
|
43
47
|
"spec/visual-environments_spec.rb"
|
44
48
|
]
|
45
|
-
|
46
|
-
if s.respond_to? :specification_version then
|
47
|
-
s.specification_version = 3
|
48
|
-
|
49
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
50
|
-
s.add_runtime_dependency(%q<rails>, [">= 3.0.5"])
|
51
|
-
s.add_runtime_dependency(%q<activesupport>, [">= 3.0.5"])
|
52
|
-
s.add_development_dependency(%q<rspec-rails>, [">= 0"])
|
53
|
-
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
54
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
55
|
-
s.add_development_dependency(%q<rcov>, [">= 0"])
|
56
|
-
s.add_development_dependency(%q<webrat>, [">= 0"])
|
57
|
-
else
|
58
|
-
s.add_dependency(%q<rails>, [">= 3.0.5"])
|
59
|
-
s.add_dependency(%q<activesupport>, [">= 3.0.5"])
|
60
|
-
s.add_dependency(%q<rspec-rails>, [">= 0"])
|
61
|
-
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
62
|
-
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
63
|
-
s.add_dependency(%q<rcov>, [">= 0"])
|
64
|
-
s.add_dependency(%q<webrat>, [">= 0"])
|
65
|
-
end
|
66
|
-
else
|
67
|
-
s.add_dependency(%q<rails>, [">= 3.0.5"])
|
68
|
-
s.add_dependency(%q<activesupport>, [">= 3.0.5"])
|
69
|
-
s.add_dependency(%q<rspec-rails>, [">= 0"])
|
70
|
-
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
71
|
-
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
72
|
-
s.add_dependency(%q<rcov>, [">= 0"])
|
73
|
-
s.add_dependency(%q<webrat>, [">= 0"])
|
74
|
-
end
|
49
|
+
s.require_paths = ["lib"]
|
75
50
|
end
|
76
51
|
|
metadata
CHANGED
@@ -1,109 +1,72 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: visual-environments
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 0.3.3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.4
|
6
5
|
platform: ruby
|
7
|
-
authors:
|
6
|
+
authors:
|
8
7
|
- Zachery Moneypenny, David van Leeuwen
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2013-04-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
17
14
|
name: rails
|
18
|
-
requirement:
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
version: 3.0.5
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
24
20
|
type: :runtime
|
25
21
|
prerelease: false
|
26
|
-
version_requirements:
|
27
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
|
-
requirement:
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
version: 3.0.5
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
35
34
|
type: :runtime
|
36
35
|
prerelease: false
|
37
|
-
version_requirements:
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
46
48
|
type: :development
|
47
49
|
prerelease: false
|
48
|
-
version_requirements:
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
type: :development
|
58
|
-
prerelease: false
|
59
|
-
version_requirements: *id004
|
60
|
-
- !ruby/object:Gem::Dependency
|
61
|
-
name: jeweler
|
62
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
63
|
-
none: false
|
64
|
-
requirements:
|
65
|
-
- - ~>
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: 1.5.2
|
68
|
-
type: :development
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: *id005
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name: rcov
|
73
|
-
requirement: &id006 !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
|
-
requirements:
|
76
|
-
- - ">="
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version: "0"
|
79
|
-
type: :development
|
80
|
-
prerelease: false
|
81
|
-
version_requirements: *id006
|
82
|
-
- !ruby/object:Gem::Dependency
|
83
|
-
name: webrat
|
84
|
-
requirement: &id007 !ruby/object:Gem::Requirement
|
85
|
-
none: false
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: "0"
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: *id007
|
93
|
-
description: This gem provides a configurable means for showing, via an updated <title> tag or CSS corner banner, what the current runtime environment is (development, staging, test, etc.) This functionality is never enabled for production, and for all other environments you can exclude specific ones.
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: This gem provides a configurable means for showing, via an updated <title>
|
56
|
+
tag or CSS corner banner, what the current runtime environment is (development,
|
57
|
+
staging, test, etc.) This functionality is never enabled for production, and for
|
58
|
+
all other environments you can exclude specific ones.
|
94
59
|
email: whazzmaster@gmail.com
|
95
60
|
executables: []
|
96
|
-
|
97
61
|
extensions: []
|
98
|
-
|
99
|
-
extra_rdoc_files:
|
62
|
+
extra_rdoc_files:
|
100
63
|
- LICENSE.txt
|
101
|
-
- README.
|
102
|
-
files:
|
64
|
+
- README.md
|
65
|
+
files:
|
103
66
|
- Gemfile
|
104
67
|
- Gemfile.lock
|
105
68
|
- LICENSE.txt
|
106
|
-
- README.
|
69
|
+
- README.md
|
107
70
|
- Rakefile
|
108
71
|
- VERSION
|
109
72
|
- lib/generators/visual_environments/USAGE
|
@@ -114,38 +77,31 @@ files:
|
|
114
77
|
- spec/test_helper.rb
|
115
78
|
- spec/visual-environments_spec.rb
|
116
79
|
- visual-environments.gemspec
|
117
|
-
has_rdoc: true
|
118
80
|
homepage: http://github.com/madrailers/visual-environments
|
119
|
-
licenses:
|
81
|
+
licenses:
|
120
82
|
- MIT
|
83
|
+
metadata: {}
|
121
84
|
post_install_message:
|
122
85
|
rdoc_options: []
|
123
|
-
|
124
|
-
require_paths:
|
86
|
+
require_paths:
|
125
87
|
- lib
|
126
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
none: false
|
137
|
-
requirements:
|
138
|
-
- - ">="
|
139
|
-
- !ruby/object:Gem::Version
|
140
|
-
version: "0"
|
88
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - '>='
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - '>='
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
141
98
|
requirements: []
|
142
|
-
|
143
99
|
rubyforge_project:
|
144
|
-
rubygems_version:
|
100
|
+
rubygems_version: 2.0.3
|
145
101
|
signing_key:
|
146
|
-
specification_version:
|
102
|
+
specification_version: 4
|
147
103
|
summary: Automatic visual, in-browser cues about your current environment
|
148
|
-
test_files:
|
104
|
+
test_files:
|
149
105
|
- spec/spec_helper.rb
|
150
106
|
- spec/test_helper.rb
|
151
107
|
- spec/visual-environments_spec.rb
|
data/README.rdoc
DELETED
@@ -1,106 +0,0 @@
|
|
1
|
-
= visual-environments
|
2
|
-
|
3
|
-
Automatic visual, in-browser cues about your current environment in Rails 3 applications!
|
4
|
-
|
5
|
-
If you're a developer accustomed to working across multiple development and staging environments, you have certainly been in the position where you have multiple browser windows/tabs open with the same site but pointing at different environments. This gem aims to help you keep your contexts straight!
|
6
|
-
|
7
|
-
This is a configurable means for showing, via an updated <title> tag or CSS corner banner overlay, what the current runtime environment is (development, staging, test, etc.) This functionality is never enabled for production, and fully configurable to exclude other environments as well.
|
8
|
-
|
9
|
-
== Changelog
|
10
|
-
|
11
|
-
* 14 March, 2011: Added tests. Run <tt>rake spec</tt> to run 'em.
|
12
|
-
* 5 March, 2011: Changed format of initializer, added ability to alias title and corner banner strings independently, refactored internal structure of the module, updated docs. This is a NON-BACKWARDS COMPATIBLE update; you must rerun <tt>rails g visual_environments:install</tt> to regenerate a new initializer file and then reset your options.
|
13
|
-
* 27 February, 2011: Updated source_root definition, fixing bug in initializer
|
14
|
-
* 20 February, 2011: Added generator, documented configuration options, added ability to switch corner banner from left to right side
|
15
|
-
* 19 February, 2011: Initial revision- a result of the MadRailers Coding Day!
|
16
|
-
|
17
|
-
= Install & Configuration
|
18
|
-
|
19
|
-
Add the following to your Rails application's Gemfile
|
20
|
-
|
21
|
-
gem 'visual-environments'
|
22
|
-
|
23
|
-
...and run <tt>bundle install</tt>. Then use the visual-environments generator to install the configuration file to your <tt>config/initializers</tt> directory:
|
24
|
-
|
25
|
-
rails g visual_environments:install
|
26
|
-
|
27
|
-
There should now be a new file <tt>config/initializers/visual-environments.rb</tt> with the content
|
28
|
-
|
29
|
-
VisualEnvironments.setup do |config|
|
30
|
-
# Turns on the display of the current environment in the title tag of each page in the app
|
31
|
-
config.enable_env_in_title = true
|
32
|
-
|
33
|
-
# Uncomment he line below and select which side to display the banner on. Current possible
|
34
|
-
# values are (:right, :left) corresponding to upper-right and upper-left corners, respectively
|
35
|
-
# config.corner_banner_side = :right
|
36
|
-
|
37
|
-
# By default, the full environment name is used in the visual cues (development, test, etc.) You
|
38
|
-
# can map environment names by using the below setting to alias one environment name to another.
|
39
|
-
# Using the option below configures the alias for both the title tag and the corner banner display;
|
40
|
-
# if you would like different strings for each area then see the next section.
|
41
|
-
# Example: 'development' -> 'dev' or 'preproduction' -> 'preprod'
|
42
|
-
# config.aliases = { 'development' => 'dev' }
|
43
|
-
|
44
|
-
# You may alternatively declare different aliases for the title tag versus the corner banner
|
45
|
-
# using the options below.
|
46
|
-
# config.title_aliases = { 'development' => 'dev' }
|
47
|
-
# config.corner_banner_aliases = { 'preproduction' => 'preprod' }
|
48
|
-
|
49
|
-
# By default, the visual-environments will be enabled for all environments except production;
|
50
|
-
# to exclude additional environments, uncomment the line below and add them to the collection
|
51
|
-
# config.excluded_environments = []
|
52
|
-
end
|
53
|
-
|
54
|
-
|
55
|
-
By default, visual environments are enabled in the page title but disabled for corner banner display. Also, by default only production environments are excluded from the gem functionality.
|
56
|
-
|
57
|
-
== Excluding Environments
|
58
|
-
|
59
|
-
You can add additional environments to be excluded by adding their names to the <tt>excluded_environments</tt> collection. For example, let's say you have an app with a test-oriented staging environment as well as a 'almost-ready-for-prime-time' preproduction environment. In this case you may want the visual cues on the staging but not on preproduction. In that case you can edit the initializer to:
|
60
|
-
|
61
|
-
config.excluded_environments = ['preproduction']
|
62
|
-
|
63
|
-
And now preproduction will not use the visual-environments functionality.
|
64
|
-
|
65
|
-
== Corner Banner & Changing the Side of the Banner
|
66
|
-
|
67
|
-
The corner banner is not included by default. To enable it, choose which side it should be displayed on via the <tt>corner_banner_side</tt> option in <tt>config/initializers/visual-environments.rb</tt>:
|
68
|
-
|
69
|
-
config.corner_banner_side = :right
|
70
|
-
|
71
|
-
Valid options are currently <tt>:left</tt> and <tt>:right</tt>, corresponding to the upper-left and upper-right corners, respectively.
|
72
|
-
|
73
|
-
== Aliasing Environment Names
|
74
|
-
|
75
|
-
Having the string "[development]" prepended to your title may make things a bit unwieldy for some people. In that case, you may use the aliasing option to change such an identifier to something shorter (but still identifiable with the environment in question). For example, you can alias 'development' to 'dev' or 'D', which would result in "[dev]" or "[D]" being prepended to the page title.
|
76
|
-
|
77
|
-
To add an alias that is used both in the title and the banner, uncomment and set the <tt>aliases</tt> setting as follows:
|
78
|
-
|
79
|
-
config.aliases = { 'development' => 'dev', 'preproduction' => 'preprod' }
|
80
|
-
|
81
|
-
The above example would show use 'dev' in a development environment and 'preprod' in a preproduction environment. The point is, you can alias any environment you may use, not just the out-of-the-box environments Rails uses (development, test, production).
|
82
|
-
|
83
|
-
You can also set the aliases for ONLY the title or ONLY the corner banner. For example, I like the full environment used in the banner but like the title identifier to be much shorter:
|
84
|
-
|
85
|
-
config.title_aliases = { 'development' => 'D', 'staging' => 'S' }
|
86
|
-
|
87
|
-
You can do the same to change the alias of the corner banner:
|
88
|
-
|
89
|
-
config.corner_banner_aliases = { 'development' => 'dev', 'preproduction' => 'preprod' }
|
90
|
-
|
91
|
-
= Contributing to visual-environments
|
92
|
-
|
93
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
94
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
95
|
-
* Fork the project
|
96
|
-
* Start a feature/bugfix branch
|
97
|
-
* Commit and push until you are happy with your contribution
|
98
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
99
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
100
|
-
|
101
|
-
= Copyright
|
102
|
-
|
103
|
-
Copyright (c) 2011 Zachery Moneypenny, David van Leeuwen. See LICENSE.txt for further details.
|
104
|
-
|
105
|
-
Big Ups to the Mad-Railers for their idea for this gem! If you're coding Ruby/Rails in the Madison, Wisconsin area search for MadRailers on meetup.com or check out the Google Group at http://groups.google.com/group/Mad-Railers
|
106
|
-
|