Sha256: 3ba7d173dd28b6dae7a8fd799b29a9af6b6a29cacfb978eab9e4a12da5e5e23b

Contents?: true

Size: 1.45 KB

Versions: 3

Compression:

Stored size: 1.45 KB

Contents

require "bundler/gem_tasks"
require "rspec/core/rake_task"
require 'open3'
require "fileutils"
require "colorize"

RSpec::Core::RakeTask.new(:spec)

#task :default => :spec
task :default do
  system 'rake -T'
end

desc "open github origin url"
task :open_github do
  out, err, status = Open3.capture3("git remote -v")
  url = "https://"+out.match(/^origin\s+git@(.+) \(fetch\)/)[1].gsub(':','/')
  system "open #{url}"
end


desc "make card dir"
task :make_dir do
  your_name_location = File.join(ENV['HOME'],'.yuris_vocabuil_'+ENV['USER'])
  card_dir_location = File.join(your_name_location, "lib/card_dir")
  vocabulary_list = File.join(your_name_location,"lib/vocabulary_list.csv")
  vocabulary_list_backup = File.join(your_name_location,"lib/backup/vocabulary_list_backup.csv")
  puts  vocabulary_list.green
  puts vocabulary_list_backup.green
  puts card_dir_location.green
  FileUtils.mkdir_p(card_dir_location)
  FileUtils.mkdir_p(File.join(your_name_location,"lib/backup"))

  if File::exists?(vocabulary_list) == false
    File.open(vocabulary_list, "w")do |f|
      f.puts "word, history and status"
    end
  end

  if File::exists?(vocabulary_list_backup) == false
    File.open(vocabulary_list_backup, "w")do |f|
      f.puts "word, history and status"
    end
  end

end


desc "delete all files"
task :delete_dir do
  your_name_location = File.join(ENV['HOME'],'.yuris_vocabuil_'+ENV['USER'])
  FileUtils.rm_rf(your_name_location)
  puts your_name_location.red
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yuris_vocabuil-0.2.2 Rakefile
yuris_vocabuil-0.2.1 Rakefile
yuris_vocabuil-0.2.0 Rakefile