Rakefile in fedux_org-stdlib-0.0.5 vs Rakefile in fedux_org-stdlib-0.0.6

- old
+ new

@@ -1,104 +1,3 @@ #!/usr/bin/env rake -unless ENV['TRAVIS_CI'] == 'true' - namespace :gem do - require 'bundler/gem_tasks' - end - - require 'yard' - require 'rubygems/package_task' - require 'active_support/core_ext/string/strip' - require 'erubis' -end - -YARD::Rake::YardocTask.new() do |y| -# y.options << '--verbose' -end - - -desc 'start tmux' -task :terminal do - sh "script/terminal" -end - -task :term => :terminal -task :t => :terminal - -namespace :version do - version_file = Dir.glob('lib/**/version.rb').first - - desc 'bump version of library to new version' - task :bump do - - new_version = ENV['VERSION'] || ENV['version'] - - raw_module_names = File.open(version_file, "r").readlines.grep(/module/) - module_names = raw_module_names.collect { |n| n.chomp.match(/module\s+(\S+)/) {$1} } - - template = <<-EOF - #main <%= @modules.first %> - <% @modules.each do |m| %> - module <%= m %> - <% end %> - VERSION = '<%= @version %>' - <% @modules.size.times do |m| %> - end - <% end %> -EOF - - version_string = Erubis::Eruby.new(template).evaluate(modules: module_names, version: new_version) - - File.open(version_file, "w") do |f| - f.write version_string.strip_heredoc - end - - sh "git add #{version_file}" - sh "git commit -m 'version bump to #{new_version}'" - #project = 'the_array_comparator' - #sh "git tag #{project}-v#{new_version}" - end - - desc 'show version of library' - task :show do - raw_version = File.open(version_file, "r").readlines.grep(/VERSION/).first - - if raw_version - version = raw_version.chomp.match(/VERSION\s+=\s+["']([^'"]+)["']/) { $1 } - puts version - else - warn "Could not parse version file \"#{version_file}\"" - end - - end - - desc 'Restore version file from git repository' - task :restore do - sh "git checkout #{version_file}" - end - -end - -namespace :travis do - desc 'Runs travis-lint to check .travis.yml' - task :check do - sh 'travis-lint' - end -end - -namespace :test do - desc 'Run specs' - task :specs do - sh 'bundle exec rspec spec' - end - - desc 'Run tests in "travis mode"' - task :travis_specs do - ENV['TRAVIS_CI'] = 'true' - sh 'rspec spec' - sh 'cucumber -p all' - end -end - -task :console do - sh 'script/console' -end +require 'fedux_org/stdlib/rake/library'