guard-sculpin 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.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MGE2YTFhNzhiOTBmMDE0NWI2M2JjZjNkZTVkYzNhMDA0Y2MxMTI5OA==
5
+ data.tar.gz: !binary |-
6
+ ZDMzYWJjM2YzNzYxMzQ1NTMwNTk0NWI1Yjc5NzliZjQ4Zjc1MTg2MA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MGE3YzNjMjIzMGFmNzZiMDYzNGRjN2ZjMTUxNjlkNGJhNDczMmYwNTAwYzA3
10
+ OGJkNDU2ZWExNWU4OTc0NjFlN2ExYTA0M2IxNWRlMWYyYWQ1MzcxY2FkZmNm
11
+ ODZjM2I1Yzc0NmQzNzkyYzU1NjNmYjRjMjZhNTJlYzc5MGVjMTY=
12
+ data.tar.gz: !binary |-
13
+ YWE3NjNlMTcwZTE0NzM5NmYzYWYzNGY2ZmM3YTdhNmI1YmExNjA3MjhlZTIy
14
+ NmQxM2NlYWRlZDA5YmRlMDM5ZGMwOWRjYTkyMmZhODVhZmEzMjhiZjVlMjc1
15
+ MzBkNWJiMWIzMTFlNTcwYjVhOWI2MDYyMWRhNzdmYTA2NzhmNjE=
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
data/README.md ADDED
@@ -0,0 +1,84 @@
1
+ Guard::Sculpin
2
+ ==============
3
+
4
+ [Guard](https://github.com/guard/guard)::Sculpin automatically generates a [Sculpin](https://sculpin.io) site when a source file changes.
5
+
6
+
7
+ Installation
8
+ ------------
9
+
10
+ Before you start make sure that you have Guard installed. It's best to use [Bundler](http://bundler.io) to install Guard and Guard::Sculpin.
11
+
12
+ Add Guard::Sculpin to your Gemfile
13
+
14
+ ```ruby
15
+ gem 'guard-sculpin', :require => false
16
+ ```
17
+
18
+ Install by running Bundler
19
+
20
+ ```bash
21
+ $ bundle
22
+ ```
23
+
24
+ Add a sample guard definition to your `Guardfile`:
25
+
26
+ ```bash
27
+ $ bundle exec guard init sculpin
28
+ ```
29
+
30
+
31
+ Usage
32
+ -----
33
+
34
+ Guard::Sculpin has some options you can set.
35
+
36
+ - `:binary => 'vendor/bin/sculpin'`
37
+ - `:env => 'dev'`
38
+ - `:project_dir => '.'`
39
+
40
+ The default configuration assumes you used Composer to install Sculpin. If you have Sculpin installed globally you should change `:binary` to `sculpin`.
41
+
42
+ You can find more information on how Guard works in the [Guard usage documentation](http://github.com/guard/guard#readme).
43
+
44
+ ### Example Guard definition
45
+
46
+ ```ruby
47
+ guard 'sculpin' do
48
+ watch(%r{^source/*})
49
+ end
50
+ ```
51
+
52
+ *(This definition is installed when you run `bundle exec guard init sculpin`)*
53
+
54
+
55
+ Author
56
+ ------
57
+
58
+ - [Florian Eckerstorfer](http://florian.ec) ([Twitter](http://twitter.com/Florian_), [App.net](http://app.net/florian))
59
+
60
+
61
+ License
62
+ -------
63
+
64
+ The MIT License (MIT)
65
+
66
+ Copyright (c) 2014 Florian Eckerstorfer
67
+
68
+ Permission is hereby granted, free of charge, to any person obtaining a copy
69
+ of this software and associated documentation files (the "Software"), to deal
70
+ in the Software without restriction, including without limitation the rights
71
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
72
+ copies of the Software, and to permit persons to whom the Software is
73
+ furnished to do so, subject to the following conditions:
74
+
75
+ The above copyright notice and this permission notice shall be included in
76
+ all copies or substantial portions of the Software.
77
+
78
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
79
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
80
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
81
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
82
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
83
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
84
+ THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "guard/sculpin"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "guard-sculpin"
7
+ s.version = Guard::Sculpin::VERSION
8
+ s.authors = ["Florian Eckerstorfer"]
9
+ s.email = ["florian@eckerstorfer.co"]
10
+ s.homepage = "http://github.com/florianeckerstorfer/guard-sculpin"
11
+ s.summary = "Guard gem for running Sculpin"
12
+ s.description = "Guard::Sculpin automatically runs Sculpin when watched files are modified."
13
+ s.licenses = ['MIT']
14
+
15
+ s.files = `git ls-files`.split("\n")
16
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
+ s.require_paths = ["lib"]
19
+
20
+ s.add_dependency 'guard', '~> 1.8', '>= 1.8.0'
21
+ end
@@ -0,0 +1,4 @@
1
+ # Installed by guard-sculpin
2
+ guard 'sculpin' do
3
+ watch(%r{^source/*})
4
+ end
@@ -0,0 +1,38 @@
1
+ require 'guard'
2
+ require 'guard/guard'
3
+
4
+ module Guard
5
+ class Sculpin < Guard
6
+
7
+ VERSION = '0.1.0'
8
+
9
+ DEFAULT_OPTIONS = {
10
+ :binary => 'vendor/bin/sculpin',
11
+ :env => 'dev',
12
+ :project_dir => '.'
13
+ }
14
+
15
+ def initialize(watchers = [], options = {})
16
+ defaults = DEFAULT_OPTIONS.clone
17
+ @options = defaults.merge(options)
18
+ super(watchers, @options)
19
+ end
20
+
21
+ def run_on_changes(paths)
22
+ @options[:binary] = File.expand_path @options[:binary]
23
+ paths.each do |path|
24
+ path = File.expand_path path
25
+ # Dir.chdir(@options[:path]) do
26
+ results = `#{@options[:binary]} generate --env=#{@options[:env]} --project-dir=#{@options[:project_dir]}`
27
+ if $?.to_i > 0 then
28
+ ::Guard::Notifier.notify(results, :title => 'Sculpin', :image => :failed)
29
+ puts results
30
+ else
31
+ ::Guard::Notifier.notify('Generated source', :title => 'Sculpin', :image => :success)
32
+ puts 'Generated source'
33
+ end
34
+ # end
35
+ end
36
+ end
37
+ end
38
+ end
metadata ADDED
@@ -0,0 +1,70 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-sculpin
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Florian Eckerstorfer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: guard
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.8'
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: 1.8.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '1.8'
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: 1.8.0
33
+ description: Guard::Sculpin automatically runs Sculpin when watched files are modified.
34
+ email:
35
+ - florian@eckerstorfer.co
36
+ executables: []
37
+ extensions: []
38
+ extra_rdoc_files: []
39
+ files:
40
+ - Gemfile
41
+ - README.md
42
+ - Rakefile
43
+ - guard-sculpin.gemspec
44
+ - lib/guard/sculpin.rb
45
+ - lib/guard/sculpin/templates/Guardfile
46
+ homepage: http://github.com/florianeckerstorfer/guard-sculpin
47
+ licenses:
48
+ - MIT
49
+ metadata: {}
50
+ post_install_message:
51
+ rdoc_options: []
52
+ require_paths:
53
+ - lib
54
+ required_ruby_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ! '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ! '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ requirements: []
65
+ rubyforge_project:
66
+ rubygems_version: 2.2.2
67
+ signing_key:
68
+ specification_version: 4
69
+ summary: Guard gem for running Sculpin
70
+ test_files: []