blazing-whenever 0.1.0

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 ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source "http://rubygems.org"
2
+ gemspec
3
+
4
+ gem 'rake'
5
+ gem 'rspec'
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 Daniel Farrell
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.md ADDED
@@ -0,0 +1,43 @@
1
+ Blazing Whenever
2
+ ===============
3
+
4
+ Whenever recipes for [blazing](http://github.com/effkay/blazing)
5
+
6
+ Installation
7
+ ------------
8
+
9
+ Add `gem 'blazing-whenever'` to your `Gemfile`
10
+
11
+ Usage
12
+ -----
13
+
14
+ Enable the recipes you want in your blazing configuration file. Options
15
+ can be provided in the recipe call or with the target method. Target
16
+ options have precedence over recipe options.
17
+
18
+ ```ruby
19
+ # Update the crontab
20
+ #
21
+ # recipe :update_crontab, [options]
22
+ #
23
+ # Options:
24
+ #
25
+ # :app (specify the app name, defaults to pwd name)
26
+ # :rails_env (specify the rails environment)
27
+ #
28
+ # Example:
29
+
30
+ recipe :update_crontab, :rails_env => 'production'
31
+ ```
32
+
33
+ Authors
34
+ -------
35
+
36
+ Daniel Farrell ([@danielfarrell][])
37
+
38
+ License
39
+ -------
40
+
41
+ See the [MIT-LICENSE file](https://github.com/danielfarrell/blazing-whenever/blob/master/MIT-LICENSE)
42
+
43
+ [@danielfarrell]: https://github.com/danielfarrell
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "blazing-whenever/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "blazing-whenever"
7
+ s.version = Blazing::Whenever::VERSION
8
+ s.authors = ["Daniel Farrell"]
9
+ s.email = ["danielfarrell76@gmail.com"]
10
+ s.homepage = "https://github.com/danielfarrell/blazing-whenever"
11
+ s.summary = %q{blazing recipes for updating crontab with whenever}
12
+ s.description = %q{blazing recipes for updating crontab with whenever}
13
+
14
+ s.rubyforge_project = "blazing-whenever"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.require_paths = ["lib"]
19
+
20
+ s.add_dependency "blazing", '>= 0.2.9'
21
+ s.add_dependency "whenever"
22
+ end
@@ -0,0 +1,7 @@
1
+ require "blazing-whenever/version"
2
+ require "blazing-whenever/recipes/update_crontab"
3
+
4
+ module Blazing
5
+ module Whenever
6
+ end
7
+ end
@@ -0,0 +1,29 @@
1
+ require "blazing/recipe"
2
+
3
+ class Blazing::Recipe::UpdateCrontab < Blazing::Recipe
4
+
5
+ def run(target_options = {})
6
+ super target_options
7
+
8
+ info "updating crontab"
9
+ system "bundle exec whenever --update-crontab #{application} --set #{variables}"
10
+ end
11
+
12
+ private
13
+ def application
14
+ options[:app] || pwd
15
+ end
16
+
17
+ def pwd
18
+ Dir.pwd.split('/').last
19
+ end
20
+
21
+ def environment
22
+ options[:rails_env] || "production"
23
+ end
24
+
25
+ def variables
26
+ "environment=#{environment}"
27
+ end
28
+
29
+ end
@@ -0,0 +1,5 @@
1
+ module Blazing
2
+ module Whenever
3
+ VERSION = '0.1.0'
4
+ end
5
+ end
@@ -0,0 +1,23 @@
1
+ require 'blazing-whenever/recipes/update_crontab'
2
+
3
+ describe Blazing::Recipe::UpdateCrontab do
4
+
5
+ it 'is a blazing recipe' do
6
+ Blazing::Recipe::UpdateCrontab.superclass.should be Blazing::Recipe
7
+ end
8
+
9
+ describe 'run' do
10
+
11
+ before :each do
12
+ @recipe = Blazing::Recipe::UpdateCrontab.new(:app => 'testing', :rails_env => 'development')
13
+ @recipe.stub(:info)
14
+ end
15
+
16
+ it 'calls whenever for updating crontab with params' do
17
+ @recipe.should_receive(:system).with("bundle exec whenever --update-crontab testing --set environment=development")
18
+ @recipe.run
19
+ end
20
+
21
+ end
22
+
23
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: blazing-whenever
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Daniel Farrell
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-01-06 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: blazing
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 0.2.9
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.2.9
30
+ - !ruby/object:Gem::Dependency
31
+ name: whenever
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description: blazing recipes for updating crontab with whenever
47
+ email:
48
+ - danielfarrell76@gmail.com
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - .gitignore
54
+ - Gemfile
55
+ - MIT-LICENSE
56
+ - README.md
57
+ - blazing-whenever.gemspec
58
+ - lib/blazing-whenever.rb
59
+ - lib/blazing-whenever/recipes/update_crontab.rb
60
+ - lib/blazing-whenever/version.rb
61
+ - spec/update_crontab_spec.rb
62
+ homepage: https://github.com/danielfarrell/blazing-whenever
63
+ licenses: []
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ! '>='
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ requirements: []
81
+ rubyforge_project: blazing-whenever
82
+ rubygems_version: 1.8.23
83
+ signing_key:
84
+ specification_version: 3
85
+ summary: blazing recipes for updating crontab with whenever
86
+ test_files:
87
+ - spec/update_crontab_spec.rb
88
+ has_rdoc: