colorin 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 74c1bd7af9a0b41019b3cac7f946e138bf0c17f7
4
+ data.tar.gz: bc8555f9f7a4536232bc71a0c035624065d162d6
5
+ SHA512:
6
+ metadata.gz: e53f57b4c1f94b0521da004290ea9b420d374949ab7b24a11d0ed858ea86aaa07e60c282d313688bb62e02cd58d80e46b10eae1c4ca289dc63f080ff5765b474
7
+ data.tar.gz: f51ddcb599d68d6eaea4ae25beb5262e3f167a27b53d9b650306fcab6df63092d4fb65c817758ba32699e51d5d2e9aa65e44e59b0227a20ef695002fafaf826a
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ colorin
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby 2.3.0
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in colorin.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Gabriel Naiman
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # Colorin
2
+
3
+ Colors for terminal without monkey patching
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'colorin'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install colorin
20
+
21
+ ## Usage
22
+
23
+ ```ruby
24
+ Colorin.red('text').on_blue.underline.bold
25
+ ```
26
+
27
+ ## Development
28
+
29
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
30
+
31
+ ## Contributing
32
+
33
+ Bug reports and pull requests are welcome on GitHub at https://github.com/gabynaiman/colorin.
34
+
35
+ ## License
36
+
37
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
38
+
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new(:spec) do |t|
5
+ t.libs << 'spec'
6
+ t.libs << 'lib'
7
+ t.pattern = 'spec/**/*_spec.rb'
8
+ t.verbose = false
9
+ t.warning = false
10
+ end
11
+
12
+ task default: :spec
data/colorin.gemspec ADDED
@@ -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 'colorin'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'colorin'
8
+ spec.version = Colorin::VERSION
9
+ spec.authors = ['Gabriel Naiman']
10
+ spec.email = ['gabynaiman@gmail.com']
11
+
12
+ spec.summary = 'Colors for terminal without monkey patching'
13
+ spec.description = 'Colors for terminal without monkey patching'
14
+ spec.homepage = 'https://github.com/gabynaiman/colorin'
15
+ spec.license = 'MIT'
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = 'exe'
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ['lib']
21
+
22
+ spec.add_development_dependency 'bundler', '~> 1.12'
23
+ spec.add_development_dependency 'rake', '~> 10.0'
24
+ spec.add_development_dependency 'minitest', '~> 5.0'
25
+ end
data/lib/colorin.rb ADDED
@@ -0,0 +1,59 @@
1
+ class Colorin < String
2
+
3
+ VERSION = '1.0.0'
4
+
5
+ CLEAR = 0
6
+
7
+ CODES = {
8
+ bold: 1,
9
+ dark: 2,
10
+ underline: 4,
11
+ blink: 5,
12
+ reverse: 7,
13
+ hide: 8,
14
+
15
+ black: 30,
16
+ red: 31,
17
+ green: 32,
18
+ yellow: 33,
19
+ blue: 34,
20
+ magenta: 35,
21
+ cyan: 36,
22
+ white: 37,
23
+ black_light: 90,
24
+ red_light: 91,
25
+ green_light: 92,
26
+ yellow_light: 93,
27
+ blue_light: 94,
28
+ magenta_light: 95,
29
+ cyan_light: 96,
30
+
31
+ on_black: 40,
32
+ on_red: 41,
33
+ on_green: 42,
34
+ on_yellow: 43,
35
+ on_blue: 44,
36
+ on_magenta: 45,
37
+ on_cyan: 46,
38
+ on_gray: 47,
39
+ on_black_light: 100,
40
+ on_red_light: 101,
41
+ on_green_light: 102,
42
+ on_yellow_light: 103,
43
+ on_blue_light: 104,
44
+ on_magenta_light: 105,
45
+ on_cyan_light: 106,
46
+ on_white: 107
47
+ }
48
+
49
+ CODES.each do |name, value|
50
+ define_method name do
51
+ Colorin.new "\e[#{value}m#{self}\e[#{CLEAR}m"
52
+ end
53
+
54
+ define_singleton_method name do |string|
55
+ Colorin.new(string).send name
56
+ end
57
+ end
58
+
59
+ end
metadata ADDED
@@ -0,0 +1,95 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: colorin
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Gabriel Naiman
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-08-16 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.12'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.0'
55
+ description: Colors for terminal without monkey patching
56
+ email:
57
+ - gabynaiman@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".ruby-gemset"
64
+ - ".ruby-version"
65
+ - Gemfile
66
+ - LICENSE.txt
67
+ - README.md
68
+ - Rakefile
69
+ - colorin.gemspec
70
+ - lib/colorin.rb
71
+ homepage: https://github.com/gabynaiman/colorin
72
+ licenses:
73
+ - MIT
74
+ metadata: {}
75
+ post_install_message:
76
+ rdoc_options: []
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ requirements: []
90
+ rubyforge_project:
91
+ rubygems_version: 2.5.1
92
+ signing_key:
93
+ specification_version: 4
94
+ summary: Colors for terminal without monkey patching
95
+ test_files: []