apohllo-cyc-console 0.0.2
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.
- data/README.txt +108 -0
- data/Rakefile +42 -0
- data/bin/cyc +16 -0
- data/cyc-console.gemspec +24 -0
- metadata +65 -0
data/README.txt
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
= cyc-console
|
2
|
+
|
3
|
+
* http://github.com/apohllo/cyc-colors
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Console for the Cyc ontology written in Ruby.
|
8
|
+
|
9
|
+
== FEATURES/PROBLEMS:
|
10
|
+
|
11
|
+
* support for history
|
12
|
+
* highlighting of unmatched parenthesis
|
13
|
+
* colorful prompt
|
14
|
+
* readline based editing (arrows, delete, etc. works!)
|
15
|
+
|
16
|
+
* problems with multiline commands
|
17
|
+
* messeges send to stdout are not visible
|
18
|
+
* errors are not printed - only nil is returned
|
19
|
+
|
20
|
+
== SYNOPSIS:
|
21
|
+
|
22
|
+
Cyc-console is console for the Cyc ontology written in Ruby.
|
23
|
+
It is inspired by the Ruby console - irb. The original Cyc console
|
24
|
+
has many limitations. There is no support for readline, which
|
25
|
+
means that arrow keys doesn't work as expected. There is also
|
26
|
+
no auto-completion, no history, etc. This console aims at overcomming
|
27
|
+
these limitations.
|
28
|
+
|
29
|
+
== INSTALL:
|
30
|
+
|
31
|
+
You need RubyGems v. 1.2
|
32
|
+
|
33
|
+
* gem -v
|
34
|
+
* 1.2.0 #=> ok
|
35
|
+
|
36
|
+
You need the github.com repository to be added to your sources list:
|
37
|
+
|
38
|
+
* gem sources -a http://gems.github.com
|
39
|
+
|
40
|
+
Then you can type:
|
41
|
+
|
42
|
+
* sudo gem install apohllo-cyc-console
|
43
|
+
|
44
|
+
== BASIC USAGE:
|
45
|
+
|
46
|
+
The gem comes with +cyc+ command, so you can simply type:
|
47
|
+
|
48
|
+
$ cyc
|
49
|
+
cyc@localhost:3601>
|
50
|
+
|
51
|
+
By defualt the console connects with Cyc on the localhost on the default port 3601.
|
52
|
+
You can change it, by providing the name of the host, and the port as parameters:
|
53
|
+
|
54
|
+
$ cyc www.example.com 4567
|
55
|
+
cyc@www.example.com:4567>
|
56
|
+
|
57
|
+
The console works like regular Cyc console (however, see problems above):
|
58
|
+
|
59
|
+
cyc@localhost:3601>(genl? #$Cat #$Animal)
|
60
|
+
T
|
61
|
+
cyc@localhost:3601>
|
62
|
+
|
63
|
+
If you run the console once again, you will have access to previous commands.
|
64
|
+
The history is kept ~/.cyc_history and remembers 1000 commands by default.
|
65
|
+
You can change these, by providing CYC_HISTORY_FILE and CYC_HISTORY_SIZE
|
66
|
+
environment varibles respectively.
|
67
|
+
|
68
|
+
One helpful features is to brows the history by providing the beginning of the command.
|
69
|
+
If you type:
|
70
|
+
|
71
|
+
cyc@localhost:3601>(genl?<PG-UP>
|
72
|
+
|
73
|
+
you'll get the latest command which has the same form:
|
74
|
+
|
75
|
+
cyc@localhost:3601>(genl? #$Cat #$Animal)
|
76
|
+
|
77
|
+
This really speeds-up working with the console.
|
78
|
+
|
79
|
+
|
80
|
+
== LICENSE:
|
81
|
+
|
82
|
+
(The MIT License)
|
83
|
+
|
84
|
+
Copyright (c) 2009 Aleksander Pohl
|
85
|
+
|
86
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
87
|
+
a copy of this software and associated documentation files (the
|
88
|
+
'Software'), to deal in the Software without restriction, including
|
89
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
90
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
91
|
+
permit persons to whom the Software is furnished to do so, subject to
|
92
|
+
the following conditions:
|
93
|
+
|
94
|
+
The above copyright notice and this permission notice shall be
|
95
|
+
included in all copies or substantial portions of the Software.
|
96
|
+
|
97
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
98
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
99
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
100
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
101
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
102
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
103
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
104
|
+
|
105
|
+
== FEEDBACK
|
106
|
+
|
107
|
+
* mailto:apohllo@o2.pl
|
108
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
task :default => [:test]
|
2
|
+
|
3
|
+
$gem_name = "cyc-console"
|
4
|
+
|
5
|
+
desc "Test the library"
|
6
|
+
task :test do
|
7
|
+
ruby Dir.glob("test/*")
|
8
|
+
end
|
9
|
+
|
10
|
+
desc "Run specs"
|
11
|
+
task :spec do
|
12
|
+
sh "spec spec/* --format specdoc --color"
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "Run features"
|
16
|
+
task :features do
|
17
|
+
sh "features features/* "
|
18
|
+
end
|
19
|
+
|
20
|
+
desc "Build the gem"
|
21
|
+
task :build do
|
22
|
+
sh "gem build #$gem_name.gemspec"
|
23
|
+
end
|
24
|
+
|
25
|
+
desc "Install the library at local machnie"
|
26
|
+
task :install => :build do
|
27
|
+
sh "sudo gem install #$gem_name -l"
|
28
|
+
end
|
29
|
+
|
30
|
+
desc "Uninstall the library from local machnie"
|
31
|
+
task :uninstall do
|
32
|
+
sh "sudo gem uninstall #$gem_name"
|
33
|
+
end
|
34
|
+
|
35
|
+
desc "Reinstall the library in the local machine"
|
36
|
+
task :reinstall => [:uninstall, :install] do
|
37
|
+
end
|
38
|
+
|
39
|
+
desc "Clean"
|
40
|
+
task :clean do
|
41
|
+
sh "rm #$gem_name*.gem"
|
42
|
+
end
|
data/bin/cyc
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
# encoding: utf-8
|
3
|
+
require 'readline'
|
4
|
+
require 'cyc/console'
|
5
|
+
|
6
|
+
if Readline.respond_to?("basic_word_break_characters=")
|
7
|
+
Readline.basic_word_break_characters= " \t\n\"\\'`><=;|&{("
|
8
|
+
end
|
9
|
+
Readline.completion_append_character = nil
|
10
|
+
Readline.completion_proc = Cyc::Console::CompletionProc
|
11
|
+
|
12
|
+
host = ARGV[0] || "localhost"
|
13
|
+
port = ARGV[1] || 3601
|
14
|
+
console = Cyc::Console.new(host,port)
|
15
|
+
console.main_loop
|
16
|
+
|
data/cyc-console.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "cyc-console"
|
3
|
+
s.version = "0.0.2"
|
4
|
+
s.date = "2009-07-15"
|
5
|
+
s.summary = "Ruby console for the Cyc ontology"
|
6
|
+
s.email = "apohllo@o2.pl"
|
7
|
+
s.homepage = "http://apohllo.pl"
|
8
|
+
s.description = "Ruby console for the Cyc ontology"
|
9
|
+
s.authors = ['Aleksander Pohl']
|
10
|
+
# the lib path is added to the LOAD_PATH
|
11
|
+
s.require_path = "lib"
|
12
|
+
# include Rakefile, gemspec, README and all the source files
|
13
|
+
s.files = ["Rakefile", "cyc-console.gemspec", "README.txt"] +
|
14
|
+
Dir.glob("lib/**/*")
|
15
|
+
# include tests and specs
|
16
|
+
s.test_files = Dir.glob("{test,spect,features}/**/*")
|
17
|
+
# include README while generating rdoc
|
18
|
+
s.rdoc_options = ["--main", "README.txt"]
|
19
|
+
s.has_rdoc = true
|
20
|
+
s.extra_rdoc_files = ["README.txt"]
|
21
|
+
s.executables = ['cyc']
|
22
|
+
s.add_dependency("apohllo-colors", [">= 0.0.4"])
|
23
|
+
end
|
24
|
+
|
metadata
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: apohllo-cyc-console
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Aleksander Pohl
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-07-15 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: apohllo-colors
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.4
|
24
|
+
version:
|
25
|
+
description: Ruby console for the Cyc ontology
|
26
|
+
email: apohllo@o2.pl
|
27
|
+
executables:
|
28
|
+
- cyc
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files:
|
32
|
+
- README.txt
|
33
|
+
files:
|
34
|
+
- Rakefile
|
35
|
+
- cyc-console.gemspec
|
36
|
+
- README.txt
|
37
|
+
has_rdoc: true
|
38
|
+
homepage: http://apohllo.pl
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options:
|
41
|
+
- --main
|
42
|
+
- README.txt
|
43
|
+
require_paths:
|
44
|
+
- lib
|
45
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: "0"
|
50
|
+
version:
|
51
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: "0"
|
56
|
+
version:
|
57
|
+
requirements: []
|
58
|
+
|
59
|
+
rubyforge_project:
|
60
|
+
rubygems_version: 1.2.0
|
61
|
+
signing_key:
|
62
|
+
specification_version: 2
|
63
|
+
summary: Ruby console for the Cyc ontology
|
64
|
+
test_files: []
|
65
|
+
|