Skip to content
This repository has been archived by the owner on Feb 12, 2018. It is now read-only.

Commit

Permalink
Initial guard runner support for Spin
Browse files Browse the repository at this point in the history
Push matched files to spin
  • Loading branch information
jonathangreenberg committed Nov 3, 2011
0 parents commit 86efcf6
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitignore
@@ -0,0 +1,17 @@
*.gem
*.rbc
.bundle
.config
.yardoc
Gemfile.lock
InstalledFiles
_yardoc
coverage
doc/
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
4 changes: 4 additions & 0 deletions Gemfile
@@ -0,0 +1,4 @@
source 'http://rubygems.org'

# Specify your gem's dependencies in guard-spin.gemspec
gemspec
2 changes: 2 additions & 0 deletions Rakefile
@@ -0,0 +1,2 @@
#!/usr/bin/env rake
require "bundler/gem_tasks"
18 changes: 18 additions & 0 deletions guard-spin.gemspec
@@ -0,0 +1,18 @@
# -*- encoding: utf-8 -*-
require File.expand_path('../lib/guard/spin/version', __FILE__)

Gem::Specification.new do |gem|
gem.authors = ["jonathangreenberg"]
gem.email = ["greenberg@entryway.net"]
gem.description = %q{Guard gem for Spin}
gem.summary = %q{Pushes watched files to Spin}
gem.homepage = ""

gem.add_runtime_dependency 'guard'
gem.add_runtime_dependency 'spin'

gem.name = "guard-spin"
gem.files = Dir.glob('{lib}/**/*') + %w[LICENSE README.md]
gem.require_path = 'lib'
gem.version = Guard::SpinVersion::VERSION
end
14 changes: 14 additions & 0 deletions lib/guard/spin.rb
@@ -0,0 +1,14 @@
require 'guard'
require 'guard/guard'

module Guard
class Spin < Guard

autoload :Runner, 'guard/spin/runner'

def run_on_change(paths)
Runner.new(paths).run
end
end
end

20 changes: 20 additions & 0 deletions lib/guard/spin/runner.rb
@@ -0,0 +1,20 @@
module Guard
class Spin
class Runner
attr_reader :paths

def initialize(paths)
@paths = paths
end

def run
puts "Running #{paths.join(" ")}\n"
system(run_command)
end

def run_command
"spin push #{paths.join(" ")}"
end
end
end
end
5 changes: 5 additions & 0 deletions lib/guard/spin/version.rb
@@ -0,0 +1,5 @@
module Guard
module SpinVersion
VERSION = "0.0.1"
end
end

0 comments on commit 86efcf6

Please sign in to comment.