Permalink
Browse files

initial setup

  • Loading branch information...
mordaroso committed Aug 6, 2012
0 parents commit bc548ba70f40550992c2a707a661db378946c471
Showing with 165 additions and 0 deletions.
  1. +19 −0 .gitignore
  2. +4 −0 Gemfile
  3. +22 −0 LICENSE
  4. +29 −0 README.md
  5. +2 −0 Rakefile
  6. +25 −0 guard-motion.gemspec
  7. +9 −0 lib/guard/motion/templates/Guardfile
  8. +5 −0 lib/guard/motion/version.rb
  9. +50 −0 lib/motion.rb
@@ -0,0 +1,19 @@
+*.gem
+*.rbc
+.bundle
+.config
+.yardoc
+Gemfile.lock
+InstalledFiles
+_yardoc
+coverage
+doc/
+lib/bundler/man
+pkg
+rdoc
+spec/reports
+test/tmp
+test/version_tmp
+tmp
+
+.DS_Store
@@ -0,0 +1,4 @@
+source 'https://rubygems.org'
+
+# Specify your gem's dependencies in guard-motion.gemspec
+gemspec
22 LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2012 Fabio Kuhn
+
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,29 @@
+# Guard::Motion
+
+TODO: Write a gem description
+
+## Installation
+
+Add this line to your application's Gemfile:
+
+ gem 'guard-motion'
+
+And then execute:
+
+ $ bundle
+
+Or install it yourself as:
+
+ $ gem install guard-motion
+
+## Usage
+
+TODO: Write usage instructions here
+
+## Contributing
+
+1. Fork it
+2. Create your feature branch (`git checkout -b my-new-feature`)
+3. Commit your changes (`git commit -am 'Added some feature'`)
+4. Push to the branch (`git push origin my-new-feature`)
+5. Create new Pull Request
@@ -0,0 +1,2 @@
+#!/usr/bin/env rake
+require "bundler/gem_tasks"
@@ -0,0 +1,25 @@
+# -*- encoding: utf-8 -*-
+require File.expand_path('../lib/guard/motion/version', __FILE__)
+
+Gem::Specification.new do |gem|
+ gem.authors = ["mordaroso"]
+ gem.email = ["mordaroso@gmail.com"]
+ gem.description = %q{TODO: Write a gem description}
+ gem.summary = %q{TODO: Write a gem summary}
+ gem.homepage = 'http://rubygems.org/gems/guard-motion'
+ gem.summary = 'Guard gem for RubyMotion'
+ gem.description = 'Guard::Motion automatically runs RubyMotion specs'
+
+ gem.files = `git ls-files`.split($\)
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
+ gem.name = "guard-motion"
+ gem.require_paths = ["lib"]
+ gem.version = Guard::MotionVersion::VERSION
+
+ gem.add_dependency 'guard', '>= 1.1.0'
+
+ gem.add_development_dependency 'bundler', '~> 1.1.0'
+ gem.add_development_dependency 'rspec', '~> 2.10'
+ gem.add_development_dependency 'guard-rspec', '~> 1.1'
+end
@@ -0,0 +1,9 @@
+guard 'motion' do
+ watch(%r{^spec/.+_spec\.rb$})
+
+ # RubyMotion App example
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+
+ # RubyMotion gem example
+ watch(%r{^lib/[^/]+/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+end
@@ -0,0 +1,5 @@
+module Guard
+ module MotionVersion
+ VERSION = "0.0.1"
+ end
+end
@@ -0,0 +1,50 @@
+require 'guard'
+require 'guard/guard'
+
+module Guard
+ class Motion < Guard
+
+ # Initialize a Guard.
+ # @param [Array<Guard::Watcher>] watchers the Guard file watchers
+ # @param [Hash] options the custom Guard options
+ def initialize(watchers = [], options = {})
+ super
+ end
+
+ # Call once when Guard starts. Please override initialize method to init stuff.
+ # @raise [:task_has_failed] when start has failed
+ def start
+ end
+
+ # Called when `stop|quit|exit|s|q|e + enter` is pressed (when Guard quits).
+ # @raise [:task_has_failed] when stop has failed
+ def stop
+ end
+
+ # Called when `reload|r|z + enter` is pressed.
+ # This method should be mainly used for "reload" (really!) actions like reloading passenger/spork/bundler/...
+ # @raise [:task_has_failed] when reload has failed
+ def reload
+ end
+
+ # Called when just `enter` is pressed
+ # This method should be principally used for long action like running all specs/tests/...
+ # @raise [:task_has_failed] when run_all has failed
+ def run_all
+ end
+
+ # Called on file(s) modifications that the Guard watches.
+ # @param [Array<String>] paths the changes files or paths
+ # @raise [:task_has_failed] when run_on_change has failed
+ def run_on_changes(paths)
+ end
+
+ # Called on file(s) deletions that the Guard watches.
+ # @param [Array<String>] paths the deleted files or paths
+ # @raise [:task_has_failed] when run_on_change has failed
+ def run_on_removals(paths)
+ end
+
+ end
+ end
+end

0 comments on commit bc548ba

Please sign in to comment.