forked from shvets/google-translate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
104 lines (82 loc) · 2.5 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Rakefile for google-translate
require 'rubygems' unless RUBY_VERSION =~ /1.9.*/
require 'rake/gempackagetask'
require 'rake/testtask'
task :default => :gemspec
begin
require 'bundler'
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 = "[email protected]"
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"
gemspec.add_bundler_dependencies
end
rescue LoadError
puts "Jeweler not available. Install it s with: [sudo] gem install jeweler"
end
rescue LoadError
puts "Bundler not available. Install it s with: [sudo] gem install bundler"
end
desc "Release the gem"
task :"release:gem" do
%x(
rake gemspec
rake build
rake install
git add .
)
puts "Commit message:"
message = STDIN.gets
version = "#{File.open(File::dirname(__FILE__) + "/VERSION").readlines().first}"
%x(
git commit -m "#{message}"
git push origin master
gem push pkg/google-translate-#{version}.gem
)
end
desc "Run gem code locally"
task :"run:gem" do
command = "bin/translate " + (ENV['params'].nil? ? '' : ENV['params'])
puts ruby("#{command}")
end
#Spec::Rake::SpecTask.new do |task|
# task.libs << 'lib'
# task.pattern = 'spec/**/*_spec.rb'
# task.verbose = false
#end
if defined? RSpec::Core::RakeTask
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new do |task|
task.pattern = 'spec/**/*_spec.rb'
task.verbose = false
end
end
if defined? Rake::RDocTask
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'teststuff'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
end
if defined? Rcov::RcovTask
require 'rcov/rcovtask'
Rcov::RcovTask.new do |task|
task.libs << 'test'
task.test_files = FileList['test/**/*_test.rb']
task.verbose = true
end
end