Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

init commit

  • Loading branch information...
commit eb90c67da903884ed39f31d8d329a5aacbfb0444 0 parents
@siuying authored
5 Manifest
@@ -0,0 +1,5 @@
+README.rdoc
+Rakefile
+bin/moretext
+lib/moretext.rb
+Manifest
0  README.rdoc
No changes.
14 Rakefile
@@ -0,0 +1,14 @@
+require 'rubygems'
+require 'rake'
+require 'echoe'
+
+Echoe.new('moretext', '0.1.0') do |p|
+ p.description = "Generate random chinese text"
+ p.url = "http://github.com/siuying/ruby-moretext"
+ p.author = "Francis Chong"
+ p.email = "francis@ignition.hk"
+ p.ignore_pattern = ["tmp/*", "script/*"]
+ p.development_dependencies = []
+end
+
+Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
6 bin/moretext
@@ -0,0 +1,6 @@
+require 'rubygems'
+require 'moretext'
+
+number = ARGV[0].nil? ? 1 : ARGV[0].to_i
+
+puts MoreText.sentenses(number)
13 lib/moretext.rb
@@ -0,0 +1,13 @@
+require 'open-uri'
+require 'json'
+
+module MoreText
+ def self.sentenses(number=1)
+ return JSON(open("http://more.handlino.com/sentences.json?n=#{number}").read)["sentences"]
+ end
+end
+
+# Shorthands
+def MoreText(number)
+ MoreText.sentenses(number)
+end
32 moretext.gemspec
@@ -0,0 +1,32 @@
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{moretext}
+ s.version = "0.1.0"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Francis Chong"]
+ s.date = %q{2010-05-14}
+ s.default_executable = %q{moretext}
+ s.description = %q{Generate random chinese text}
+ s.email = %q{francis@ignition.hk}
+ s.executables = ["moretext"]
+ s.extra_rdoc_files = ["README.rdoc", "bin/moretext", "lib/moretext.rb"]
+ s.files = ["README.rdoc", "Rakefile", "bin/moretext", "lib/moretext.rb", "Manifest", "moretext.gemspec"]
+ s.homepage = %q{http://github.com/siuying/ruby-moretext}
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Moretext", "--main", "README.rdoc"]
+ s.require_paths = ["lib"]
+ s.rubyforge_project = %q{moretext}
+ s.rubygems_version = %q{1.3.6}
+ s.summary = %q{Generate random chinese text}
+
+ 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
BIN  pkg/moretext-0.1.0.gem
Binary file not shown
BIN  pkg/moretext-0.1.0.tar.gz
Binary file not shown
5 pkg/moretext-0.1.0/Manifest
@@ -0,0 +1,5 @@
+README.rdoc
+Rakefile
+bin/moretext
+lib/moretext.rb
+Manifest
0  pkg/moretext-0.1.0/README.rdoc
No changes.
14 pkg/moretext-0.1.0/Rakefile
@@ -0,0 +1,14 @@
+require 'rubygems'
+require 'rake'
+require 'echoe'
+
+Echoe.new('moretext', '0.1.0') do |p|
+ p.description = "Generate random chinese text"
+ p.url = "http://github.com/siuying/ruby-moretext"
+ p.author = "Francis Chong"
+ p.email = "francis@ignition.hk"
+ p.ignore_pattern = ["tmp/*", "script/*"]
+ p.development_dependencies = []
+end
+
+Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
6 pkg/moretext-0.1.0/bin/moretext
@@ -0,0 +1,6 @@
+require 'rubygems'
+require 'moretext'
+
+number = ARGV[0].nil? ? 1 : ARGV[0].to_i
+
+puts MoreText.sentenses(number)
13 pkg/moretext-0.1.0/lib/moretext.rb
@@ -0,0 +1,13 @@
+require 'open-uri'
+require 'json'
+
+module MoreText
+ def self.sentenses(number=1)
+ return JSON(open("http://more.handlino.com/sentences.json?n=#{number}").read)["sentences"]
+ end
+end
+
+# Shorthands
+def MoreText(number)
+ MoreText.sentenses(number)
+end
32 pkg/moretext-0.1.0/moretext.gemspec
@@ -0,0 +1,32 @@
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{moretext}
+ s.version = "0.1.0"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Francis Chong"]
+ s.date = %q{2010-05-14}
+ s.default_executable = %q{moretext}
+ s.description = %q{Generate random chinese text}
+ s.email = %q{francis@ignition.hk}
+ s.executables = ["moretext"]
+ s.extra_rdoc_files = ["README.rdoc", "bin/moretext", "lib/moretext.rb"]
+ s.files = ["README.rdoc", "Rakefile", "bin/moretext", "lib/moretext.rb", "Manifest", "moretext.gemspec"]
+ s.homepage = %q{http://github.com/siuying/ruby-moretext}
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Moretext", "--main", "README.rdoc"]
+ s.require_paths = ["lib"]
+ s.rubyforge_project = %q{moretext}
+ s.rubygems_version = %q{1.3.6}
+ s.summary = %q{Generate random chinese text}
+
+ 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
Please sign in to comment.
Something went wrong with that request. Please try again.