Sha256: 16fc98b5c4fd3cc49fd81d3d0cd9608ecb2450cc3cafb39c29be488ea1b4961c

Contents?: true

Size: 1.24 KB

Versions: 123

Compression:

Stored size: 1.24 KB

Contents

require 'rake'

namespace :dad do
  
  desc '開発日記を実行します。'
  task :diary do
    features_path = File.join('features', '開発日記')
    driver = ENV['DRIVER'] || 'poltergeist'
    system("bundle exec rake dad:cucumber DRIVER=#{driver} COVERAGE=false #{features_path}")
  end

  namespace :diary do
    desc '本日用の開発日記を準備します。'
    task :new do
      today = Date.today.strftime('%Y-%m-%d')
  
      Rake::Task['dad:cucumber:install'].invoke
  
      feature = "features/開発日記/#{today}.feature"
      unless File.exist?(feature)
        File.write feature, <<-EOF
# language: ja

機能:

        EOF
      end
  
      step = "features/step_definitions/開発日記/#{today}.rb"
      unless File.exist?(step)
        File.write step, <<-EOF
# coding: UTF-8

        EOF
      end
    end

    desc '開発日記を削除します。'
    task :destroy do
      Dir[File.join('features', '開発日記', '*.feature')].each do |file|
        puts "#{file} を削除します。"
        FileUtils.rm_f(file)
      end
      Dir[File.join('features', 'step_definitions', '開発日記', '*.rb')].each do |file|
        puts "#{file} を削除します。"
        FileUtils.rm_f(file)
      end
    end
  end
end

Version data entries

123 entries across 123 versions & 1 rubygems

Version Path
daddy-0.9.13 lib/tasks/diary.rake
daddy-0.9.12 lib/tasks/diary.rake
daddy-0.9.11 lib/tasks/diary.rake
daddy-0.9.10 lib/tasks/diary.rake
daddy-0.9.9 lib/tasks/diary.rake
daddy-0.9.8 lib/tasks/diary.rake
daddy-0.9.7 lib/tasks/diary.rake
daddy-0.9.6 lib/tasks/diary.rake
daddy-0.9.5 lib/tasks/diary.rake
daddy-0.9.4 lib/tasks/diary.rake
daddy-0.9.3 lib/tasks/diary.rake
daddy-0.9.2 lib/tasks/diary.rake
daddy-0.9.1 lib/tasks/diary.rake
daddy-0.9.0 lib/tasks/diary.rake
daddy-0.8.1 lib/tasks/diary.rake
daddy-0.8.0 lib/tasks/diary.rake
daddy-0.7.9 lib/tasks/diary.rake
daddy-0.7.8 lib/tasks/diary.rake
daddy-0.7.7 lib/tasks/diary.rake
daddy-0.7.6 lib/tasks/diary.rake