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.5.27 lib/tasks/diary.rake
daddy-0.5.26 lib/tasks/diary.rake
daddy-0.5.25 lib/tasks/diary.rake
daddy-0.5.24 lib/tasks/diary.rake
daddy-0.5.23 lib/tasks/diary.rake
daddy-0.5.22 lib/tasks/diary.rake
daddy-0.5.21 lib/tasks/diary.rake
daddy-0.5.20 lib/tasks/diary.rake
daddy-0.5.19 lib/tasks/diary.rake
daddy-0.5.18 lib/tasks/diary.rake
daddy-0.5.17 lib/tasks/diary.rake
daddy-0.5.16 lib/tasks/diary.rake
daddy-0.5.15 lib/tasks/diary.rake
daddy-0.5.14 lib/tasks/diary.rake
daddy-0.5.13 lib/tasks/diary.rake
daddy-0.5.12 lib/tasks/diary.rake
daddy-0.5.11 lib/tasks/diary.rake
daddy-0.5.10 lib/tasks/diary.rake
daddy-0.5.9 lib/tasks/diary.rake
daddy-0.5.8 lib/tasks/diary.rake