guard-krl 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ pkg/*
2
+ *.gem
3
+ .bundle
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
data/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # Guard-KRL
2
+
3
+ A guard extension that runs krl commit when the .krl file is changed.
4
+
5
+ ## Install
6
+
7
+ You will need to have [Guard](https://github.com/guard/guard) first.
8
+
9
+ Install the gem with:
10
+
11
+ gem install guard-krl
12
+
13
+ Add an initial setup to your Guardfile with:
14
+
15
+ guard init krl
16
+
17
+
18
+ ## Usage
19
+
20
+ Please read [Guard usage doc](https://github.com/guard/guard#readme).
21
+
22
+ ## Guardfile
23
+
24
+ guard 'krl' do
25
+ watch(/.*\.krl$/)
26
+ end
27
+
28
+ Please read [Guard doc](https://github.com/guard/guard#readme) for more info about Guardfile DSL.
29
+
30
+ ## Thanks
31
+
32
+ This gem is almost completely copied from the guard-less gem by Brendan Erwin. Thanks!
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
data/guard-krl.gemspec ADDED
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "guard-krl/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "guard-krl"
7
+ s.version = Guard::Krl::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Michael Farmer"]
10
+ s.email = ["mjf@kynetx.com"]
11
+ s.homepage = "http://code.kynetx.com"
12
+ s.summary = %q{Guard gem for krl}
13
+ s.description = %q{Guard gem for krl. Automatically runs krl commit.}
14
+
15
+ #s.rubyforge_project = "guard-krl"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+
22
+ s.add_dependency 'guard', '>= 0.2.2'
23
+ s.add_dependency 'krl'
24
+ end
@@ -0,0 +1,3 @@
1
+ guard 'krl' do
2
+ watch(/.*\.krl$/)
3
+ end
data/lib/guard/krl.rb ADDED
@@ -0,0 +1,40 @@
1
+ require 'guard'
2
+ require 'guard/guard'
3
+
4
+ module Guard
5
+ class Less < Guard
6
+
7
+ # ================
8
+ # = Guard method =
9
+ # ================
10
+
11
+ def start
12
+ UI.info "Watching your krl..."
13
+ end
14
+
15
+ # Call with Ctrl-/ signal
16
+ # This method should be principally used for long action like running all specs/tests/...
17
+ def run_all
18
+ patterns = @watchers.map { |w| w.pattern }
19
+ files = Dir.glob('**/*.*')
20
+ r = []
21
+ files.each do |file|
22
+ patterns.each do |pattern|
23
+ r << file if file.match(Regexp.new(pattern))
24
+ end
25
+ end
26
+ run_on_change(r)
27
+ end
28
+
29
+ # Call on file(s) modifications
30
+ def run_on_change(paths)
31
+ paths.each do |file|
32
+ unless File.basename(file)[0] == "_"
33
+ UI.info "Running commit for #{file}..."
34
+ `krl commit`
35
+ end
36
+ end
37
+ end
38
+
39
+ end
40
+ end
@@ -0,0 +1,5 @@
1
+ module Guard
2
+ module Krl
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-krl
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Michael Farmer
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-01-25 00:00:00 -07: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: 19
30
+ segments:
31
+ - 0
32
+ - 2
33
+ - 2
34
+ version: 0.2.2
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: krl
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 3
46
+ segments:
47
+ - 0
48
+ version: "0"
49
+ type: :runtime
50
+ version_requirements: *id002
51
+ description: Guard gem for krl. Automatically runs krl commit.
52
+ email:
53
+ - mjf@kynetx.com
54
+ executables: []
55
+
56
+ extensions: []
57
+
58
+ extra_rdoc_files: []
59
+
60
+ files:
61
+ - .gitignore
62
+ - Gemfile
63
+ - README.md
64
+ - Rakefile
65
+ - guard-krl.gemspec
66
+ - lib/guard-krl/version.rb
67
+ - lib/guard/krl.rb
68
+ - lib/guard/krl/templates/Guardfile
69
+ has_rdoc: true
70
+ homepage: http://code.kynetx.com
71
+ licenses: []
72
+
73
+ post_install_message:
74
+ rdoc_options: []
75
+
76
+ require_paths:
77
+ - lib
78
+ required_ruby_version: !ruby/object:Gem::Requirement
79
+ none: false
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ hash: 3
84
+ segments:
85
+ - 0
86
+ version: "0"
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ hash: 3
93
+ segments:
94
+ - 0
95
+ version: "0"
96
+ requirements: []
97
+
98
+ rubyforge_project:
99
+ rubygems_version: 1.4.1
100
+ signing_key:
101
+ specification_version: 3
102
+ summary: Guard gem for krl
103
+ test_files: []
104
+