cursesx 001

Sign up to get free protection for your applications and to get access to all the features.
Files changed (7) hide show
  1. data/.gemified +9 -0
  2. data/History.txt +4 -0
  3. data/License.txt +56 -0
  4. data/README.txt +19 -0
  5. data/Rakefile +7 -0
  6. data/lib/cursesx.rb +87 -0
  7. metadata +58 -0
data/.gemified ADDED
@@ -0,0 +1,9 @@
1
+ ---
2
+ :summary: cursesx is an useful extension of standard curses.rb.
3
+ :email: keita.yamaguchi@gmail.com
4
+ :has_rdoc: true
5
+ :name: cursesx
6
+ :homepage: http://rubyforge.org/projects/cursesx/
7
+ :version: "001"
8
+ :rubyforge_project: cursesx
9
+ :author: Keita Yamaguchi
data/History.txt ADDED
@@ -0,0 +1,4 @@
1
+ = 001: 2008-04-16
2
+
3
+ * Keita Yamaguchi:
4
+ * Initial release
data/License.txt ADDED
@@ -0,0 +1,56 @@
1
+ CursesX is copyrighted free software by Keita Yamaguchi <keita.yamaguchi@gmail.com>.
2
+ You can redistribute it and/or modify it under either the terms of the GPL
3
+ (see the file GPL), or the conditions below:
4
+
5
+ 1. You may make and give away verbatim copies of the source form of the
6
+ software without restriction, provided that you duplicate all of the
7
+ original copyright notices and associated disclaimers.
8
+
9
+ 2. You may modify your copy of the software in any way, provided that
10
+ you do at least ONE of the following:
11
+
12
+ a) place your modifications in the Public Domain or otherwise
13
+ make them Freely Available, such as by posting said
14
+ modifications to Usenet or an equivalent medium, or by allowing
15
+ the author to include your modifications in the software.
16
+
17
+ b) use the modified software only within your corporation or
18
+ organization.
19
+
20
+ c) give non-standard binaries non-standard names, with
21
+ instructions on where to get the original software distribution.
22
+
23
+ d) make other distribution arrangements with the author.
24
+
25
+ 3. You may distribute the software in object code or binary form,
26
+ provided that you do at least ONE of the following:
27
+
28
+ a) distribute the binaries and library files of the software,
29
+ together with instructions (in the manual page or equivalent)
30
+ on where to get the original distribution.
31
+
32
+ b) accompany the distribution with the machine-readable source of
33
+ the software.
34
+
35
+ c) give non-standard binaries non-standard names, with
36
+ instructions on where to get the original software distribution.
37
+
38
+ d) make other distribution arrangements with the author.
39
+
40
+ 4. You may modify and include the part of the software into any other
41
+ software (possibly commercial). But some files in the distribution
42
+ are not written by the author, so that they are not under these terms.
43
+
44
+ For the list of those files and their copying conditions, see the
45
+ file LEGAL.
46
+
47
+ 5. The scripts and library files supplied as input to or produced as
48
+ output from the software do not automatically fall under the
49
+ copyright of the software, but belong to whomever generated them,
50
+ and may be sold commercially, and may be aggregated with this
51
+ software.
52
+
53
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
54
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
55
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
56
+ PURPOSE.
data/README.txt ADDED
@@ -0,0 +1,19 @@
1
+ = CursesX
2
+
3
+ Author:: Keita Yamaguchi(山口 慶太) <keita.yamaguchi@gmail.com>
4
+ Copyright:: © Keita Yamaguchi, 2007-2008. All rights reserved.
5
+ License:: Ruby License
6
+
7
+ CursesX is an useful extension for standard curses.rb.
8
+
9
+ == Usage
10
+
11
+ See {the document}[http://github.com/keita/cursesx/wikis].
12
+
13
+ == Links
14
+
15
+ * ruby-linux-smaps
16
+ * {RubyForge}[http://rubyforge.org/projects/cursesx/]
17
+ * {GitHub}[http://github.com/keita/cursesx/tree/master]
18
+ * author's blog(written in Japanese)
19
+ * {¬¬日常日記}[http://d.hatena.ne.jp/keita_yamaguchi/]
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), "lib")
2
+
3
+ require "rubygems"
4
+ require "cursesx"
5
+ require "rtask"
6
+
7
+ RTask.new(:use => :all, :version => CursesX::VERSION)
data/lib/cursesx.rb ADDED
@@ -0,0 +1,87 @@
1
+ require "curses"
2
+
3
+ module CursesX
4
+ VERSION = "001"
5
+ end
6
+
7
+ module Curses
8
+ alias :standout_orig :standout
9
+ alias :standend_orig :standend
10
+
11
+ def standout
12
+ if block_given?
13
+ standout_orig
14
+ yield
15
+ standend_orig
16
+ else
17
+ standout_orig
18
+ end
19
+ end
20
+
21
+ def standend
22
+ if block_given?
23
+ standend_orig
24
+ yield
25
+ standout_orig
26
+ else
27
+ standend_orig
28
+ end
29
+ end
30
+
31
+ alias :echo_orig :echo
32
+ alias :noecho_orig :noecho
33
+
34
+ def echo
35
+ if block_given?
36
+ echo_orig
37
+ yield
38
+ noecho_orig
39
+ else
40
+ echo_orig
41
+ end
42
+ end
43
+
44
+ def noecho
45
+ if block_given?
46
+ noecho_orig
47
+ yield
48
+ echo_orig
49
+ else
50
+ noecho_orig
51
+ end
52
+ end
53
+
54
+ class Window
55
+ attr_reader :children
56
+
57
+ alias :subwin_orig :subwin
58
+ def subwin(height, width, y, x)
59
+ @children || = []
60
+ @children << subwin_orig(height, width, y, x)
61
+ return @children.last
62
+ end
63
+
64
+ alias :standout_orig :standout
65
+ alias :standend_orig :standend
66
+
67
+ def standout
68
+ if block_given?
69
+ standout_orig
70
+ yield
71
+ standend_orig
72
+ else
73
+ standout_orig
74
+ end
75
+ end
76
+
77
+ def standend
78
+ if block_given?
79
+ standend_orig
80
+ yield
81
+ standout_orig
82
+ else
83
+ standend_orig
84
+ end
85
+ end
86
+ end
87
+ end
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cursesx
3
+ version: !ruby/object:Gem::Version
4
+ version: "001"
5
+ platform: ruby
6
+ authors:
7
+ - Keita Yamaguchi
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-04-16 00:00:00 +09:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description:
17
+ email: keita.yamaguchi@gmail.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - .gemified
26
+ - History.txt
27
+ - License.txt
28
+ - README.txt
29
+ - Rakefile
30
+ - lib/cursesx.rb
31
+ has_rdoc: true
32
+ homepage: http://rubyforge.org/projects/cursesx/
33
+ post_install_message:
34
+ rdoc_options: []
35
+
36
+ require_paths:
37
+ - lib
38
+ required_ruby_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: "0"
43
+ version:
44
+ required_rubygems_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: "0"
49
+ version:
50
+ requirements: []
51
+
52
+ rubyforge_project: cursesx
53
+ rubygems_version: 1.1.1
54
+ signing_key:
55
+ specification_version: 2
56
+ summary: cursesx is an useful extension of standard curses.rb.
57
+ test_files: []
58
+