pcolor 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +1 -0
- data/LICENSE +1 -0
- data/README +5 -0
- data/Rakefile +61 -0
- data/lib/pcolor.rb +20 -0
- data/lib/pcolor/init.rb +6 -0
- data/resources/defaults.yaml +2 -0
- metadata +87 -0
data/COPYING
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
No copying restrictions/license given.
|
data/LICENSE
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
No license given.
|
data/README
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/testtask'
|
3
|
+
require 'rake/clean'
|
4
|
+
require 'rake/gempackagetask'
|
5
|
+
require 'rake/rdoctask'
|
6
|
+
require 'fileutils'
|
7
|
+
include FileUtils
|
8
|
+
|
9
|
+
version="0.1"
|
10
|
+
name="pcolor"
|
11
|
+
|
12
|
+
spec = Gem::Specification.new do |s|
|
13
|
+
s.name = name
|
14
|
+
s.version = version
|
15
|
+
s.description = s.summary = "The pcolor GemPlugin"
|
16
|
+
s.author = "Nobody"
|
17
|
+
s.add_dependency('gem_plugin', '>= 0.2.3')
|
18
|
+
|
19
|
+
s.platform = Gem::Platform::RUBY
|
20
|
+
s.has_rdoc = true
|
21
|
+
s.extra_rdoc_files = ["README"]
|
22
|
+
|
23
|
+
s.files = %w(COPYING LICENSE README Rakefile) +
|
24
|
+
Dir.glob("{bin,doc/rdoc,test,lib}/**/*") +
|
25
|
+
Dir.glob("ext/**/*.{h,c,rb}") +
|
26
|
+
Dir.glob("examples/**/*.rb") +
|
27
|
+
Dir.glob("tools/*.rb") +
|
28
|
+
Dir.glob("resources/**/*")
|
29
|
+
|
30
|
+
s.require_path = "lib"
|
31
|
+
s.bindir = "bin"
|
32
|
+
end
|
33
|
+
|
34
|
+
Rake::GemPackageTask.new(spec) do |p|
|
35
|
+
p.need_tar = true if RUBY_PLATFORM !~ /mswin/
|
36
|
+
end
|
37
|
+
|
38
|
+
task :install => [:test, :package] do
|
39
|
+
sh %{sudo gem install pkg/#{name}-#{version}.gem}
|
40
|
+
end
|
41
|
+
|
42
|
+
task :uninstall => [:clean] do
|
43
|
+
sh %{sudo gem uninstall #{name}}
|
44
|
+
end
|
45
|
+
|
46
|
+
Rake::TestTask.new do |t|
|
47
|
+
t.libs << "test"
|
48
|
+
t.test_files = FileList['test/test*.rb']
|
49
|
+
t.verbose = true
|
50
|
+
end
|
51
|
+
|
52
|
+
Rake::RDocTask.new do |rdoc|
|
53
|
+
rdoc.rdoc_dir = 'doc/rdoc'
|
54
|
+
rdoc.options << '--line-numbers'
|
55
|
+
rdoc.rdoc_files.add ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc']
|
56
|
+
end
|
57
|
+
|
58
|
+
task :default => [:test, :package]
|
59
|
+
|
60
|
+
CLEAN.include ['build/*', '**/*.o', '**/*.so', '**/*.a', 'lib/*-*', '**/*.log', 'pkg', 'lib/*.bundle', '*.gem', '.config']
|
61
|
+
|
data/lib/pcolor.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
class Object
|
2
|
+
def p(message, color = :nil)
|
3
|
+
color_table = {
|
4
|
+
:red => '31;1',
|
5
|
+
:green => '32;1',
|
6
|
+
:yellow => '33;1',
|
7
|
+
:blue => '34;1',
|
8
|
+
:purple => '35;1',
|
9
|
+
:sky => '36;1'
|
10
|
+
}
|
11
|
+
|
12
|
+
if !color.nil? and color_table.has_key? color.to_sym
|
13
|
+
print "\e[#{color_table[color]}m"
|
14
|
+
Kernel::p message
|
15
|
+
print "\e[0m"
|
16
|
+
else
|
17
|
+
Kernel::p message
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/pcolor/init.rb
ADDED
metadata
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pcolor
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 9
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: "0.1"
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Nobody
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2011-04-15 00:00:00 +08:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: gem_plugin
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 17
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
- 2
|
32
|
+
- 3
|
33
|
+
version: 0.2.3
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
description: The pcolor GemPlugin
|
37
|
+
email:
|
38
|
+
executables: []
|
39
|
+
|
40
|
+
extensions: []
|
41
|
+
|
42
|
+
extra_rdoc_files:
|
43
|
+
- README
|
44
|
+
files:
|
45
|
+
- COPYING
|
46
|
+
- LICENSE
|
47
|
+
- README
|
48
|
+
- Rakefile
|
49
|
+
- lib/pcolor/init.rb
|
50
|
+
- lib/pcolor.rb
|
51
|
+
- resources/defaults.yaml
|
52
|
+
has_rdoc: true
|
53
|
+
homepage:
|
54
|
+
licenses: []
|
55
|
+
|
56
|
+
post_install_message:
|
57
|
+
rdoc_options: []
|
58
|
+
|
59
|
+
require_paths:
|
60
|
+
- lib
|
61
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
hash: 3
|
67
|
+
segments:
|
68
|
+
- 0
|
69
|
+
version: "0"
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
hash: 3
|
76
|
+
segments:
|
77
|
+
- 0
|
78
|
+
version: "0"
|
79
|
+
requirements: []
|
80
|
+
|
81
|
+
rubyforge_project:
|
82
|
+
rubygems_version: 1.3.7
|
83
|
+
signing_key:
|
84
|
+
specification_version: 3
|
85
|
+
summary: The pcolor GemPlugin
|
86
|
+
test_files: []
|
87
|
+
|