tess 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.
data/.gitignore ADDED
File without changes
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in tess.gemspec
4
+ gemspec
5
+
6
+ gem "nokogiri"
data/Gemfile.lock ADDED
@@ -0,0 +1,16 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ tess (0.0.1)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ nokogiri (1.4.4.1-x86-mingw32)
10
+
11
+ PLATFORMS
12
+ x86-mingw32
13
+
14
+ DEPENDENCIES
15
+ nokogiri
16
+ tess!
data/README.textile ADDED
@@ -0,0 +1 @@
1
+ h1. Tess.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
data/bin/tess ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env ruby
2
+ require "tess"
3
+ require "optparse"
4
+
5
+ runner = Tess::Runner.new
6
+
7
+ OptionParser.new do |op|
8
+ op.banner = 'Usage: tess.rb "word" [options], default is -d -s'
9
+ op.on("-s", "--synonym", "Show synonyms") do
10
+ runner.opts[:synonym] = true
11
+ runner.opts[:dict] = false if runner.opts[:dict].nil?
12
+ end
13
+ op.on("-d", "--dict", "Show dictionary entry") do
14
+ runner.opts[:dict] = true
15
+ runner.opts[:synonym] = false if runner.opts[:synonym].nil?
16
+ end
17
+ op.on("-i", "--help", "Show help") do
18
+ puts op
19
+ exit
20
+ end
21
+ end.parse!
22
+ runner.run! ARGV[0]
@@ -0,0 +1,16 @@
1
+ module Tess
2
+ class Runner
3
+ attr_accessor :opts
4
+ def initialize
5
+ @opts = {}
6
+ end
7
+
8
+ def run!(word)
9
+ #word = gesucht
10
+ puts Tess::Servant.fetch_dict(word) if @opts[:dict].nil? or
11
+ @opts[:dict]
12
+ puts Tess::Servant.fetch_synonym(word) if @opts[:synonym].nil? or
13
+ @opts[:synonym]
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ require "nokogiri"
2
+
3
+ module Tess
4
+ class Servant
5
+ def self.fetch_synonym(word)
6
+ #returns synonyms for word
7
+ "synonyms"
8
+ end
9
+
10
+ def self.fetch_dict(word)
11
+ #returns dictionary entry for word
12
+ "dictionary"
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,3 @@
1
+ module Tess
2
+ VERSION = "0.0.1"
3
+ end
data/lib/tess.rb ADDED
@@ -0,0 +1,2 @@
1
+ require "tess/runner"
2
+ require "tess/servant"
data/tess.gemspec ADDED
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "tess/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "tess"
7
+ s.version = Tess::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["nuttendorfer"]
10
+ s.email = ["bschwrz@gmail.com"]
11
+ s.homepage = "http://github.com/nuttendorfer/tess"
12
+ s.summary = %q{Summary}
13
+ s.description = %q{Description}
14
+
15
+ s.rubyforge_project = "tess"
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
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tess
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - nuttendorfer
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-12-23 00:00:00 +01:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description: Description
22
+ email:
23
+ - bschwrz@gmail.com
24
+ executables:
25
+ - tess
26
+ extensions: []
27
+
28
+ extra_rdoc_files: []
29
+
30
+ files:
31
+ - .gitignore
32
+ - Gemfile
33
+ - Gemfile.lock
34
+ - README.textile
35
+ - Rakefile
36
+ - bin/tess
37
+ - lib/tess.rb
38
+ - lib/tess/runner.rb
39
+ - lib/tess/servant.rb
40
+ - lib/tess/version.rb
41
+ - tess-0.0.1.gem
42
+ - tess.gemspec
43
+ has_rdoc: true
44
+ homepage: http://github.com/nuttendorfer/tess
45
+ licenses: []
46
+
47
+ post_install_message:
48
+ rdoc_options: []
49
+
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ segments:
58
+ - 0
59
+ version: "0"
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ segments:
66
+ - 0
67
+ version: "0"
68
+ requirements: []
69
+
70
+ rubyforge_project: tess
71
+ rubygems_version: 1.3.7
72
+ signing_key:
73
+ specification_version: 3
74
+ summary: Summary
75
+ test_files: []
76
+