console_color 0.0.1

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,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YWYxYWZkMTcwMTk3OTU1NTVkMjRkMWQ2OTA3ZGQ1MWZkNDNlMjQxOQ==
5
+ data.tar.gz: !binary |-
6
+ ODJjMTdhZWM0YWVhZWFkYWUyZmMwNGQyNDI2ZmNhYjc1YTA5NGJjNg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ OTNlOTI0MDVkYjg0MzcxMmM0MWQ4YWVmZGI3MjM2ZmRlOWRlN2RiYTViMzE2
10
+ MWJiYTlhMDk2OWM5M2Y3MDA4ZDc0NDM2NDhlNDU3Y2JmOGM5OGFkNTAyYzE3
11
+ NDc3OWUyN2ZkOTgxOWE4NDQ2YjI1Mzk5ZTI3YjE4OTAwM2NlYjM=
12
+ data.tar.gz: !binary |-
13
+ MjM2NTM0ZDhlN2ZlMDQwMDkyNGI5OWRhNDNiNzUzMDk0NmQyNTQ0MDZlNzM2
14
+ YjE2YjA5YTgyYWFkZTBmNTU1Y2U1ZThlMGJkOTBjYTgwNTE0M2EzYWVkNmZj
15
+ NjBlNjQwYzA1Yjg3OTU3ZWE3MGQ2MzY0NmY2ODg0NGVmNzQzYjE=
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in console_color.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Joey Aghion, Artsy
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,42 @@
1
+ # ConsoleColor
2
+
3
+ ConsoleColor adds the color-coded application name and environment to your Rails console prompt.
4
+
5
+ ![](http://f.cl.ly/items/3U2M3c1c230s0S2X3n22/Screen%20Shot%202013-11-22%20at%2012.06.43%20AM.png)
6
+
7
+ ![](http://f.cl.ly/items/3j1o3w3N1E382a211d1P/Screen%20Shot%202013-11-21%20at%2011.48.18%20PM.png)
8
+
9
+ ![](http://f.cl.ly/items/0e3v3N0k0P1y471t2c3k/Screen%20Shot%202013-11-22%20at%2012.04.41%20AM.png)
10
+
11
+ By default, the prompt is green in development, red in production, and yellow elsewhere. Alternatively, you can specify a custom color in an initializer (using the [bash colorization codes](http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html)):
12
+
13
+ ConsoleColor::COLORS['production'] = "\e[35m" # pink
14
+
15
+
16
+ ## Installation
17
+
18
+ Add this line to your application's Gemfile:
19
+
20
+ gem 'console_color'
21
+
22
+ And then execute:
23
+
24
+ $ bundle
25
+
26
+ Or install it yourself as:
27
+
28
+ $ gem install console_color
29
+
30
+
31
+ ## Contributing
32
+
33
+ 1. Fork it
34
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
35
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
36
+ 4. Push to the branch (`git push origin my-new-feature`)
37
+ 5. Create new Pull Request
38
+
39
+
40
+ © Joey Aghion, Artsy
41
+
42
+ [LICENSE](LICENSE.txt)
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'console_color/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "console_color"
8
+ spec.version = ConsoleColor::VERSION
9
+ spec.authors = ["Joey Aghion"]
10
+ spec.email = ["joey@aghion.com"]
11
+ spec.description = %q{Add color-coded app and environment information to the Rails console prompt.}
12
+ spec.summary = spec.description
13
+ spec.homepage = "https://github.com/joeyAghion/console_color"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
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_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ end
@@ -0,0 +1,28 @@
1
+ module ConsoleColor
2
+ class Railtie < Rails::Railtie
3
+
4
+ config.after_initialize do
5
+
6
+ class << IRB
7
+
8
+ def setup_with_custom_prompt(ap_path)
9
+ setup_without_custom_prompt(ap_path)
10
+ prompt = "#{ConsoleColor::COLORS[Rails.env]}#{Rails.application.class.parent_name.downcase}:#{Rails.env}"
11
+ IRB.conf[:PROMPT][:RAILS_APP] = {
12
+ PROMPT_I: "\001#{prompt}> \e[0m\002",
13
+ PROMPT_N: "\001#{prompt}> \e[0m\002",
14
+ PROMPT_S: "\001#{prompt}%l \e[0m\002",
15
+ PROMPT_C: "\001#{prompt}* \e[0m\002",
16
+ RETURN: "=> %s\n"
17
+ }
18
+ IRB.conf[:PROMPT_MODE] = :RAILS_APP
19
+ end
20
+
21
+ alias_method_chain :setup, :custom_prompt
22
+
23
+ end
24
+
25
+ end
26
+
27
+ end
28
+ end
@@ -0,0 +1,3 @@
1
+ module ConsoleColor
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,9 @@
1
+ require "console_color/version"
2
+
3
+ require 'console_color/railtie' if defined?(::Rails::Console)
4
+
5
+ module ConsoleColor
6
+ COLORS = Hash.new("\e[33m") # yellow
7
+ COLORS['production'] = "\e[31m" # red
8
+ COLORS['development'] = "\e[32m" # green
9
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: console_color
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Joey Aghion
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-11-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Add color-coded app and environment information to the Rails console
42
+ prompt.
43
+ email:
44
+ - joey@aghion.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - .gitignore
50
+ - Gemfile
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - console_color.gemspec
55
+ - lib/console_color.rb
56
+ - lib/console_color/railtie.rb
57
+ - lib/console_color/version.rb
58
+ homepage: https://github.com/joeyAghion/console_color
59
+ licenses:
60
+ - MIT
61
+ metadata: {}
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ! '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 2.1.11
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: Add color-coded app and environment information to the Rails console prompt.
82
+ test_files: []