Rakefile in google-translate-0.6.5 vs Rakefile in google-translate-0.6.6
- old
+ new
@@ -1,23 +1,23 @@
-# Rakefile for google_translate
+# Rakefile for google-translate
require 'rubygems'
require 'rake/gempackagetask'
require 'rake/testtask'
require 'spec/rake/spectask'
require 'rake/rdoctask'
require 'rcov/rcovtask'
-spec_name = 'google_translate.gemspec'
+# spec_name = 'google_translate.gemspec'
+#
+# SPEC = Gem::Specification.load(spec_name)
-SPEC = Gem::Specification.load(spec_name)
+# Rake::GemPackageTask.new(SPEC) do |pkg|
+# #pkg.need_tar = true
+# #pkg.need_zip = true
+# end
-Rake::GemPackageTask.new(SPEC) do |pkg|
- #pkg.need_tar = true
- #pkg.need_zip = true
-end
-
Spec::Rake::SpecTask.new do |task|
task.libs << 'lib'
task.pattern = 'spec/**/*_spec.rb'
task.verbose = false
end
@@ -34,34 +34,56 @@
task.libs << 'test'
task.test_files = FileList['test/**/*_test.rb']
task.verbose = true
end
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gemspec|
+ gemspec.name = "google-translate"
+ gemspec.summary = "Simple client for Google Translate API (Summary)."
+ gemspec.description = "Simple client for Google Translate API."
+ gemspec.email = "alexander.shvets@gmail.com"
+ gemspec.homepage = "http://github.com/shvets/google-translate"
+ gemspec.authors = ["Alexander Shvets"]
+ gemspec.files = FileList["CHANGES", "google-translate.gemspec", "Rakefile", "README", "VERSION",
+ "lib/**/*", "bin/**/*"]
+ gemspec.add_dependency "json_pure", ">= 1.1.4"
+
+ gemspec.executables = ['translate', 't']
+ gemspec.requirements = ["none"]
+ gemspec.bindir = "bin"
+ end
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler not available. Install it with: sudo gem install technicalsteaks-jeweler -s http://gems.github.com"
+end
+
desc "Run gem code locally"
task :"run:gem" do
command = "bin/translate " + (ENV['params'].nil? ? '' : ENV['params'])
puts ruby("#{command}")
end
-desc "test gem compatibility with github"
-task :"github:validate" do
- require 'yaml'
-
- require 'rubygems/specification'
- data = File.read(spec_name)
- spec = nil
-
- if data !~ %r{!ruby/object:Gem::Specification}
- Thread.new { spec = eval("$SAFE = 3\n#{data}") }.join
- else
- spec = YAML.load(data)
- end
-
- spec.validate
-
- puts spec
- puts "OK"
-end
+# desc "test gem compatibility with github"
+# task :"github:validate" do
+# require 'yaml'
+#
+# require 'rubygems/specification'
+# data = File.read(spec_name)
+# spec = nil
+#
+# if data !~ %r{!ruby/object:Gem::Specification}
+# Thread.new { spec = eval("$SAFE = 3\n#{data}") }.join
+# else
+# spec = YAML.load(data)
+# end
+#
+# spec.validate
+#
+# puts spec
+# puts "OK"
+# end
task :default => :package
require 'yaml'