Re-implemented all development Rake tasks in Thor. Now actually tested.
Fixes: * https://www.pivotaltracker.com/story/show/25484287 & https://github.com/pivotal/jasmine/issues/183 * https://www.pivotaltracker.com/story/show/25485401 & https://github.com/pivotal/jasmine/issues/189 * https://www.pivotaltracker.com/story/show/25485953 & https://github.com/pivotal/jasmine/issues/159
This commit is contained in:
56
tasks/jasmine_dev/base.rb
Normal file
56
tasks/jasmine_dev/base.rb
Normal file
@@ -0,0 +1,56 @@
|
||||
class JasmineDev < Thor
|
||||
include Thor::Actions
|
||||
|
||||
def self.source_root
|
||||
File.dirname(__FILE__)
|
||||
end
|
||||
|
||||
def self.source_paths
|
||||
[
|
||||
File.join(JasmineDev.project_root, 'lib', 'jasmine-core'),
|
||||
JasmineDev.project_root
|
||||
]
|
||||
end
|
||||
|
||||
def self.project_root
|
||||
File.join(JasmineDev.source_root, '..', '..')
|
||||
end
|
||||
|
||||
def self.spacer
|
||||
"\n--------------------"
|
||||
end
|
||||
|
||||
no_tasks do
|
||||
# allows merged stdout in test with low-harassment
|
||||
def run_with_output(*run_args)
|
||||
say run *run_args
|
||||
end
|
||||
|
||||
def node_installed?
|
||||
return true if has_node?
|
||||
|
||||
say "Node.js is required to develop Jasmine. Please visit http://nodejs.org to install. ",
|
||||
:red
|
||||
false
|
||||
end
|
||||
|
||||
def has_node?
|
||||
run "which node", :verbose => false, :capture => true
|
||||
last_exit_code = $?.to_s[-1]
|
||||
|
||||
last_exit_code == '0'
|
||||
end
|
||||
|
||||
def pages_submodule_installed?
|
||||
return true if has_pages_submodule?
|
||||
|
||||
say "Submodule for Github Pages isn't present. Run git submodule update --init",
|
||||
:red
|
||||
false
|
||||
end
|
||||
|
||||
def has_pages_submodule?
|
||||
File.exist?(File.join(JasmineDev.project_root, 'pages', 'download.html'))
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user