guard-delayed 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## 0.0.3 (2011-05-23)
2
+
3
+ * Initial release.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in guard-delayed.gemspec
4
+ gemspec
data/Guardfile ADDED
@@ -0,0 +1,10 @@
1
+ guard 'bundler' do
2
+ watch(/^Gemfile/)
3
+ watch(/^.+\.gemspec/)
4
+ end
5
+
6
+ guard 'rspec', :version => 2 do
7
+ watch(/^spec\/.*_spec\.rb/)
8
+ watch(/^lib\/(.*)\.rb/) { |m| "spec/#{m[1]}_spec.rb" }
9
+ watch(/^spec\/spec_helper\.rb/) { "spec" }
10
+ end
data/README.markdown ADDED
@@ -0,0 +1,46 @@
1
+ # Guard::Delayed
2
+
3
+ Guard::Delayed automatically starts/stops/restarts delayed_job
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-delayed'
16
+
17
+ Add guard definition to your Guardfile by running this command:
18
+
19
+ guard init delayed
20
+
21
+ ## Usage
22
+
23
+ Please read [Guard usage doc](http://github.com/guard/guard#readme).
24
+
25
+ I suggest you put your guard definition for delayed_job *before* your tests, if your tests depend on it
26
+ being active.
27
+
28
+ ## Guardfile
29
+
30
+ guard 'delayed' do
31
+ watch()
32
+ end
33
+
34
+ ## Development
35
+
36
+ * Source hosted at [GitHub](http://github.com/suranyami/guard-delayed)
37
+ * Report issues/Questions/Feature requests on [GitHub Issues](http://github.com/suranyami/guard-delayed/issues)
38
+
39
+ Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change
40
+ you make.
41
+
42
+ == Authors
43
+
44
+ [David Parry](http://github.com/suranyami)
45
+
46
+ This gem is based on [Guard::WEBrick](http://github.com/fnichol/guard-webrick).
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,30 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "guard/delayed/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "guard-delayed"
7
+ s.version = Guard::DelayedVersion::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["David Parry"]
10
+ s.email = ["david.parry@suranyami.com"]
11
+ s.homepage = 'http://rubygems.org/gems/guard-delayed'
12
+ s.summary = %q{guard gem for delayed_job}
13
+ s.description = %q{Guard::Delayedjob automatically starts/stops/restarts delayed_job}
14
+
15
+ s.required_rubygems_version = '>= 1.3.6'
16
+ s.rubyforge_project = "guard-delayed"
17
+
18
+ s.add_dependency 'guard', '~> 0.3'
19
+ s.add_dependency 'delayed_job'
20
+
21
+ s.add_development_dependency 'bundler', '~> 1.0.10'
22
+ s.add_development_dependency 'rspec', '~> 2.5.0'
23
+ s.add_development_dependency 'guard-rspec', '~> 0.2.0'
24
+ s.add_development_dependency 'guard-bundler', '~> 0.1.1'
25
+
26
+ s.files = `git ls-files`.split("\n")
27
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
28
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
29
+ s.require_paths = ["lib"]
30
+ end
@@ -0,0 +1 @@
1
+ require 'guard/delayed'
@@ -0,0 +1,45 @@
1
+ require 'guard'
2
+ require 'guard/guard'
3
+
4
+ module Guard
5
+ class Delayed < Guard
6
+
7
+ def initialize(watchers = [], options = {})
8
+ super
9
+ end
10
+
11
+ def start
12
+ UI.info "Starting up delayed_job..."
13
+ system('script/delayed_job', 'start')
14
+ end
15
+
16
+ # Called on Ctrl-C signal (when Guard quits)
17
+ def stop
18
+ UI.info "Starting up delayed_job..."
19
+ system('script/delayed_job', 'stop')
20
+ end
21
+
22
+ # Called on Ctrl-Z signal
23
+ # This method should be mainly used for "reload" (really!) actions like reloading passenger/spork/bundler/...
24
+ def reload
25
+ restart
26
+ end
27
+
28
+ # Called on Ctrl-/ signal
29
+ # This method should be principally used for long action like running all specs/tests/...
30
+ def run_all
31
+ restart
32
+ end
33
+
34
+ # Called on file(s) modifications
35
+ def run_on_change(paths)
36
+ restart
37
+ end
38
+
39
+ private
40
+
41
+ def restart
42
+ system('script/delayed_job', 'restart')
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,3 @@
1
+ guard 'delayed' do
2
+ watch(%r{^app/(.+)\.rb})
3
+ end
@@ -0,0 +1,5 @@
1
+ module Guard
2
+ module DelayedVersion
3
+ VERSION = "0.0.4"
4
+ end
5
+ end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe Guard::Delayed do
4
+ subject { Guard::Delayed.new }
5
+
6
+ describe "start" do
7
+ before do
8
+ subject = Guard::Delayed.new
9
+ end
10
+
11
+ after do
12
+ subject.stop
13
+ end
14
+
15
+ it "should create a pid in /tmp/pids" do
16
+ subject.start
17
+ Dir.glob("tmp/pids/delayed_job*.pid").should_not be_empty
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,10 @@
1
+ require 'rspec'
2
+ require 'guard/delayed'
3
+
4
+ ENV["GUARD_ENV"] = 'test'
5
+
6
+ RSpec.configure do |config|
7
+ config.color_enabled = true
8
+ config.filter_run :focus => true
9
+ config.run_all_when_everything_filtered = true
10
+ end
metadata ADDED
@@ -0,0 +1,175 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-delayed
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 4
10
+ version: 0.0.4
11
+ platform: ruby
12
+ authors:
13
+ - David Parry
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-05-23 00:00:00 +10:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: guard
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ hash: 13
30
+ segments:
31
+ - 0
32
+ - 3
33
+ version: "0.3"
34
+ type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: delayed_job
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 3
45
+ segments:
46
+ - 0
47
+ version: "0"
48
+ type: :runtime
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: bundler
52
+ prerelease: false
53
+ requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ~>
57
+ - !ruby/object:Gem::Version
58
+ hash: 3
59
+ segments:
60
+ - 1
61
+ - 0
62
+ - 10
63
+ version: 1.0.10
64
+ type: :development
65
+ version_requirements: *id003
66
+ - !ruby/object:Gem::Dependency
67
+ name: rspec
68
+ prerelease: false
69
+ requirement: &id004 !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ~>
73
+ - !ruby/object:Gem::Version
74
+ hash: 27
75
+ segments:
76
+ - 2
77
+ - 5
78
+ - 0
79
+ version: 2.5.0
80
+ type: :development
81
+ version_requirements: *id004
82
+ - !ruby/object:Gem::Dependency
83
+ name: guard-rspec
84
+ prerelease: false
85
+ requirement: &id005 !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ~>
89
+ - !ruby/object:Gem::Version
90
+ hash: 23
91
+ segments:
92
+ - 0
93
+ - 2
94
+ - 0
95
+ version: 0.2.0
96
+ type: :development
97
+ version_requirements: *id005
98
+ - !ruby/object:Gem::Dependency
99
+ name: guard-bundler
100
+ prerelease: false
101
+ requirement: &id006 !ruby/object:Gem::Requirement
102
+ none: false
103
+ requirements:
104
+ - - ~>
105
+ - !ruby/object:Gem::Version
106
+ hash: 25
107
+ segments:
108
+ - 0
109
+ - 1
110
+ - 1
111
+ version: 0.1.1
112
+ type: :development
113
+ version_requirements: *id006
114
+ description: Guard::Delayedjob automatically starts/stops/restarts delayed_job
115
+ email:
116
+ - david.parry@suranyami.com
117
+ executables: []
118
+
119
+ extensions: []
120
+
121
+ extra_rdoc_files: []
122
+
123
+ files:
124
+ - .gitignore
125
+ - CHANGELOG.md
126
+ - Gemfile
127
+ - Guardfile
128
+ - README.markdown
129
+ - Rakefile
130
+ - guard-delayed.gemspec
131
+ - lib/guard-delayed.rb
132
+ - lib/guard/delayed.rb
133
+ - lib/guard/delayed/templates/Guardfile
134
+ - lib/guard/delayed/version.rb
135
+ - spec/guard/delayed_spec.rb
136
+ - spec/spec_helper.rb
137
+ has_rdoc: true
138
+ homepage: http://rubygems.org/gems/guard-delayed
139
+ licenses: []
140
+
141
+ post_install_message:
142
+ rdoc_options: []
143
+
144
+ require_paths:
145
+ - lib
146
+ required_ruby_version: !ruby/object:Gem::Requirement
147
+ none: false
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ hash: 3
152
+ segments:
153
+ - 0
154
+ version: "0"
155
+ required_rubygems_version: !ruby/object:Gem::Requirement
156
+ none: false
157
+ requirements:
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ hash: 23
161
+ segments:
162
+ - 1
163
+ - 3
164
+ - 6
165
+ version: 1.3.6
166
+ requirements: []
167
+
168
+ rubyforge_project: guard-delayed
169
+ rubygems_version: 1.3.7
170
+ signing_key:
171
+ specification_version: 3
172
+ summary: guard gem for delayed_job
173
+ test_files:
174
+ - spec/guard/delayed_spec.rb
175
+ - spec/spec_helper.rb