rails-env-favicon 0.0.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 016ef5f2ade092295b1012e3ceb368d6cacfae46
4
+ data.tar.gz: 25319d56f109d21b2dcaf45830eb59fcab243c3d
5
+ SHA512:
6
+ metadata.gz: 64d46971e658f9408d7397d420e5ef7e4b1057091adaf3b2a5fdb5a730376a4ff2db47f2a9bbdf712c105402a4f38500b153269f7ecd6f5468d2063b9533d2f5
7
+ data.tar.gz: f93a18cc41db1e4e62569dc3546466e9fa1723f843cdedb5239a4c00e560ada615076eeea5cf1937829767fd329838b8be8a747ba3cd0bf8ab278640a0bdc7ba
data/.gitignore ADDED
@@ -0,0 +1,16 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ lib/bundler/man
11
+ pkg
12
+ rdoc
13
+ spec/reports
14
+ test/tmp
15
+ test/version_tmp
16
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in rails_env_favicon.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Accessd
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,54 @@
1
+ Rails Env Favicon
2
+ ================================
3
+
4
+ Made changes in the code to debug and do not understand what's wrong.
5
+ Hell, I'm on the debug production! This happened to you? To me several times.
6
+ Library offers one of the ways to solve this problem.
7
+
8
+ Most everyone will understand from one picture:
9
+
10
+ ![ScreenShot](https://raw.github.com/accessd/rails-env-favicon/master/doc/img/sample.png)
11
+
12
+ This means that on the first tab we have development environment, on second stage, and third it's production(we don't need change this favicon).
13
+
14
+ It uses [Tinycon](https://github.com/tommoor/tinycon) - A small library for manipulating the favicon.
15
+
16
+ Installation
17
+ ------------
18
+
19
+ Add this line to your application's Gemfile:
20
+
21
+ gem 'rails-env-favicon', github: 'accessd/rails-env-favicon'
22
+
23
+ And then execute:
24
+
25
+ $ bundle
26
+
27
+ Setup:
28
+
29
+ # adds initializer
30
+ rails g rails_env_favicon:install
31
+
32
+ In your JavaScript manifest (e.g. `application.js`):
33
+
34
+ //= require tinycon.min
35
+ //= require rails_env_favicon
36
+
37
+ Config
38
+ ------------
39
+
40
+ In config/initializers/rails_env_favicon.rb
41
+
42
+ RailsEnvFavicon.setup do |config|
43
+ config.text_color = '#ffffff'
44
+ config.background_color = '#549a2f'
45
+ end
46
+
47
+ Contributing
48
+ -------------
49
+
50
+ 1. Fork it ( http://github.com/[my-github-username]/rails_env_favicon/fork )
51
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
52
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
53
+ 4. Push to the branch (`git push origin my-new-feature`)
54
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,12 @@
1
+ <% unless Rails.env.production? %>
2
+ Tinycon.setOptions({
3
+ width: 8,
4
+ height: 9,
5
+ font: '10px arial',
6
+ colour: '<%= RailsEnvFavicon.text_color %>',
7
+ background: '<%= RailsEnvFavicon.background_color %>',
8
+ fallback: true
9
+ });
10
+
11
+ Tinycon.setBubble("<%= RailsEnvFavicon.env_letter %>");
12
+ <% end %>
@@ -0,0 +1,6 @@
1
+ require 'rails-env-favicon'
2
+
3
+ RailsEnvFavicon.setup do |config|
4
+ config.text_color = '#ffffff'
5
+ config.background_color = '#549a2f'
6
+ end
Binary file
@@ -0,0 +1,12 @@
1
+ module RailsEnvFavicon
2
+ module Generators
3
+ class InstallGenerator < ::Rails::Generators::Base
4
+ desc "creates an initializer file at config/initializers/rails_env_favicon.rb"
5
+ source_root File.expand_path('../../../..', __FILE__)
6
+
7
+ def generate_initialization
8
+ copy_file 'config/initializers/rails_env_favicon.rb', 'config/initializers/rails_env_favicon.rb'
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,7 @@
1
+ module RailsEnvFavicon
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ require 'tinycon-rails'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ module RailsEnvFavicon
2
+ VERSION = "0.0.2"
3
+ end
@@ -0,0 +1,19 @@
1
+ require "rails-env-favicon/version"
2
+ require "rails-env-favicon/rails"
3
+
4
+ module RailsEnvFavicon
5
+ mattr_accessor :text_color
6
+ self.text_color = '#ffffff'
7
+ mattr_accessor :background_color
8
+ self.background_color = '#549a2f'
9
+
10
+ def self.env_letter
11
+ ::Rails.env.first.upcase
12
+ end
13
+
14
+ class << self
15
+ def setup
16
+ yield self
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'rails-env-favicon/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "rails-env-favicon"
8
+ spec.version = RailsEnvFavicon::VERSION
9
+ spec.authors = ["Accessd"]
10
+ spec.email = ["accessd0@gmail.com"]
11
+ spec.summary = %q{Gem to display the rails environment on the favicon}
12
+ spec.description = %q{Gem to display the rails environment on the favicon}
13
+ spec.homepage = "https://github.com/accessd/rails-env-favicon"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "railties", ">= 3.1"
22
+ spec.add_dependency "tinycon-rails"
23
+ spec.add_development_dependency "bundler", "~> 1.6"
24
+ spec.add_development_dependency "rake"
25
+ end
metadata ADDED
@@ -0,0 +1,113 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rails-env-favicon
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Accessd
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-06-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: railties
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: tinycon-rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
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: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.6'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.6'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Gem to display the rails environment on the favicon
70
+ email:
71
+ - accessd0@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - Gemfile
78
+ - LICENSE.txt
79
+ - README.md
80
+ - Rakefile
81
+ - app/assets/javascripts/rails_env_favicon.js.erb
82
+ - config/initializers/rails_env_favicon.rb
83
+ - doc/img/sample.png
84
+ - lib/generators/rails_env_favicon/install_generator.rb
85
+ - lib/rails-env-favicon.rb
86
+ - lib/rails-env-favicon/rails.rb
87
+ - lib/rails-env-favicon/version.rb
88
+ - rails-env-favicon.gemspec
89
+ homepage: https://github.com/accessd/rails-env-favicon
90
+ licenses:
91
+ - MIT
92
+ metadata: {}
93
+ post_install_message:
94
+ rdoc_options: []
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ requirements: []
108
+ rubyforge_project:
109
+ rubygems_version: 2.2.2
110
+ signing_key:
111
+ specification_version: 4
112
+ summary: Gem to display the rails environment on the favicon
113
+ test_files: []