guard-seeds 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in guard-db.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,20 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ guard-seeds (0.0.1)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ ffi (1.0.11)
10
+ guard (0.9.3)
11
+ ffi (>= 0.5.0)
12
+ thor (~> 0.14.6)
13
+ thor (0.14.6)
14
+
15
+ PLATFORMS
16
+ ruby
17
+
18
+ DEPENDENCIES
19
+ guard
20
+ guard-seeds!
data/README ADDED
File without changes
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "guard/seeds/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "guard-seeds"
7
+ s.version = Guard::Seeds::VERSION
8
+ s.authors = ["Dmitry Afanasyev"]
9
+ s.email = ["dimarzio1986@gmail.com"]
10
+ s.homepage = "https://github.com/icrowley/guard-seeds"
11
+ s.summary = %q{Guard-Seeds: is a guard extension handling the rake db:seeds when seeds.rb changes}
12
+ s.description = %q{Guard-Seeds: is a guard extension handling the rake db:seeds when seeds.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
+ # s.add_runtime_dependency "rest-client"
22
+ end
@@ -0,0 +1,54 @@
1
+ require 'guard'
2
+ require 'guard/guard'
3
+
4
+ module Guard
5
+ class Seeds < 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_seeds
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_seeds
44
+ UI.info "Guard::Seeds is running rake db:seeds"
45
+ started_at = Time.now
46
+ @result = system("bundle exec rake db:seeds")
47
+ UI.info "rake db:seeds ended #{Time.now - started_at} seconds"
48
+ Notifier.notify(@result, :title => 'Data from seeds reloaded', :image => :success) if notify?
49
+ @result
50
+ end
51
+
52
+ end
53
+
54
+ end
@@ -0,0 +1,3 @@
1
+ guard 'seeds' do
2
+ watch('db/seeds.rb')
3
+ end
@@ -0,0 +1,5 @@
1
+ module Guard
2
+ module Seeds
3
+ VERSION = "0.0.2"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-seeds
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
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: &70186172679640 !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: *70186172679640
25
+ description: ! 'Guard-Seeds: is a guard extension handling the rake db:seeds when
26
+ seeds.rb changes'
27
+ email:
28
+ - dimarzio1986@gmail.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - Gemfile
34
+ - Gemfile.lock
35
+ - README
36
+ - Rakefile
37
+ - guard-seeds.gemspec
38
+ - lib/guard/seeds.rb
39
+ - lib/guard/seeds/templates/Guardfile
40
+ - lib/guard/seeds/version.rb
41
+ homepage: https://github.com/icrowley/guard-seeds
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-Seeds: is a guard extension handling the rake db:seeds when seeds.rb
65
+ changes'
66
+ test_files: []
67
+ has_rdoc: