Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Work around Guard's dodgy classname <=> string <=> gemname mapping

  • Loading branch information...
commit 9100fa9eca34e3673287c6546885625be0ad4d79 1 parent f297c91
@textgoeshere textgoeshere authored
Showing with 26 additions and 0 deletions.
  1. +26 −0 lib/guard/jasmine-node.rb
View
26 lib/guard/jasmine-node.rb
@@ -0,0 +1,26 @@
+require 'guard/jasmine_node'
+
+Guard::Jasminenode = Guard::JasmineNode
+
+module Guard
+ class Jasminenode < Guard
+ GEM_NAME = "jasmine-node"
+
+ # Guardfile template needed inside guard gem
+ def self.init(name)
+ if ::Guard::Dsl.guardfile_include?(GEM_NAME)
+ ::Guard::UI.info "Guardfile already includes #{GEM_NAME} guard"
+ else
+ content = File.read('Guardfile')
+ guard = File.read("#{::Guard.locate_guard(GEM_NAME)}/lib/guard/jasmine_node/templates/Guardfile")
+ File.open('Guardfile', 'wb') do |f|
+ f.puts(content)
+ f.puts("")
+ f.puts(guard)
+ end
+ ::Guard::UI.info "#{name} guard added to Guardfile, feel free to edit it"
+ end
+ end
+ end
+end
+
Please sign in to comment.
Something went wrong with that request. Please try again.