db2c 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (9) hide show
  1. data/LICENSE +12 -0
  2. data/README.md +50 -0
  3. data/Rakefile +21 -0
  4. data/bin/ac +0 -0
  5. data/bin/db2c +35 -0
  6. data/man/db2c.1 +69 -0
  7. data/man/db2c.1.html +150 -0
  8. data/man/db2c.1.ronn +64 -0
  9. metadata +53 -0
data/LICENSE ADDED
@@ -0,0 +1,12 @@
1
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2
+
3
+ Copyleft 2011 Samer Abukhait <samer@abukhaitNOSPAM.com>
4
+
5
+ Everyone is permitted to copy and distribute verbatim or modified
6
+ copies of this license document, and changing it is allowed as long
7
+ as the name is changed.
8
+
9
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
10
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
11
+
12
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
data/README.md ADDED
@@ -0,0 +1,50 @@
1
+ a db2 console with with history and autocomplete support
2
+ ====================================
3
+
4
+ DB2 console mode does not support readline and autocomplete, this is a wrapper for the db2 command with support for both.
5
+
6
+ Install
7
+ -------
8
+
9
+ $ apt-get install [rlwrap][0]
10
+ $ gem install db2c
11
+
12
+ Configuration
13
+ -------------
14
+
15
+ `DB2C_PROMPT`:
16
+ the prompt to display before each line of input. defaults to db2 =>
17
+
18
+ ContributingV
19
+ ------------
20
+
21
+ Once you've made your great commits:
22
+
23
+ 1. [Fork][1] db2c
24
+ 2. Create a topic branch - `git checkout -b my_branch`
25
+ 3. Push to your branch - `git push origin my_branch`
26
+ 4. Create an [Issue][2] with a link to your branch
27
+ 5. That's it!
28
+
29
+ Acknowledgement
30
+ ------------
31
+
32
+ The initial script was inspired by [defunkt's repl][3], for a genenral purpose repl/wrapper, this is your friend.
33
+
34
+ Meta
35
+ ----
36
+
37
+ * Code: `git clone git://github.com/on-site/db2c.git`
38
+ * Home: <https://github.com/on-site/db2c>
39
+ * Bugs: <https://github.com/on-site/db2c/issues>
40
+ * Gems: <http://rubygems.org/gems/db2c>
41
+
42
+ Author
43
+ ------
44
+
45
+ Samer Abukhait <samer@on-siteNOSPAM.com>, @s4mer
46
+
47
+ [0]: http://utopia.knoware.nl/~hlub/rlwrap/
48
+ [1]: http://help.github.com/forking/
49
+ [2]: https://github.com/on-site/db2c/issues
50
+ [3]: https://github.com/defunkt/repl
data/Rakefile ADDED
@@ -0,0 +1,21 @@
1
+ $LOAD_PATH.unshift 'lib'
2
+ require "db2c/version"
3
+
4
+ def version
5
+ Db2c::VERSION
6
+ end
7
+
8
+ def git(command)
9
+ system("git #{command}")
10
+ end
11
+
12
+ desc "Push new version"
13
+ task :publish do
14
+ git "tag v#{version}"
15
+ git "push origin v#{version}"
16
+ git "push origin master"
17
+ git "push origin master:latest"
18
+ sh "gem build db2c.gemspec"
19
+ sh "gem push db2c-#{version}.gem"
20
+ git "clean -fd"
21
+ end
data/bin/ac ADDED
File without changes
data/bin/db2c ADDED
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ if !system("which db2 > /dev/null 2> /dev/null")
4
+ puts "The db2 command was not found!"
5
+ exit
6
+ end
7
+
8
+ if !system("which rlwrap > /dev/null 2> /dev/null")
9
+ puts "This program depends on rlwrap, install rlwrap"
10
+ exit
11
+ end
12
+
13
+ def show_help
14
+ puts <<-help
15
+ Usage: db2c
16
+
17
+ Options:
18
+ --help Display this message
19
+ --man Display the man page
20
+
21
+ Bug reports, suggestions, updates: http://github.com/on-site/db2c
22
+ help
23
+ exit
24
+ end
25
+
26
+ if ARGV.any? { |arg| %w( -h --help -help help ).include?(arg) }
27
+ show_help
28
+ end
29
+
30
+ cdir = File.dirname(__FILE__)
31
+ if ARGV.include? '--man'
32
+ exec "man #{cdir}/../man/db2c.1"
33
+ end
34
+
35
+ exec "rlwrap -A -pblue -f #{cdir}/ac -H ~/.db2c_history db2 #{ARGV.join(' ')}"
data/man/db2c.1 ADDED
@@ -0,0 +1,69 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "DB2C" "1" "November 2011" "" ""
5
+ .
6
+ .SH "NAME"
7
+ \fBdb2c\fR \- a db2 console with with history and autocomplete support
8
+ .
9
+ .SH "SYNOPSIS"
10
+ \fBdb2c\fR \fI\fIoptions\fR\fR <\.\.\.>
11
+ .
12
+ .SH "DESCRIPTION"
13
+ DB2 console mode does not support readline and autocomplete, this is a wrapper for the db2 command with support for both\.
14
+ .
15
+ .SH "EXAMPLES"
16
+ .
17
+ .nf
18
+
19
+ $ db2c
20
+ db2 => connect to testdb
21
+
22
+ Database Connection Information
23
+
24
+ Database server = DB2/LINUXX8664 9\.7\.4
25
+ SQL authorization ID = SAMER
26
+ Local database alias = TESTDB
27
+
28
+ >> ? sql\-107
29
+
30
+
31
+ SQL0107N The name "<name>" is too long\. The maximum length is
32
+ "<length>"\.
33
+ \.\. etc \.\.
34
+
35
+ >> values current date
36
+
37
+ 1
38
+ \-\-\-\-\-\-\-\-\-\-
39
+ 11/17/2011
40
+
41
+ 1 record(s) selected\.
42
+
43
+ \.\. etc \.\.
44
+ .
45
+ .fi
46
+ .
47
+ .SH "OPTIONS"
48
+ .
49
+ .TP
50
+ \fB\-h\fR, \fB\-\-help\fR
51
+ Displays usage information\.
52
+ .
53
+ .TP
54
+ \fB\-\-man\fR
55
+ Displays this man page\.
56
+ .
57
+ .SH "ENVIRONMENT"
58
+ .
59
+ .SS "DB2_PROMPT"
60
+ the prompt to display before each line of input\. defaults to db2 =>
61
+ .
62
+ .SH "BUGS"
63
+ \fIhttp://github\.com/on\-site/db2c/issues\fR
64
+ .
65
+ .SH "AUTHOR"
66
+ Samer Abukhait \fIsamer@on\-siteNOSPAM\.com\fR, @s4mer
67
+ .
68
+ .SH "SEE ALSO"
69
+ rlwrap(1), readline(3)
data/man/db2c.1.html ADDED
@@ -0,0 +1,150 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
5
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
6
+ <title>db2c(1) - a db2 console with with history and autocomplete support</title>
7
+ <style type='text/css' media='all'>
8
+ /* style: man */
9
+ body#manpage {margin:0}
10
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
11
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
12
+ .mp h2 {margin:10px 0 0 0}
13
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
14
+ .mp h3 {margin:0 0 0 4ex}
15
+ .mp dt {margin:0;clear:left}
16
+ .mp dt.flush {float:left;width:8ex}
17
+ .mp dd {margin:0 0 0 9ex}
18
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
19
+ .mp pre {margin-bottom:20px}
20
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
21
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
22
+ .mp img {display:block;margin:auto}
23
+ .mp h1.man-title {display:none}
24
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
25
+ .mp h2 {font-size:16px;line-height:1.25}
26
+ .mp h1 {font-size:20px;line-height:2}
27
+ .mp {text-align:justify;background:#fff}
28
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
29
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
30
+ .mp u {text-decoration:underline}
31
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
32
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
33
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
34
+ .mp b.man-ref {font-weight:normal;color:#434241}
35
+ .mp pre {padding:0 4ex}
36
+ .mp pre code {font-weight:normal;color:#434241}
37
+ .mp h2+pre,h3+pre {padding-left:0}
38
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
39
+ ol.man-decor {width:100%}
40
+ ol.man-decor li.tl {text-align:left}
41
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
42
+ ol.man-decor li.tr {text-align:right;float:right}
43
+ </style>
44
+ </head>
45
+ <!--
46
+ The following styles are deprecated and will be removed at some point:
47
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
48
+
49
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
50
+ .man-navigation should be used instead.
51
+ -->
52
+ <body id='manpage'>
53
+ <div class='mp' id='man'>
54
+
55
+ <div class='man-navigation' style='display:none'>
56
+ <a href="#NAME">NAME</a>
57
+ <a href="#SYNOPSIS">SYNOPSIS</a>
58
+ <a href="#DESCRIPTION">DESCRIPTION</a>
59
+ <a href="#EXAMPLES">EXAMPLES</a>
60
+ <a href="#OPTIONS">OPTIONS</a>
61
+ <a href="#ENVIRONMENT">ENVIRONMENT</a>
62
+ <a href="#BUGS">BUGS</a>
63
+ <a href="#AUTHOR">AUTHOR</a>
64
+ <a href="#SEE-ALSO">SEE ALSO</a>
65
+ </div>
66
+
67
+ <ol class='man-decor man-head man head'>
68
+ <li class='tl'>db2c(1)</li>
69
+ <li class='tc'></li>
70
+ <li class='tr'>db2c(1)</li>
71
+ </ol>
72
+
73
+ <h2 id="NAME">NAME</h2>
74
+ <p class="man-name">
75
+ <code>db2c</code> - <span class="man-whatis">a db2 console with with history and autocomplete support</span>
76
+ </p>
77
+
78
+ <h2 id="SYNOPSIS">SYNOPSIS</h2>
79
+
80
+ <p><code>db2c</code> <var><a href="#OPTIONS" title="OPTIONS" data-bare-link="true">options</a></var> &lt;...></p>
81
+
82
+ <h2 id="DESCRIPTION">DESCRIPTION</h2>
83
+
84
+ <p>DB2 console mode does not support readline and autocomplete, this is a wrapper for the db2 command with support for both.</p>
85
+
86
+ <h2 id="EXAMPLES">EXAMPLES</h2>
87
+
88
+ <pre><code>$ db2c
89
+ db2 =&gt; connect to testdb
90
+
91
+ Database Connection Information
92
+
93
+ Database server = DB2/LINUXX8664 9.7.4
94
+ SQL authorization ID = SAMER
95
+ Local database alias = TESTDB
96
+
97
+ &gt;&gt; ? sql-107
98
+
99
+
100
+ SQL0107N The name "&lt;name>" is too long. The maximum length is
101
+ "&lt;length>".
102
+ .. etc ..
103
+
104
+ &gt;&gt; values current date
105
+
106
+ 1
107
+ ----------
108
+ 11/17/2011
109
+
110
+ 1 record(s) selected.
111
+
112
+ .. etc ..
113
+ </code></pre>
114
+
115
+ <h2 id="OPTIONS">OPTIONS</h2>
116
+
117
+ <dl>
118
+ <dt><code>-h</code>, <code>--help</code></dt><dd><p>Displays usage information.</p></dd>
119
+ <dt class="flush"><code>--man</code></dt><dd><p>Displays this man page.</p></dd>
120
+ </dl>
121
+
122
+
123
+ <h2 id="ENVIRONMENT">ENVIRONMENT</h2>
124
+
125
+ <h3 id="DB2_PROMPT">DB2_PROMPT</h3>
126
+
127
+ <p>the prompt to display before each line of input. defaults to db2 =></p>
128
+
129
+ <h2 id="BUGS">BUGS</h2>
130
+
131
+ <p><a href="http://github.com/on-site/db2c/issues" data-bare-link="true">http://github.com/on-site/db2c/issues</a></p>
132
+
133
+ <h2 id="AUTHOR">AUTHOR</h2>
134
+
135
+ <p>Samer Abukhait <a href="&#x6d;&#97;&#105;&#x6c;&#x74;&#111;&#58;&#x73;&#x61;&#109;&#101;&#114;&#x40;&#x6f;&#110;&#x2d;&#x73;&#x69;&#x74;&#101;&#x4e;&#79;&#83;&#x50;&#x41;&#x4d;&#x2e;&#99;&#x6f;&#109;" data-bare-link="true">&#x73;&#97;&#x6d;&#x65;&#x72;&#64;&#111;&#x6e;&#x2d;&#x73;&#105;&#x74;&#101;&#x4e;&#79;&#83;&#80;&#x41;&#x4d;&#x2e;&#99;&#x6f;&#109;</a>, @s4mer</p>
136
+
137
+ <h2 id="SEE-ALSO">SEE ALSO</h2>
138
+
139
+ <p><span class="man-ref">rlwrap<span class="s">(1)</span></span>, <span class="man-ref">readline<span class="s">(3)</span></span></p>
140
+
141
+
142
+ <ol class='man-decor man-foot man foot'>
143
+ <li class='tl'></li>
144
+ <li class='tc'>November 2011</li>
145
+ <li class='tr'>db2c(1)</li>
146
+ </ol>
147
+
148
+ </div>
149
+ </body>
150
+ </html>
data/man/db2c.1.ronn ADDED
@@ -0,0 +1,64 @@
1
+ db2c(1) - a db2 console with with history and autocomplete support
2
+ ===================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `db2c` <[options]> <...>
7
+
8
+ ## DESCRIPTION
9
+
10
+ DB2 console mode does not support readline and autocomplete, this is a wrapper for the db2 command with support for both.
11
+
12
+ ## EXAMPLES
13
+
14
+ $ db2c
15
+ db2 => connect to testdb
16
+
17
+ Database Connection Information
18
+
19
+ Database server = DB2/LINUXX8664 9.7.4
20
+ SQL authorization ID = SAMER
21
+ Local database alias = TESTDB
22
+
23
+ >> ? sql-107
24
+
25
+
26
+ SQL0107N The name "<name>" is too long. The maximum length is
27
+ "<length>".
28
+ .. etc ..
29
+
30
+ >> values current date
31
+
32
+ 1
33
+ ----------
34
+ 11/17/2011
35
+
36
+ 1 record(s) selected.
37
+
38
+ .. etc ..
39
+
40
+ ## OPTIONS
41
+
42
+ * `-h`, `--help`:
43
+ Displays usage information.
44
+
45
+ * `--man`:
46
+ Displays this man page.
47
+
48
+ ## ENVIRONMENT
49
+
50
+ ### DB2_PROMPT
51
+
52
+ the prompt to display before each line of input. defaults to db2 =>
53
+
54
+ ## BUGS
55
+
56
+ <http://github.com/on-site/db2c/issues>
57
+
58
+ ## AUTHOR
59
+
60
+ Samer Abukhait <samer@on-siteNOSPAM.com>, @s4mer
61
+
62
+ ## SEE ALSO
63
+
64
+ rlwrap(1), readline(3)
metadata ADDED
@@ -0,0 +1,53 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: db2c
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Samer Abukhait
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-11-17 00:00:00.000000000Z
13
+ dependencies: []
14
+ description: a db2 console with with history and autocomplete support
15
+ email: samer@on-siteNOSPAM.com
16
+ executables:
17
+ - db2c
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - README.md
22
+ - Rakefile
23
+ - LICENSE
24
+ - bin/ac
25
+ - bin/db2c
26
+ - man/db2c.1.html
27
+ - man/db2c.1
28
+ - man/db2c.1.ronn
29
+ homepage: http://github.com/on-site/db2c
30
+ licenses: []
31
+ post_install_message:
32
+ rdoc_options: []
33
+ require_paths:
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ requirements: []
48
+ rubyforge_project:
49
+ rubygems_version: 1.8.10
50
+ signing_key:
51
+ specification_version: 3
52
+ summary: a db2 console with with history and autocomplete support
53
+ test_files: []