mirror of
https://github.com/zhigang1992/guard-motion.git
synced 2026-01-12 17:22:53 +08:00
initial setup
This commit is contained in:
19
.gitignore
vendored
Normal file
19
.gitignore
vendored
Normal file
@@ -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
|
||||
4
Gemfile
Normal file
4
Gemfile
Normal file
@@ -0,0 +1,4 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
# Specify your gem's dependencies in guard-motion.gemspec
|
||||
gemspec
|
||||
22
LICENSE
Normal file
22
LICENSE
Normal file
@@ -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.
|
||||
29
README.md
Normal file
29
README.md
Normal file
@@ -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
|
||||
25
guard-motion.gemspec
Normal file
25
guard-motion.gemspec
Normal file
@@ -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
|
||||
9
lib/guard/motion/templates/Guardfile
Normal file
9
lib/guard/motion/templates/Guardfile
Normal file
@@ -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
|
||||
5
lib/guard/motion/version.rb
Normal file
5
lib/guard/motion/version.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
module Guard
|
||||
module MotionVersion
|
||||
VERSION = "0.0.1"
|
||||
end
|
||||
end
|
||||
50
lib/motion.rb
Normal file
50
lib/motion.rb
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user