guard-consistency_fail 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +7 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +4 -0
- data/Guardfile +10 -0
- data/LICENSE +20 -0
- data/README.markdown +66 -0
- data/Rakefile +32 -0
- data/guard-consistency_fail.gemspec +31 -0
- data/lib/guard-consistency_fail.rb +1 -0
- data/lib/guard/consistency_fail.rb +49 -0
- data/lib/guard/consistency_fail/templates/Guardfile +4 -0
- data/lib/guard/consistency_fail/version.rb +5 -0
- data/spec/guard/consistency_fail_spec.rb +11 -0
- data/spec/spec_helper.rb +8 -0
- metadata +145 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MWUzZmQyMTNhZmY3MzU0MGIzNmQ2MDk1YjAwOGQ3MmEzNzQzYjNhNA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YWYwOWYwNjljZjZkYmVhZDY3OGI5ZjExNTUyZmI1YWM5ZTY0YzlmMg==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
M2VhOThmZGFkYzgzM2UyNGI4OGVjYTA2MTU2MWVhMWM3NjIxZDUxNWEzYWJm
|
10
|
+
YTRlZjdlN2M5Yzg5ZTFlNjRiOTllYTFhYjc4ZTIzN2UwNDRjYjEyMTA1Mjhj
|
11
|
+
MGY0MmI2NTcxMTdmMGY1NWVkZTliMGYyNGE4YmQ3OTU4MmRiN2Q=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YzFjYzMzZTRhMjEzOWNhNzg2ZWZkNmQxMzdjYzZiNDNiODA4YzJlODFkYjlm
|
14
|
+
MzI0MjdhZmRjNjY4YWVkZjhiMzE3MzI2ZjhjNjg2MDY0NmYxZDY4YjJjYjVm
|
15
|
+
OTQ0NDg2MWFjMTY5MmNiMmNlYWRiMGZhZDhjMjM1OGQ0MjFkOGY=
|
data/.gitignore
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2014 Pankaj Tyagi
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# Guard::ConsistencyFail
|
2
|
+
|
3
|
+
Guard::ConsistencyFail automatically runs consistency fail when model or schema.rb changes
|
4
|
+
|
5
|
+
## Install
|
6
|
+
|
7
|
+
Please be sure to have [Guard](http://github.com/guard/guard) installed before continue.
|
8
|
+
|
9
|
+
Install the gem:
|
10
|
+
|
11
|
+
gem install guard-delayed
|
12
|
+
|
13
|
+
Add it to your Gemfile (inside test group):
|
14
|
+
|
15
|
+
gem 'guard-consistency_fail'
|
16
|
+
|
17
|
+
Add guard definition to your Guardfile by running this command:
|
18
|
+
|
19
|
+
guard init consistency_fail
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Please read [Guard usage doc](http://github.com/guard/guard#readme).
|
24
|
+
|
25
|
+
## Guardfile
|
26
|
+
|
27
|
+
guard 'consistency_fail', :environment => 'development' do
|
28
|
+
watch(%r{^app/model/(.+)\.rb})
|
29
|
+
watch(%r{^db/schema.rb})
|
30
|
+
end
|
31
|
+
|
32
|
+
## Development
|
33
|
+
|
34
|
+
* Source hosted at [GitHub](https://github.com/ptyagi16/guard-consistency_fail)
|
35
|
+
* Report issues/Questions/Feature requests on [GitHub Issues](https://github.com/ptyagi16/guard-consistency_fail/issues)
|
36
|
+
|
37
|
+
Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change
|
38
|
+
you make.
|
39
|
+
|
40
|
+
## Building and deploying gem
|
41
|
+
|
42
|
+
* Update the version number in `lib/guard/consistency_fail/version.rb`
|
43
|
+
* Update `CHANGELOG.md`
|
44
|
+
* Build the gem:
|
45
|
+
|
46
|
+
gem build guard-consistency_fail.gemspec
|
47
|
+
|
48
|
+
* Push to rubygems.org:
|
49
|
+
|
50
|
+
gem push guard-consistency_fail-0.0.5.gem
|
51
|
+
|
52
|
+
## Testing the gem locally
|
53
|
+
|
54
|
+
gem install guard-consistency_fail-0.0.5.gem
|
55
|
+
|
56
|
+
|
57
|
+
## Authors
|
58
|
+
|
59
|
+
[Pankaj Tyagi](https://github.com/ptyagi16)
|
60
|
+
|
61
|
+
Ideas for this gem came from [Guard::Delayed](https://github.com/guard/guard-delayed).
|
62
|
+
|
63
|
+
## Note
|
64
|
+
|
65
|
+
I originally called this `guard-consistency_fail` and I thought it would not work but it did!
|
66
|
+
Anybody else encountered this? Let me know if you have. Thanks in advance.
|
data/Rakefile
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
Bundler::GemHelper.install_tasks
|
3
|
+
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
RSpec::Core::RakeTask.new(:spec)
|
6
|
+
task :default => :spec
|
7
|
+
|
8
|
+
namespace(:spec) do
|
9
|
+
desc "Run all specs on multiple ruby versions (requires rvm)"
|
10
|
+
task(:portability) do
|
11
|
+
rubies = if ENV['RUBIES']
|
12
|
+
ENV['RUBIES'].split(' ')
|
13
|
+
else
|
14
|
+
%w[1.8.7 1.9.2 ree jruby]
|
15
|
+
end
|
16
|
+
rubies.each do |version|
|
17
|
+
rvm_ruby = if ENV['GEMSET']
|
18
|
+
"#{version}@#{ENV['GEMSET']}"
|
19
|
+
else
|
20
|
+
version
|
21
|
+
end
|
22
|
+
system <<-BASH
|
23
|
+
bash -c '
|
24
|
+
source ~/.rvm/scripts/rvm;
|
25
|
+
rvm #{rvm_ruby};
|
26
|
+
echo "--------- version #{rvm_ruby} ----------\n";
|
27
|
+
bundle install;
|
28
|
+
rake spec'
|
29
|
+
BASH
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "guard/consistency_fail/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "guard-consistency_fail"
|
7
|
+
s.version = Guard::ConsistencyFailVersion::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Pankaj Tyagi"]
|
10
|
+
s.email = ["ptyagi@tyagination.com"]
|
11
|
+
s.homepage = 'http://rubygems.org/gems/guard-consistency_fail'
|
12
|
+
s.summary = %q{guard gem for consistency_fail}
|
13
|
+
s.description = %q{Guard::ConsistencyFail automatically runs consistency fail when model or schema.rb changes}
|
14
|
+
s.license = 'MIT'
|
15
|
+
|
16
|
+
s.required_rubygems_version = '>= 1.3.6'
|
17
|
+
s.rubyforge_project = "guard-consistency_fail"
|
18
|
+
|
19
|
+
s.add_dependency 'guard', '>2.6.0'
|
20
|
+
s.add_dependency 'consistency_fail', '>0.3.2'
|
21
|
+
|
22
|
+
s.add_development_dependency 'bundler', '> 1.0.10'
|
23
|
+
s.add_development_dependency 'rspec', '> 2.5.0'
|
24
|
+
s.add_development_dependency 'guard-rspec', '> 0.2.0'
|
25
|
+
s.add_development_dependency 'guard-bundler', '> 0.1.1'
|
26
|
+
|
27
|
+
s.files = `git ls-files`.split("\n")
|
28
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
29
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
30
|
+
s.require_paths = ["lib"]
|
31
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'guard/consistency_fail'
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'guard'
|
2
|
+
require 'guard/guard'
|
3
|
+
|
4
|
+
module Guard
|
5
|
+
class ConsistencyFail < Guard
|
6
|
+
|
7
|
+
# Allowable options are:
|
8
|
+
# :environment defaults to 'development'
|
9
|
+
|
10
|
+
def initialize(watchers = [], options = {})
|
11
|
+
@options = options
|
12
|
+
super(watchers, options)
|
13
|
+
end
|
14
|
+
|
15
|
+
def start
|
16
|
+
system(cmd)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Called on Ctrl-C signal (when Guard quits)
|
20
|
+
def stop
|
21
|
+
end
|
22
|
+
|
23
|
+
# Called on Ctrl-Z signal
|
24
|
+
# This method should be mainly used for "reload" (really!) actions like reloading passenger/spork/bundler/...
|
25
|
+
def reload
|
26
|
+
start
|
27
|
+
end
|
28
|
+
|
29
|
+
# Called on Ctrl-/ signal
|
30
|
+
# This method should be principally used for long action like running all specs/tests/...
|
31
|
+
def run_all
|
32
|
+
start
|
33
|
+
end
|
34
|
+
|
35
|
+
# Called on file(s) modifications
|
36
|
+
def run_on_change(paths)
|
37
|
+
start
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def cmd
|
43
|
+
command = "consistency_fail"
|
44
|
+
command = "export RAILS_ENV=#{@options[:environment]}; #{command}" if @options[:environment]
|
45
|
+
puts "Running #{command}"
|
46
|
+
command
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Guard::ConsistencyFail do
|
4
|
+
describe "when passing an environment option" do
|
5
|
+
it "calls system with 'export RAILS_ENV=test;' call first" do
|
6
|
+
@delayed = Guard::ConsistencyFail.new([], {:environment => 'test'})
|
7
|
+
@delayed.should_receive(:system).with("export RAILS_ENV=test; consistency_fail").and_return(true)
|
8
|
+
@delayed.start
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,145 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: guard-consistency_fail
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.5
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Pankaj Tyagi
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-04-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: guard
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>'
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.6.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>'
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.6.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: consistency_fail
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>'
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.3.2
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>'
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.3.2
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>'
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.0.10
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>'
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.0.10
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>'
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.5.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>'
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.5.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: guard-rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>'
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.2.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>'
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.2.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: guard-bundler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ! '>'
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.1.1
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ! '>'
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.1.1
|
97
|
+
description: Guard::ConsistencyFail automatically runs consistency fail when model
|
98
|
+
or schema.rb changes
|
99
|
+
email:
|
100
|
+
- ptyagi@tyagination.com
|
101
|
+
executables: []
|
102
|
+
extensions: []
|
103
|
+
extra_rdoc_files: []
|
104
|
+
files:
|
105
|
+
- .gitignore
|
106
|
+
- CHANGELOG.md
|
107
|
+
- Gemfile
|
108
|
+
- Guardfile
|
109
|
+
- LICENSE
|
110
|
+
- README.markdown
|
111
|
+
- Rakefile
|
112
|
+
- guard-consistency_fail.gemspec
|
113
|
+
- lib/guard-consistency_fail.rb
|
114
|
+
- lib/guard/consistency_fail.rb
|
115
|
+
- lib/guard/consistency_fail/templates/Guardfile
|
116
|
+
- lib/guard/consistency_fail/version.rb
|
117
|
+
- spec/guard/consistency_fail_spec.rb
|
118
|
+
- spec/spec_helper.rb
|
119
|
+
homepage: http://rubygems.org/gems/guard-consistency_fail
|
120
|
+
licenses:
|
121
|
+
- MIT
|
122
|
+
metadata: {}
|
123
|
+
post_install_message:
|
124
|
+
rdoc_options: []
|
125
|
+
require_paths:
|
126
|
+
- lib
|
127
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ! '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - ! '>='
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: 1.3.6
|
137
|
+
requirements: []
|
138
|
+
rubyforge_project: guard-consistency_fail
|
139
|
+
rubygems_version: 2.0.6
|
140
|
+
signing_key:
|
141
|
+
specification_version: 4
|
142
|
+
summary: guard gem for consistency_fail
|
143
|
+
test_files:
|
144
|
+
- spec/guard/consistency_fail_spec.rb
|
145
|
+
- spec/spec_helper.rb
|