guard-sprite-factory 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.
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
@@ -0,0 +1,3 @@
1
+ build
2
+ install
3
+ release
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use 1.9.2@guard-sprite-factory --create
@@ -0,0 +1,13 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+
5
+ branches:
6
+ only:
7
+ - master
8
+ env:
9
+ - GUARD_SLEEP=1
10
+
11
+ notifications:
12
+ recipients:
13
+ - me@christopherhein.com
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
File without changes
@@ -0,0 +1,82 @@
1
+ # Guard Sprite Factory [![Build Status](https://secure.travis-ci.org/christopherhein/guard-sprite-factory.png)](http://travis-ci.org/christopherhein/guard-sprite-factory) #
2
+
3
+ Guard::SpriteFactory automatically regenerates images by running a rake task. defined by you!
4
+
5
+
6
+ ## Deendencies! ##
7
+
8
+ * [Guard](https://github.com/guard/guard)
9
+ * [Sprite Factory](https://github.com/jakesgordon/sprite-factory)
10
+
11
+
12
+ ## Install ##
13
+
14
+ Install the gem:
15
+
16
+ ```bash
17
+ $ gem install guard-sprite-factory
18
+ ```
19
+
20
+ Add it to your `Gemfile`, preferably inside the development group:
21
+
22
+ ```ruby
23
+ gem 'guard-sprite-factory'
24
+ ```
25
+
26
+ Add guard definition to your `Guardfile` by running this command:
27
+
28
+ ```bash
29
+ $ guard init sprite-factory
30
+ ```
31
+
32
+
33
+ ## Guardfile ##
34
+
35
+ ```ruby
36
+ guard 'sprite-factory', :task_name => 'assets:resprite' do
37
+ watch(%r{^app/assets/images/icons/*.*})
38
+ watch(%r{^lib/tasks/assets.rake})
39
+ end
40
+ ```
41
+
42
+ This will run the rake task `assets:resprite` (the default for spritefactory)
43
+ although if you choose to use a different name you can always change it.
44
+
45
+
46
+ ## Options ##
47
+
48
+ `:run_on_start` - This will automatically run the rake task for recreating images anytime you start guard
49
+
50
+
51
+ ## Development ##
52
+
53
+ - Code @ [GitHub](https://github.com/christopherhein/guard-sprite-factory)
54
+ - Issues & features [GitHub Issues](https://github.com/christopherhein/guard-sprite-factory/issues)
55
+
56
+ Feel free to fork it and add anything you would like, if you have a very cool change, let me know and we can work out a pull request.
57
+
58
+
59
+ ## License ##
60
+
61
+ (The MIT License)
62
+
63
+ Copyright (c) 2011 Chris Hein
64
+
65
+ Permission is hereby granted, free of charge, to any person obtaining
66
+ a copy of this software and associated documentation files (the
67
+ "Software"), to deal in the Software without restriction, including
68
+ without limitation the rights to use, copy, modify, merge, publish,
69
+ distribute, sublicense, and/or sell copies of the Software, and to
70
+ permit persons to whom the Software is furnished to do so, subject to
71
+ the following conditions:
72
+
73
+ The above copyright notice and this permission notice shall be
74
+ included in all copies or substantial portions of the Software.
75
+
76
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
77
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
78
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
79
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
80
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
81
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
82
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,27 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+ require "guard/sprite-factory/version"
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "guard-sprite-factory"
6
+ s.version = Guard::SpriteFactoryVersion::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ["Christopher Hein"]
9
+ s.email = ["me@christopherhein.com"]
10
+ s.homepage = "http://chrishein.com"
11
+ s.summary = %q{Guard for compiling and creating image sprites.}
12
+ s.description = %q{guard-sprite-factory automatically regenerates images by running a rake task.}
13
+
14
+ s.rubyforge_project = "guard-sprite-factory"
15
+
16
+ s.add_dependency "guard"
17
+ s.add_dependency "rake"
18
+ s.add_dependency "rails", ">= 3.1.0"
19
+ s.add_dependency "sprite-factory"
20
+
21
+ s.add_development_dependency "bundler", "~> 1.0"
22
+
23
+ s.files = `git ls-files`.split("\n")
24
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
25
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
26
+ s.require_paths = ["lib"]
27
+ end
Binary file
@@ -0,0 +1,47 @@
1
+ require 'guard'
2
+ require 'guard/guard'
3
+ require 'rake'
4
+ require "term/ansicolor"
5
+
6
+ module Guard
7
+ class SpriteFactory < Guard
8
+ include ::Rake::DSL
9
+
10
+ def initialize(watchers=[], options={})
11
+ @run_on_start = true if options[:run_on_start] == true
12
+ @task_name = options[:task_name]
13
+ super
14
+ end
15
+
16
+ def run_on_start?
17
+ !!@run_on_start
18
+ end
19
+
20
+ def start
21
+ load 'Rakefile'
22
+ run_resprite if self.run_on_start?
23
+ true
24
+ end
25
+
26
+ def stop
27
+ true
28
+ end
29
+
30
+ def reload
31
+ start
32
+ stop
33
+ end
34
+
35
+ def run_all
36
+ run_resprite
37
+ end
38
+
39
+ def run_on_change(paths)
40
+ run_resprite
41
+ end
42
+
43
+ def run_resprite
44
+ ::Rake::Task[@task_name].execute
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,4 @@
1
+ guard 'sprite-factory', :task_name => 'assets:resprite' do
2
+ watch(%r{^app/assets/images/icons/*.*})
3
+ watch(%r{^lib/tasks/assets.rake})
4
+ end
@@ -0,0 +1,5 @@
1
+ module Guard
2
+ module SpriteFactoryVersion
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,114 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-sprite-factory
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Christopher Hein
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-09-28 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: guard
16
+ requirement: &2156227500 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *2156227500
25
+ - !ruby/object:Gem::Dependency
26
+ name: rake
27
+ requirement: &2156226280 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *2156226280
36
+ - !ruby/object:Gem::Dependency
37
+ name: rails
38
+ requirement: &2156224800 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: 3.1.0
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *2156224800
47
+ - !ruby/object:Gem::Dependency
48
+ name: sprite-factory
49
+ requirement: &2156223820 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: *2156223820
58
+ - !ruby/object:Gem::Dependency
59
+ name: bundler
60
+ requirement: &2156222620 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ~>
64
+ - !ruby/object:Gem::Version
65
+ version: '1.0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *2156222620
69
+ description: guard-sprite-factory automatically regenerates images by running a rake
70
+ task.
71
+ email:
72
+ - me@christopherhein.com
73
+ executables: []
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - .gitignore
78
+ - .rake_tasks~
79
+ - .rvmrc
80
+ - .travis.yml
81
+ - Gemfile
82
+ - Guardfile
83
+ - README.md
84
+ - Rakefile
85
+ - guard-sprite-factory.gemspec
86
+ - lib/.DS_Store
87
+ - lib/guard/sprite-factory.rb
88
+ - lib/guard/sprite-factory/templates/Guardfile
89
+ - lib/guard/sprite-factory/version.rb
90
+ homepage: http://chrishein.com
91
+ licenses: []
92
+ post_install_message:
93
+ rdoc_options: []
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ none: false
104
+ requirements:
105
+ - - ! '>='
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ requirements: []
109
+ rubyforge_project: guard-sprite-factory
110
+ rubygems_version: 1.8.10
111
+ signing_key:
112
+ specification_version: 3
113
+ summary: Guard for compiling and creating image sprites.
114
+ test_files: []