Permalink
Browse files

setting up jeweler

  • Loading branch information...
1 parent 09d066c commit df1e1afc879da8c80a5ca2008a43baadd68752f6 @bastien committed Apr 1, 2010
View
0 Manifest 100644 → 100755
No changes.
View
0 README.mkd 100644 → 100755
No changes.
View
0 Rakefile 100644 → 100755
No changes.
View
0 lib/zidian.rb 100644 → 100755
No changes.
View
Binary file not shown.
View
Binary file not shown.
@@ -1,5 +0,0 @@
-README.mkd
-Rakefile
-lib/cedict_ts.u8
-lib/zidian.rb
-Manifest
@@ -1,20 +0,0 @@
-Zidian
-======
-
-Zidian is a simple Chinese-English dictionary written in ruby.
-It only works under Unix systems, as it uses specific commands (sed, grep, less), at least for now.
-
-Examples of use
---------------
-
- Zidian.find(237) # returns the Word from the 237 id (line number in the file)
-
- Zidian.find("culture") # returns all the words that contain "culture"
-
- Zidian.find("文") # returns all the words that contain "文"
-
- Zidian.find([653,34]) # returns the 2 words corresponding to the given ids
-
-Author: Bastien Vaucher
-Version: 0.0.1
-Licence: MIT
View
@@ -1,14 +0,0 @@
-require 'rubygems'
-require 'rake'
-require 'echoe'
-
-Echoe.new('zidian', '0.0.1') do |p|
- p.description = "Chinese dictionary"
- p.url = "http://github.com/bastien/zidian"
- p.author = "Bastien Vaucher"
- p.email = "bastien.vaucher@gmail.com"
- p.ignore_pattern = ["tmp/*", "script/*"]
- p.development_dependencies = []
-end
-
-Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,49 +0,0 @@
-module Zidian
-
- def self.find(expression)
- $KCODE = 'UTF8'
- case expression.class.name
- when "Array"
- expression.collect{|e| find(e) }.flatten.uniq
- when "Integer", "Fixnum" then
- Word.new(get_line(expression), expression)
- when "String" then
- find_word(expression).lines.to_a.collect{|line| Word.new(line) }
- else
- raise "Invalid find parameter(#{expression.class}). Only integers, strings accepted"
- end
- end
-
- protected
-
- def self.find_word(word) #:nodoc:
- # adding the -i option allows to search independently from the case, but it makes it very slow
- `less #{File.dirname(__FILE__)}/cedict_ts.u8 | grep -n '[/\s]#{word.gsub(/\s/,"\s")}[/\s]'`
- end
-
- def self.get_line(line_number) #:nodoc:
- `sed -n '#{line_number}p' #{File.dirname(__FILE__)}/cedict_ts.u8`
- end
-
- class Word
-
- attr_reader :id, :traditional, :simplified, :pinyin, :english
-
- def initialize(line, id=nil)
- @id = id
- extract_attributes_from_string(line.strip!)
- end
-
- def extract_attributes_from_string(line)
- if line =~ /^[0-9]*:/
- @id = line.gsub!(/^[0-9]*:/).to_a.first.gsub(':','').to_i
- end
- @traditional = line.match(/^[^\s]+/)[0]
- @simplified = line.match(/\s[^\s]+/)[0].strip
- @pinyin = line.match(/\[.+?\]/)[0].gsub(/[\[\]]/,'')
- @english = line.scan(/\/[^\/]+/).collect{|e| e.gsub(/[\/]/,'')}
- end
-
- end
-
-end
@@ -1,30 +0,0 @@
-# -*- encoding: utf-8 -*-
-
-Gem::Specification.new do |s|
- s.name = %q{zidian}
- s.version = "0.0.1"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
- s.authors = ["Bastien Vaucher"]
- s.date = %q{2010-03-31}
- s.description = %q{Chinese dictionary written in ruby}
- s.email = %q{bastien.vaucher@gmail.com}
- s.extra_rdoc_files = ["lib/zidian.rb"]
- s.files = ["README.mkd", "Rakefile", "lib/cedict_ts.u8", "lib/zidian.rb", "Manifest", "zidian.gemspec"]
- s.homepage = %q{http://github.com/bastien/zidian}
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Zidian", "--main", "README.mkd"]
- s.require_paths = ["lib"]
- s.rubyforge_project = %q{zidian}
- s.rubygems_version = %q{1.3.5}
- s.summary = %q{Chinese dictionary}
-
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
-
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- else
- end
- else
- end
-end
View
@@ -1,22 +1,41 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{zidian}
s.version = "0.0.1"
- s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Bastien Vaucher"]
- s.date = %q{2010-03-31}
- s.description = %q{Chinese dictionary written in ruby}
+ s.date = %q{2010-04-01}
+ s.description = %q{Chinese dictionary using the CEDICT word list}
s.email = %q{bastien.vaucher@gmail.com}
- s.extra_rdoc_files = ["lib/zidian.rb"]
- s.files = ["README.mkd", "Rakefile", "lib/cedict_ts.u8", "lib/zidian.rb", "Manifest", "zidian.gemspec"]
+ s.extra_rdoc_files = [
+ "README.mkd"
+ ]
+ s.files = [
+ "Manifest",
+ "README.mkd",
+ "Rakefile",
+ "VERSION",
+ "doc/files/README_mkd.html",
+ "doc/files/lib/cedict_ts_u8.html",
+ "doc/rdoc-style.css",
+ "lib/cedict_ts.u8",
+ "lib/zidian.rb",
+ "test/test_zidian.rb",
+ "zidian.gemspec"
+ ]
s.homepage = %q{http://github.com/bastien/zidian}
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Zidian", "--main", "README.mkd"]
+ s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
- s.rubyforge_project = %q{zidian}
- s.rubygems_version = %q{1.3.5}
+ s.rubygems_version = %q{1.3.6}
s.summary = %q{Chinese dictionary}
+ s.test_files = [
+ "test/test_zidian.rb"
+ ]
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
@@ -28,3 +47,4 @@ Gem::Specification.new do |s|
else
end
end
+

0 comments on commit df1e1af

Please sign in to comment.