Glitz 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8be6868dd50ba595c8ad412402236298f441969d
4
+ data.tar.gz: 5a3ff0781a93628817afba3911b82019e1c25949
5
+ SHA512:
6
+ metadata.gz: 858cc42c00c915356411490cca6e5489845c78527850c6ee93004f2fce8c754269000f258220473d25441e953d2292d948c2489812c90ac0c708028a3c6b61fa
7
+ data.tar.gz: 2362d2de2f930c77a6c5229383ca860c34ba545995d6f164abdf5ea00e7714aa2ed84b95c0ba4ea5b88192385b225af97254f844377ceb62297524e70d3c82fc
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
@@ -0,0 +1,16 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ Glitz (1.0.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ rake (10.4.2)
10
+
11
+ PLATFORMS
12
+ ruby
13
+
14
+ DEPENDENCIES
15
+ Glitz!
16
+ rake
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011 Mattt Thompson (http://mattt.me)
1
+ Copyright (c) 2011–2015 Mattt Thompson (http://mattt.me)
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
16
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
17
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
18
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
19
+ THE SOFTWARE.
@@ -0,0 +1,29 @@
1
+ # Glitz
2
+ *ANSI-Colorized Glamour for Terminal Output*
3
+
4
+ Colors and effects can be chained and added in any order. You can specify one foreground color and one background color (setting a new value will overwrite the previous one). Effects like bold and underline combine together.
5
+
6
+ ## Usage
7
+
8
+ ```ruby
9
+ require 'glitz'
10
+ include Glitz
11
+
12
+ puts "Roses are Red".foreground(:red)
13
+ puts "Editors are White on Black".foreground(:white).background(:black)
14
+ puts "If you eat " + "Chunky Bacon".bold.underline
15
+ puts "Beware the dreaded " + "Blink Attack!".foreground(:white).background(:magenta).blink
16
+ ```
17
+
18
+ ### Supported Values
19
+
20
+ - Colors: `[:black, :red, :green, :yellow, :blue, :magenta, :cyan, :white]`
21
+ - Effects: `[:bold, :underline, :blink, :reverse, :concealed]`
22
+
23
+ ## Creator
24
+
25
+ Mattt Thompson ([@mattt](https://twitter.com/mattt))
26
+
27
+ ## License
28
+
29
+ Glitz is available under the MIT license. See the LICENSE file for more info.
@@ -0,0 +1,11 @@
1
+ require "bundler"
2
+ Bundler.setup
3
+
4
+ gemspec = eval(File.read("glitz.gemspec"))
5
+
6
+ task :build => "#{gemspec.full_name}.gem"
7
+
8
+ file "#{gemspec.full_name}.gem" => gemspec.files + ["glitz.gemspec"] do
9
+ system "gem build glitz.gemspec"
10
+ system "gem install glitz-#{Glitz::VERSION}.gem"
11
+ end
Binary file
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+
4
+ require "glitz/version"
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "Glitz"
8
+ s.authors = ["Mattt Thompson"]
9
+ s.license = "MIT"
10
+ s.email = "m@mattt.me"
11
+ s.homepage = "http://github.com/mattt/glitz"
12
+ s.version = Glitz::VERSION
13
+ s.platform = Gem::Platform::RUBY
14
+ s.summary = "Glitz"
15
+ s.description = "ANSI-Colorized Glamour for Terminal Output"
16
+
17
+ s.add_development_dependency "rake"
18
+
19
+ s.files = Dir["./**/*"].reject { |file| file =~ /\.\/(bin|log|pkg|script|spec|test|vendor)/ }
20
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
+ s.require_paths = ["lib"]
23
+ end
@@ -1,3 +1,5 @@
1
+ require 'glitz/version'
2
+
1
3
  module Glitz
2
4
  COLORS = {
3
5
  :black => 0,
@@ -19,7 +21,7 @@ module Glitz
19
21
  }
20
22
 
21
23
  def self.included(klass)
22
- String.instance_eval do
24
+ String.instance_eval do
23
25
  extend ClassMethods
24
26
  include InstanceMethods
25
27
  end
@@ -63,7 +65,7 @@ module Glitz
63
65
 
64
66
  class ColoredString
65
67
  include InstanceMethods
66
-
68
+
67
69
  def initialize(string)
68
70
  @string = string
69
71
  @effects = []
@@ -91,4 +93,4 @@ module Glitz
91
93
  self.to_s.send(method_name, *args, &block)
92
94
  end
93
95
  end
94
- end
96
+ end
@@ -1,3 +1,3 @@
1
1
  module Glitz
2
- VERSION = "0.1.0"
3
- end
2
+ VERSION = "1.0.0"
3
+ end
metadata CHANGED
@@ -1,72 +1,66 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: Glitz
3
- version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 0
10
- version: 0.1.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Mattt Thompson
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2011-09-18 00:00:00 -05:00
19
- default_executable:
20
- dependencies: []
21
-
22
- description: Glitz adds ANSI-colorized glamour to your terminal output
11
+ date: 2015-03-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: ANSI-Colorized Glamour for Terminal Output
23
28
  email: m@mattt.me
24
29
  executables: []
25
-
26
30
  extensions: []
27
-
28
31
  extra_rdoc_files: []
29
-
30
- files:
31
- - lib/glitz/version.rb
32
- - lib/glitz.rb
33
- - LICENSE
34
- - README.rdoc
35
- has_rdoc: true
32
+ files:
33
+ - ./Gemfile
34
+ - ./Gemfile.lock
35
+ - ./glitz-0.1.0.gem
36
+ - ./glitz.gemspec
37
+ - ./lib/glitz/version.rb
38
+ - ./lib/glitz.rb
39
+ - ./LICENSE
40
+ - ./Rakefile
41
+ - ./README.md
36
42
  homepage: http://github.com/mattt/glitz
37
- licenses: []
38
-
43
+ licenses:
44
+ - MIT
45
+ metadata: {}
39
46
  post_install_message:
40
47
  rdoc_options: []
41
-
42
- require_paths:
48
+ require_paths:
43
49
  - lib
44
- required_ruby_version: !ruby/object:Gem::Requirement
45
- none: false
46
- requirements:
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- hash: 3
50
- segments:
51
- - 0
52
- version: "0"
53
- required_rubygems_version: !ruby/object:Gem::Requirement
54
- none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- hash: 23
59
- segments:
60
- - 1
61
- - 3
62
- - 6
63
- version: 1.3.6
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
64
60
  requirements: []
65
-
66
61
  rubyforge_project:
67
- rubygems_version: 1.6.2
62
+ rubygems_version: 2.1.11
68
63
  signing_key:
69
- specification_version: 3
64
+ specification_version: 4
70
65
  summary: Glitz
71
66
  test_files: []
72
-
@@ -1,51 +0,0 @@
1
- = Glitz adds ANSI-colorized glamour to your terminal output
2
-
3
- == Example
4
-
5
- require 'glitz'
6
-
7
- include Glitz
8
-
9
- puts "Roses are Red".foreground(:red)
10
- puts "Editors are White on Black".foreground(:white).background(:black)
11
- puts "If you eat " + "Chunky Bacon".bold.underline
12
- puts "Beware the dreaded " + "Blink Attack!".foreground(:white).background(:magenta).blink
13
-
14
- == Demo
15
-
16
- If your terminal supports ANSI colors, execute the command below to check out the output from the example
17
-
18
- $ echo | curl https://raw.github.com/gist/1217524/9222c1e0f788b852ec277f213fe47b122ef3836f/poem.txt
19
-
20
- == Usage
21
-
22
- Colors and effects can be chained, and added in any order. You can specify one foreground color and one background color (setting a new value will overwrite the previous one). Effects like bold and underline, on the other hand, combine together.
23
-
24
- === Supported Values
25
-
26
- * Colors: <tt>[:black, :red, :green, :yellow, :blue, :magenta, :cyan, :white]</tt>
27
- * Effects: <tt>[:bold, :underline, :blink, :reverse, :concealed]</tt>
28
-
29
- == License
30
-
31
- Glitz is licensed under the MIT License:
32
-
33
- Copyright (c) 2011 Mattt Thompson (http://mattt.me)
34
-
35
- Permission is hereby granted, free of charge, to any person obtaining a copy
36
- of this software and associated documentation files (the "Software"), to deal
37
- in the Software without restriction, including without limitation the rights
38
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
39
- copies of the Software, and to permit persons to whom the Software is
40
- furnished to do so, subject to the following conditions:
41
-
42
- The above copyright notice and this permission notice shall be included in
43
- all copies or substantial portions of the Software.
44
-
45
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
46
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
47
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
48
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
49
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
50
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
51
- THE SOFTWARE.