lolize 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.
@@ -0,0 +1,3 @@
1
+ pkg/*
2
+ *.gem
3
+ .bundle
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in lolize.gemspec
4
+ gemspec
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,47 @@
1
+ require 'lolcat'
2
+
3
+ module Lolize
4
+ def self.write(s)
5
+ s.lines.each_with_index do |line, index|
6
+ lol_write(line)
7
+ raw_write("\n") if line.length>0 && line[-1].chr=="\n"
8
+ end
9
+ end
10
+
11
+ def self.lol_write(s)
12
+ @opts ||= {
13
+ :animate => false,
14
+ :duration => 12,
15
+ :os => 0,
16
+ :speed => 20,
17
+ :spread => 8.0,
18
+ :freq => 0.3
19
+ }
20
+ @opts[:os] += 1
21
+ Lol.send(:println, s.dup, {}, @opts)
22
+ end
23
+ def self.raw_write(s)
24
+ $stdout.raw_write(s)
25
+ end
26
+ def self.lolize(output)
27
+ class << output
28
+ alias :raw_write :write
29
+ def write(s)
30
+ Lolize.write(s)
31
+ end
32
+ end
33
+ end
34
+ end
35
+
36
+ module Lol
37
+ def self.puts(s='')
38
+ # Lolize.raw_write("#{s}\n")
39
+ end
40
+ def self.print(s)
41
+ Lolize.raw_write(s)
42
+ end
43
+ end
44
+
45
+ Lolize.lolize($stdout)
46
+ Lolize.lolize($stderr)
47
+
@@ -0,0 +1,3 @@
1
+ module Lolize
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "lolize/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "lolize"
7
+ s.version = Lolize::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["miaout17"]
10
+ s.email = ["miaout17@gmail.com"]
11
+ s.homepage = "https://github.com/miaout17/lolize"
12
+ s.summary = %q{Colorize your ruby stdout with Lolcat}
13
+ s.description = %q{Colorize your ruby stdout with Lolcat}
14
+
15
+ s.rubyforge_project = "lolize"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+
22
+ s.add_dependency 'lolcat','42.0.99'
23
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lolize
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - miaout17
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-08-26 00:00:00 +08:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: lolcat
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - "="
28
+ - !ruby/object:Gem::Version
29
+ hash: 393
30
+ segments:
31
+ - 42
32
+ - 0
33
+ - 99
34
+ version: 42.0.99
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ description: Colorize your ruby stdout with Lolcat
38
+ email:
39
+ - miaout17@gmail.com
40
+ executables: []
41
+
42
+ extensions: []
43
+
44
+ extra_rdoc_files: []
45
+
46
+ files:
47
+ - .gitignore
48
+ - Gemfile
49
+ - Rakefile
50
+ - lib/lolize.rb
51
+ - lib/lolize/version.rb
52
+ - lolize.gemspec
53
+ has_rdoc: true
54
+ homepage: https://github.com/miaout17/lolize
55
+ licenses: []
56
+
57
+ post_install_message:
58
+ rdoc_options: []
59
+
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ hash: 3
68
+ segments:
69
+ - 0
70
+ version: "0"
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ hash: 3
77
+ segments:
78
+ - 0
79
+ version: "0"
80
+ requirements: []
81
+
82
+ rubyforge_project: lolize
83
+ rubygems_version: 1.3.7
84
+ signing_key:
85
+ specification_version: 3
86
+ summary: Colorize your ruby stdout with Lolcat
87
+ test_files: []
88
+