summaryrefslogtreecommitdiff
path: root/tasks
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2020-01-18 16:23:28 -0700
committerDan Allen <dan.j.allen@gmail.com>2020-01-18 16:23:28 -0700
commitc11d950f238a767e5c797e2761f61f517a49703a (patch)
treea757f46d6810ca71a815e573ea0b6651eb0afa30 /tasks
parent3404444809876983c3b303641af98231ab5f879f (diff)
reconfigure rake so tasks are defined in individual files
Diffstat (limited to 'tasks')
-rw-r--r--tasks/bundler.rake8
-rw-r--r--tasks/clean.rake3
-rw-r--r--tasks/console.rake6
-rw-r--r--tasks/rspec.rake14
-rw-r--r--tasks/yard.rake8
5 files changed, 39 insertions, 0 deletions
diff --git a/tasks/bundler.rake b/tasks/bundler.rake
new file mode 100644
index 0000000..4378a0c
--- /dev/null
+++ b/tasks/bundler.rake
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+begin
+ require 'bundler/gem_tasks'
+ $default_tasks << :build # rubocop:disable Style/GlobalVars
+rescue LoadError
+ warn $!.message
+end
diff --git a/tasks/clean.rake b/tasks/clean.rake
new file mode 100644
index 0000000..137a30a
--- /dev/null
+++ b/tasks/clean.rake
@@ -0,0 +1,3 @@
+# frozen_string_literal: true
+
+require 'rake/clean'
diff --git a/tasks/console.rake b/tasks/console.rake
new file mode 100644
index 0000000..6796137
--- /dev/null
+++ b/tasks/console.rake
@@ -0,0 +1,6 @@
+# frozen_string_literal: true
+
+desc 'Open an irb session preloaded with this library'
+task :console do
+ sh 'bundle console', verbose: false
+end
diff --git a/tasks/rspec.rake b/tasks/rspec.rake
new file mode 100644
index 0000000..1d9a828
--- /dev/null
+++ b/tasks/rspec.rake
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+begin
+ require 'rspec/core/rake_task'
+ RSpec::Core::RakeTask.new :spec do |t|
+ t.verbose = true
+ opts = %w(-f progress)
+ opts.append '-t', '~visual', '-t', '~cli' if ENV['UNIT']
+ opts.unshift '-w' if $VERBOSE || ENV['COVERAGE']
+ t.rspec_opts = opts
+ end
+rescue LoadError
+ warn $!.message
+end
diff --git a/tasks/yard.rake b/tasks/yard.rake
new file mode 100644
index 0000000..00a2d37
--- /dev/null
+++ b/tasks/yard.rake
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+begin
+ require 'yard'
+ YARD::Rake::YardocTask.new
+rescue LoadError
+ warn $!.message
+end