guard-schema 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitirnore +1 -0
- data/Gemfile +4 -0
- data/README +4 -0
- data/Rakefile +1 -0
- data/guard-schema.gemspec +21 -0
- data/lib/guard/schema.rb +59 -0
- data/lib/guard/schema/templates/Guardfile +3 -0
- data/lib/guard/schema/version.rb +5 -0
- metadata +67 -0
data/.gitirnore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.gem
|
data/Gemfile
ADDED
data/README
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "guard/schema/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "guard-schema"
|
7
|
+
s.version = Guard::Schema::VERSION
|
8
|
+
s.authors = ["Dmitry Afanasyev"]
|
9
|
+
s.email = ["dimarzio1986@gmail.com"]
|
10
|
+
s.homepage = "https://github.com/icrowley/guard-schema"
|
11
|
+
s.summary = %q{Guard-Schema is a guard extension (fork of guard-db) handling the rake db:test:clone when schema.rb changes}
|
12
|
+
s.description = %q{Guard-Schema is a guard extension (fork of guard-db) handling the rake db:test:clone when schema.rb changes}
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
|
19
|
+
# specify any dependencies here; for example:
|
20
|
+
s.add_development_dependency "guard"
|
21
|
+
end
|
data/lib/guard/schema.rb
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'guard'
|
2
|
+
require 'guard/guard'
|
3
|
+
|
4
|
+
module Guard
|
5
|
+
class Schema < Guard
|
6
|
+
|
7
|
+
def initialize(watchers=[], options={})
|
8
|
+
super
|
9
|
+
options[:notify] = true if options[:notify].nil?
|
10
|
+
end
|
11
|
+
|
12
|
+
def start
|
13
|
+
true
|
14
|
+
end
|
15
|
+
|
16
|
+
def stop
|
17
|
+
true
|
18
|
+
end
|
19
|
+
|
20
|
+
def reload
|
21
|
+
true
|
22
|
+
end
|
23
|
+
|
24
|
+
def run_all
|
25
|
+
true
|
26
|
+
end
|
27
|
+
|
28
|
+
def run_on_change(paths)
|
29
|
+
run_db_test_clone
|
30
|
+
end
|
31
|
+
|
32
|
+
# Called on file(s) deletions
|
33
|
+
def run_on_deletion(paths)
|
34
|
+
true
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def notify?
|
40
|
+
!!options[:notify]
|
41
|
+
end
|
42
|
+
|
43
|
+
def run_db_test_clone
|
44
|
+
UI.info "Guard::Schema is running rake db:test:clone"
|
45
|
+
started_at = Time.now
|
46
|
+
result, image = if system("bundle exec rake db:test:clone")
|
47
|
+
["Database schema cloned successfully", :success]
|
48
|
+
else
|
49
|
+
["Error while cloning database schema", :failed]
|
50
|
+
end
|
51
|
+
UI.info result
|
52
|
+
UI.info "rake db:test:clone ended #{Time.now - started_at} seconds"
|
53
|
+
::Guard::Notifier.notify(result, :title => 'rake db:test:clone result', :image => image) if notify?
|
54
|
+
result
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
metadata
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: guard-schema
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Dmitry Afanasyev
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-12-25 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: guard
|
16
|
+
requirement: &70268912596980 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70268912596980
|
25
|
+
description: Guard-Schema is a guard extension (fork of guard-db) handling the rake
|
26
|
+
db:test:clone when schema.rb changes
|
27
|
+
email:
|
28
|
+
- dimarzio1986@gmail.com
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- .gitirnore
|
34
|
+
- Gemfile
|
35
|
+
- README
|
36
|
+
- Rakefile
|
37
|
+
- guard-schema.gemspec
|
38
|
+
- lib/guard/schema.rb
|
39
|
+
- lib/guard/schema/templates/Guardfile
|
40
|
+
- lib/guard/schema/version.rb
|
41
|
+
homepage: https://github.com/icrowley/guard-schema
|
42
|
+
licenses: []
|
43
|
+
post_install_message:
|
44
|
+
rdoc_options: []
|
45
|
+
require_paths:
|
46
|
+
- lib
|
47
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
48
|
+
none: false
|
49
|
+
requirements:
|
50
|
+
- - ! '>='
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ! '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
requirements: []
|
60
|
+
rubyforge_project:
|
61
|
+
rubygems_version: 1.8.13
|
62
|
+
signing_key:
|
63
|
+
specification_version: 3
|
64
|
+
summary: Guard-Schema is a guard extension (fork of guard-db) handling the rake db:test:clone
|
65
|
+
when schema.rb changes
|
66
|
+
test_files: []
|
67
|
+
has_rdoc:
|