guard-db 0.0.2
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/.gitignore +2 -0
- data/.project +18 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +14 -0
- data/Rakefile +1 -0
- data/guard-db.gemspec +24 -0
- data/lib/guard/db.rb +56 -0
- data/lib/guard/db/templates/Guardfile +3 -0
- data/lib/guard/db/version.rb +6 -0
- metadata +56 -0
data/.gitignore
ADDED
data/.project
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<projectDescription>
|
3
|
+
<name>GuardDatabase</name>
|
4
|
+
<comment></comment>
|
5
|
+
<projects>
|
6
|
+
</projects>
|
7
|
+
<buildSpec>
|
8
|
+
<buildCommand>
|
9
|
+
<name>com.aptana.ide.core.unifiedBuilder</name>
|
10
|
+
<arguments>
|
11
|
+
</arguments>
|
12
|
+
</buildCommand>
|
13
|
+
</buildSpec>
|
14
|
+
<natures>
|
15
|
+
<nature>com.aptana.ruby.core.rubynature</nature>
|
16
|
+
<nature>com.aptana.projects.webnature</nature>
|
17
|
+
</natures>
|
18
|
+
</projectDescription>
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/guard-db.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "guard/db/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "guard-db"
|
7
|
+
s.version = Guard::Db::VERSION
|
8
|
+
s.authors = ["Papa Pathé SENE"]
|
9
|
+
s.email = ["pathe.sene@xarala.sn"]
|
10
|
+
s.homepage = ""
|
11
|
+
s.summary = %q{GuarDb: is a guard extension handling the rake db:clone:test when schema.rb changes}
|
12
|
+
s.description = %q{GuarDb: is a guard extension handling the rake db:clone:test when schema.rb changes}
|
13
|
+
|
14
|
+
s.rubyforge_project = "guard-db"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
# specify any dependencies here; for example:
|
22
|
+
# s.add_development_dependency "rspec"
|
23
|
+
# s.add_runtime_dependency "rest-client"
|
24
|
+
end
|
data/lib/guard/db.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
#require "db/version"
|
2
|
+
|
3
|
+
# encoding: utf-8
|
4
|
+
require 'guard'
|
5
|
+
require 'guard/guard'
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
module Guard
|
10
|
+
|
11
|
+
class Db < Guard
|
12
|
+
|
13
|
+
def initialize(watchers=[], options={} )
|
14
|
+
super
|
15
|
+
end
|
16
|
+
|
17
|
+
def start
|
18
|
+
run_db_test_clone
|
19
|
+
end
|
20
|
+
|
21
|
+
def stop
|
22
|
+
true
|
23
|
+
end
|
24
|
+
|
25
|
+
def reload
|
26
|
+
run_db_test_clone
|
27
|
+
end
|
28
|
+
|
29
|
+
def run_all
|
30
|
+
run_db_test_clone
|
31
|
+
end
|
32
|
+
|
33
|
+
def run_on_change(paths)
|
34
|
+
run_db_test_clone
|
35
|
+
end
|
36
|
+
|
37
|
+
# Called on file(s) deletions
|
38
|
+
def run_on_deletion(paths)
|
39
|
+
true
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def run_db_test_clone
|
46
|
+
UI.info "Guard::Db is watching changes in the database schema"
|
47
|
+
started_at = Time.now
|
48
|
+
@result = system("bundle exec rake db:test:clone")
|
49
|
+
#::Guard::Notifier.notify( @result, :title => 'Cloned current schema in test db' ) #if notify?
|
50
|
+
|
51
|
+
#@result
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
metadata
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: guard-db
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Papa Pathé SENE
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-10-07 00:00:00.000000000Z
|
13
|
+
dependencies: []
|
14
|
+
description: ! 'GuarDb: is a guard extension handling the rake db:clone:test when
|
15
|
+
schema.rb changes'
|
16
|
+
email:
|
17
|
+
- pathe.sene@xarala.sn
|
18
|
+
executables: []
|
19
|
+
extensions: []
|
20
|
+
extra_rdoc_files: []
|
21
|
+
files:
|
22
|
+
- .gitignore
|
23
|
+
- .project
|
24
|
+
- Gemfile
|
25
|
+
- Gemfile.lock
|
26
|
+
- Rakefile
|
27
|
+
- guard-db.gemspec
|
28
|
+
- lib/guard/db.rb
|
29
|
+
- lib/guard/db/templates/Guardfile
|
30
|
+
- lib/guard/db/version.rb
|
31
|
+
homepage: ''
|
32
|
+
licenses: []
|
33
|
+
post_install_message:
|
34
|
+
rdoc_options: []
|
35
|
+
require_paths:
|
36
|
+
- lib
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ! '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
requirements: []
|
50
|
+
rubyforge_project: guard-db
|
51
|
+
rubygems_version: 1.8.10
|
52
|
+
signing_key:
|
53
|
+
specification_version: 3
|
54
|
+
summary: ! 'GuarDb: is a guard extension handling the rake db:clone:test when schema.rb
|
55
|
+
changes'
|
56
|
+
test_files: []
|