ansi-sys 0.2.0

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,188 @@
1
+ * 2007-10-21 zunda <zunda at freeshell.org>
2
+ - (0.2.0) First release on RubyForge
3
+ - Makefile: modified commands in commit target
4
+
5
+ * 2007-10-21 zunda <zunda at freeshell.org>
6
+ - config/hoe.rb: modified gem description
7
+ - website/template.rhtml: showed link to download
8
+ - History.txt: updated
9
+
10
+ * 2007-10-21 zunda <zunda at freeshell.org>
11
+ - README.txt: modified Usage example to be more user friendly
12
+ - Manifest.txt: removed COPYING
13
+
14
+ * 2007-10-20 zunda <zunda at freeshell.org>
15
+ - website/template.rhtml: hidden link to download
16
+ - website/index.txt added a link to Wikipedia
17
+
18
+ * 2007-10-20 zunda <zunda at freeshell.org>
19
+ - website/template.rhtml, index.txt, stylesheets/screen.css, and
20
+ script/txt2html: modified for website to be uploaded
21
+ - README.txt: updated file for license
22
+
23
+ * 2007-10-19 zunda <zunda at freeshell.org>
24
+ - config/hoe.rb: Modified GEM_NAME to make life easier
25
+
26
+ * 2007-10-19 zunda <zunda at freeshell.org>
27
+ - gpl.rd.txt: renamed from gpl.txt, formatted as RD
28
+ - lgpl.rd.txt: renamed from lgpl.txt, formatted as RD
29
+ - Manifest.txt: updated
30
+
31
+ * 2007-10-19 zunda <zunda at freeshell.org>
32
+ - License.txt: renamed from COPYING, formatted as RD
33
+
34
+ * 2007-10-19 zunda <zunda at freeshell.org>
35
+ - Merged -r 2:6 at
36
+ svn+ssh://zunda@rubyforge.org/var/svn/ansi-sys/trunk/ansi-sys
37
+ - doc/: removed
38
+
39
+ * 2007-10-16 zunda <zunda at freeshell.org>
40
+ - script/txt2html: modified to run rake website_generate
41
+ - Manifest.txt: updated
42
+
43
+ * 2007-10-16 zunda <zunda at freeshell.org>
44
+ - config/requirements.rb and config/hoe.rb: modified to run rake -T
45
+
46
+ * 2007-10-16 zunda <zunda at freeshell.org>
47
+ - Started gemify
48
+
49
+ * 2007-10-14 zunda <zunda at freeshell.org>
50
+ - (0.1.1)
51
+ - Documentation
52
+
53
+ * 2007-10-14 zunda <zunda at freeshell.org>
54
+ - (0.1.0)
55
+ - Tagging. First usable release.
56
+ - Makefile: modified to appropriately tag
57
+
58
+ * 2007-10-14 zunda <zunda at freeshell.org>
59
+ - spec/hiki_spec.rb and spec/attach/test_data.{txt,html}: added
60
+ - lib/ansisys.rb: added a \n after <pre> to make sure first \n is
61
+ rendered
62
+
63
+ * 2007-10-14 zunda <zunda at freeshell.org>
64
+ - lib/ansisys.rb: modified to include css style as Hiki plugin
65
+
66
+ * 2007-10-14 zunda <zunda at freeshell.org>
67
+ - lib/ansisys.rb: added CSSFormatter.hash_to_styles
68
+ - lib/ansisys.rb: modified SGR#css_style and Screen.css_style to
69
+ use CSSFormatter.hash_to_styles
70
+
71
+ * 2007-10-14 zunda <zunda at freeshell.org>
72
+ - lib/ansisys.rb: added code to be used as Hiki plugin
73
+ - TODO: should output css style to somewhere
74
+
75
+ * 2007-10-14 zunda <zunda at freeshell.org>
76
+ - lib/ansisys.rb: added padding: 0.5em to css_style
77
+ - spec/screen_spec.rb: refactored
78
+
79
+ * 2007-10-14 zunda <zunda at freeshell.org>
80
+ - lib/ansisys.rb: added Terminal#css_style, with renaming
81
+ default_style to css_style in the other classes
82
+ - lib/ansisys.rb: modified Cursor to work with max_row unspecified
83
+
84
+ * 2007-10-14 zunda <zunda at freeshell.org>
85
+ - spec/terminal_spec.rb: added an example to specify colors in rendering
86
+
87
+ * 2007-10-14 zunda <zunda at freeshell.org>
88
+ - spec/terminal_spec.rb: added an example on color HTML
89
+
90
+ * 2007-10-14 zunda <zunda at freeshell.org>
91
+ - spec/terminal_spec.rb: added
92
+ - lib/ansisys.rb: modified to satisfy examples in spec/terminal_spec.rb
93
+
94
+ * 2007-10-14 zunda <zunda at freeshell.org>
95
+ - spec/character_spec.rb: fixed
96
+
97
+ * 2007-10-12 zunda <zunda at freeshell.org>
98
+ - lib/ansisys.rb: removed fore/bakground colors arguments from methods for SGR
99
+ - lib/ansisys.rb: added Screen.default_css_colors
100
+ - spec/character_spec.rb: postponed some examples
101
+
102
+ * 2007-10-12 zunda <zunda at freeshell.org>
103
+ - lib/ansisys.rb: moved Screen.default_style to Screen#default_style
104
+
105
+ * 2007-10-12 zunda <zunda at freeshell.org>
106
+ - lib/ansisys.rb: implemented Screen.default_foreground/background/style
107
+
108
+ * 2007-10-12 zunda <zunda at freeshell.org>
109
+ - spec/screen_spec.rb: refactored
110
+
111
+ * 2007-10-12 zunda <zunda at freeshell.org>
112
+ - lib/ansisys.rb: modified Screen#render(:html) to surround screen with <pre>
113
+
114
+ * 2007-10-12 zunda <zunda at freeshell.org>
115
+ - spec/sgr_spec.rb: completed examples for SGR.css_style for now
116
+
117
+ * 2007-10-12 zunda <zunda at freeshell.org>
118
+ - spec/sgr_spec.rb: added examples for SGR.css_style
119
+
120
+ * 2007-10-12 zunda <zunda at freeshell.org>
121
+ - lib/ansisys.rb: implmented SGR.css_style
122
+
123
+ * 2007-10-10 zunda <zunda at freeshell.org>
124
+ - lib/ansisys.rb: implmented SGR.render
125
+
126
+ * 2007-10-10 zunda <zunda at freeshell.org>
127
+ - lib/ansisys.rb: renamed Characters#distribute to Characters#echo_on
128
+ - lib/ansisys.rb: implemented HTML escape to Screen#render
129
+ - spec/character_screen_spec.rb: added
130
+ - spec/character_spec.rb: moved some examples to character_screen_spec.rb
131
+
132
+ * 2007-10-10 zunda <zunda at freeshell.org>
133
+ - lib/ansisys.rb: implemented some methods for Screen
134
+ - spec/screen_spec.rb: added
135
+
136
+ * 2007-10-09 zunda <zunda at freeshell.org>
137
+ - Modifying APIs. Many examples in specs fail.
138
+
139
+ * 2007-10-08 zunda <zunda at freeshell.org>
140
+ - spec/lexer_spec.rb: updated nameepace of PARAMETER_AND_LETTER
141
+
142
+ * 2007-10-08 zunda <zunda at freeshell.org>
143
+ - lib/ansisys.rb: arranged sequence of classes
144
+
145
+ * 2007-10-08 zunda <zunda at freeshell.org>
146
+ - lib/ansisys.rb: implemented Cursor#advance!
147
+ - lib/ansisys.rb: implemented Character#render
148
+
149
+ * 2007-10-06 zunda <zunda at freeshell.org>
150
+ - spec/lexer_spec.rb: modified descripion of an example
151
+
152
+ * 2007-10-06 zunda <zunda at freeshell.org>
153
+ - lib/ansisys.rb: implemented Lexer
154
+ - spec/lexer_spec.rb: added
155
+ - spec/cursor_spec.rb: modified spec for over-row movements
156
+ - spec/cursor_spec.rb: fixed bug in code G
157
+
158
+ * 2007-10-06 zunda <zunda at freeshell.org>
159
+ - lib/ansisys.rb: implemented CSI_DOUBLE and CSI_SINGLE
160
+ - spec/lexer_spec.rb: added
161
+
162
+ * 2007-10-06 zunda <zunda at freeshell.org>
163
+ - lib/ansisys.rb: implemented codes H and f
164
+
165
+ * 2007-10-06 zunda <zunda at freeshell.org>
166
+ - lib/ansisys.rb: implemented codes A-G
167
+ - lib/ansisys.rb: modified argument for apply_code!
168
+
169
+ * 2007-10-06 zunda <zunda at freeshell.org>
170
+ - lib/ansisys.rb: started implementation of Cursor
171
+ - spec/cursor_spec.rb: added
172
+ - spec/sgr_spec.rb: added an exanmple when no parameter is given to SGR
173
+
174
+ * 2007-10-04 zunda <zunda at freeshell.org>
175
+ - lib/ansisys.rb: retabbed
176
+ - spec/sgr_spec.rb: implemented all examples that were in test
177
+ - test: removed
178
+
179
+ * 2007-10-03 zunda <zunda at freeshell.org>
180
+ - Makefile: fixed typo
181
+
182
+ * 2007-10-03 zunda <zunda at freeshell.org>
183
+ - setup.rb: modified to use $stdout and $stderr instead of STDOUT and STDERR
184
+
185
+ * 2007-10-03 zunda <zunda at freeshell.org>
186
+ - setup.rb: added spec task
187
+ - spec/sgr_spec.rb: added
188
+ - Makefile: added
@@ -0,0 +1,7 @@
1
+ == 0.2.0 2007-10-21
2
+ * First release from RubyForge
3
+
4
+ == 0.0.1 2007-10-16
5
+
6
+ * 1 major enhancement:
7
+ * Initial release
@@ -0,0 +1,34 @@
1
+ == Ruby-ANSI.SYS
2
+
3
+ Ruby-ANSI.SYS: a Ruby library to render texts with ANSI
4
+ sequences. Copyright (C) 2007 zunda <zunda at freeshell.org>
5
+ unless otherwise stated.
6
+
7
+ This program is free software: you can redistribute it and/or
8
+ modify it under the terms of the GNU General Public License as
9
+ published by the Free Software Foundation, either version 3 of
10
+ the License, or (at your option) any later version.
11
+
12
+ This program is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with this program. If not, see
19
+ <http://www.gnu.org/licenses/>.
20
+
21
+ == setup.rb
22
+ setup.rb: Copyright (c) 2000-2005 Minero Aoki
23
+
24
+ This program is free software. You can distribute/modify this
25
+ program under the terms of the GNU LGPL, Lesser General Public
26
+ License version 2.1.
27
+
28
+ Following modifications are applied based upon setup.rb version 3.4.1:
29
+ * 2007-10-03 zunda <zunda at freeshell.org>
30
+ * setup.rb: modified to use $stdout and $stderr instead of
31
+ STDOUT and STDERR
32
+ * 2007-10-03 zunda <zunda at freeshell.org>
33
+ * setup.rb: added spec task
34
+
@@ -0,0 +1,56 @@
1
+ #
2
+ # Makefile for ansi-sys
3
+ #
4
+
5
+ RUBY=ruby
6
+ RDOC=rdoc
7
+ SETUP=setup.rb
8
+ VERSION := $(shell ruby -Ilib -ransisys -e 'puts AnsiSys::VERSION::STRING')
9
+ PKGNAME= ansi-sys
10
+ ardir=.
11
+
12
+ # wrappers for setup.rb
13
+ .PHONY: check
14
+ check: spec
15
+
16
+ .PHONY: test
17
+ test:
18
+ $(RUBY) $(SETUP) test
19
+
20
+ .PHONY: spec
21
+ spec:
22
+ $(RUBY) $(SETUP) spec
23
+
24
+ .PHONY: install .config
25
+ install:
26
+ $(RUBY) $(SETUP) $@
27
+
28
+ .config: config
29
+ .PHONY: config
30
+ config:
31
+ $(RUBY) $(SETUP) $@
32
+
33
+ .PHONY: setup
34
+ setup:
35
+ $(RUBY) $(SETUP) $@
36
+
37
+ # commit the changes
38
+ .PHONY: commit
39
+ commit: .svn
40
+ log=`ruby -e 'print File.open("ChangeLog").read.split(/^$$/,2)[0]'`;\
41
+ ver=`echo "$$log" | ruby -ne 'print if gsub!(/^- \\((\\d+\\.\\d+\\.\\d+)\\).*/, "\\\\1")'`;\
42
+ if [ -n "$$ver" ] && [ "$$ver" != "$(VERSION)" ]; then \
43
+ echo '*** Version in ChangeLog does not match the library version';\
44
+ exit 1;\
45
+ fi && \
46
+ svn commit -m "$$log" && \
47
+ echo "$$log" &&\
48
+ if [ -n "$$ver" ]; then \
49
+ cur_repo=`svn info | grep URL: | cut -f2 -d\ `;\
50
+ tag_repo=`echo $$cur_repo | sed 's:/trunk/:/tags/:'`-$(VERSION); \
51
+ echo "Tagging to $$tag_repo"; \
52
+ svn remove -m "$$log" $$tag_repo 2>/dev/null ; \
53
+ svn cp -m "$$log" $$cur_repo $$tag_repo && \
54
+ echo Svn tag made at $$tag_repo; \
55
+ fi
56
+
@@ -0,0 +1,38 @@
1
+ ChangeLog
2
+ History.txt
3
+ License.txt
4
+ Makefile
5
+ Manifest.txt
6
+ README.txt
7
+ Rakefile
8
+ config/hoe.rb
9
+ config/requirements.rb
10
+ gpl.rd.txt
11
+ lgpl.rd.txt
12
+ lib/ansisys.rb
13
+ log/debug.log
14
+ script/destroy
15
+ script/generate
16
+ script/txt2html
17
+ setup.rb
18
+ spec/attach/test_data.html
19
+ spec/attach/test_data.txt
20
+ spec/character_screen_spec.rb
21
+ spec/character_spec.rb
22
+ spec/cursor_spec.rb
23
+ spec/hiki_spec.rb
24
+ spec/lexer_spec.rb
25
+ spec/screen_spec.rb
26
+ spec/sgr_spec.rb
27
+ spec/spec.opts
28
+ spec/spec_helper.rb
29
+ spec/terminal_spec.rb
30
+ tasks/deployment.rake
31
+ tasks/environment.rake
32
+ tasks/rspec.rake
33
+ tasks/website.rake
34
+ website/index.html
35
+ website/index.txt
36
+ website/javascripts/rounded_corners_lite.inc.js
37
+ website/stylesheets/screen.css
38
+ website/template.rhtml
@@ -0,0 +1,37 @@
1
+ = Ruby-ANSI.SYS readme
2
+ Ruby-ANSI.SYS is a Ruby library to render texts with ANSI escape
3
+ sequences. It can also be used as a plugin for Hiki.
4
+
5
+ == Installation
6
+ As a Ruby library:
7
+
8
+ $ ruby setup.rb config
9
+ $ ruby setup.rb setup
10
+ # ruby setup.rb install
11
+
12
+ As a Hiki plugin, copy the file lib/ansisys.rb into the
13
+ misc/plugin directory and configure Hiki to enable the plugin.
14
+
15
+ == Usage
16
+ As a Ruby library:
17
+
18
+ require 'ansisys'
19
+ terminal = AnsiSys::Terminal.new
20
+ terminal.echo("Hello \e[32mWorld\e[m")
21
+ terminal.render #=> HTML fragment
22
+
23
+ to show with the default ANSI colors or
24
+
25
+ terminal.render(:html, 80, nil, AnsiSys::Screen.default_css_colors(false, true))
26
+
27
+ to show with brigher colors.
28
+
29
+ As a Hiki plugin:
30
+ {{ansi_screen(attach_file_name)}}
31
+
32
+ == Specs
33
+ You can run through spec files:
34
+ $ ruby setup.rb spec -fs -c
35
+
36
+ == Copyright
37
+ Read the License.txt file.
@@ -0,0 +1,4 @@
1
+ require 'config/requirements'
2
+ require 'config/hoe' # setup Hoe + all gem configuration
3
+
4
+ Dir['tasks/**/*.rake'].each { |rake| load rake }
@@ -0,0 +1,70 @@
1
+ require 'ansisys'
2
+
3
+ AUTHOR = 'zunda' # can also be an array of Authors
4
+ EMAIL = "zunda at freeshell.org"
5
+ DESCRIPTION = "Ruby-ANSI.SYS is a library to render texts with ANSI escape sequences."
6
+ GEM_NAME = 'ansi-sys' # what ppl will type to install your gem
7
+ RUBYFORGE_PROJECT = 'ansi-sys' # The unix name for your project
8
+ HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
9
+ DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
10
+
11
+ @config_file = "~/.rubyforge/user-config.yml"
12
+ @config = nil
13
+ RUBYFORGE_USERNAME = "unknown"
14
+ def rubyforge_username
15
+ unless @config
16
+ begin
17
+ @config = YAML.load(File.read(File.expand_path(@config_file)))
18
+ rescue
19
+ puts <<-EOS
20
+ ERROR: No rubyforge config file found: #{@config_file}
21
+ Run 'rubyforge setup' to prepare your env for access to Rubyforge
22
+ - See http://newgem.rubyforge.org/rubyforge.html for more details
23
+ EOS
24
+ exit
25
+ end
26
+ end
27
+ RUBYFORGE_USERNAME.replace @config["username"]
28
+ end
29
+
30
+
31
+ REV = nil
32
+ # UNCOMMENT IF REQUIRED:
33
+ # REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
34
+ VERS = AnsiSys::VERSION::STRING + (REV ? ".#{REV}" : "")
35
+ RDOC_OPTS = ['--quiet', '--title', 'Ruby-ANSI.SYS documentation',
36
+ "--opname", "index.html",
37
+ "--line-numbers",
38
+ "--main", "README",
39
+ "--inline-source"]
40
+
41
+ class Hoe
42
+ def extra_deps
43
+ @extra_deps.reject! { |x| Array(x).first == 'hoe' }
44
+ @extra_deps
45
+ end
46
+ end
47
+
48
+ # Generate all the Rake tasks
49
+ # Run 'rake -T' to see list of generated tasks (from gem root directory)
50
+ hoe = Hoe.new(GEM_NAME, VERS) do |p|
51
+ p.author = AUTHOR
52
+ p.description = DESCRIPTION
53
+ p.email = EMAIL
54
+ p.summary = DESCRIPTION
55
+ p.url = HOMEPATH
56
+ p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
57
+ p.test_globs = ["test/**/test_*.rb"]
58
+ p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
59
+
60
+ # == Optional
61
+ p.changes = p.paragraphs_of("History.txt", 0..1).join("\\n\\n")
62
+ #p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
63
+
64
+ #p.spec_extras = {} # A hash of extra values to set in the gemspec.
65
+
66
+ end
67
+
68
+ CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
69
+ PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
70
+ hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
@@ -0,0 +1,17 @@
1
+ require 'fileutils'
2
+ include FileUtils
3
+
4
+ require 'rubygems'
5
+ %w[rake hoe newgem rubigen].each do |req_gem|
6
+ begin
7
+ require req_gem
8
+ rescue LoadError
9
+ puts "This Rakefile requires the '#{req_gem}' RubyGem."
10
+ puts "Installation: gem install #{req_gem} -y"
11
+ exit
12
+ end
13
+ end
14
+
15
+ $:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
16
+
17
+ require 'ansisys'