slimwatch 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +15 -0
  2. data/bin/slimwatch.rb +43 -0
  3. metadata +43 -0
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MzE5MDU2Y2IxNTQ3MmY2ZDdkNGRhN2M0NDMxOWY2MmYxMzAwMjRkYw==
5
+ data.tar.gz: !binary |-
6
+ ZDJiNGU0OThlZDAxNTlmNjBiZmM3YWUwZmIyNjRjOTJjZDIxZTNkNQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ZmZiNmY5ZWM2MGVjNWNmYmYyYzkzZDhlMGY2N2ZmNGIyM2IwZGRiNTlkZWJm
10
+ NDQ0YmIwYzhhNTBmM2I4NDA5YWQzZjBmMzYzOWI3NjcxMGQyZmNlMTkxZDEw
11
+ Y2RmNWZkMjhkZGJkYmU0OTk3OWM2MmMzODBlNmJmMjJlOGIzMzE=
12
+ data.tar.gz: !binary |-
13
+ MDEzYmI3NWYwMGQzMTM3YWI4ODE3NDcwOTgwYjk1MTQ0MWIyZmU1MTQ3NmRh
14
+ YjExZDUxYjFlMDllNWJhZDlhMzU0ODE0MTIxYTdiMzk2NWYyNjYwN2JmYWU3
15
+ N2YxZThiZWNiMWM2NWUzYmE1MjdkMmE5Zjk2NjQ5Zjg5YjU3NmM=
data/bin/slimwatch.rb ADDED
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'listen'
4
+
5
+ if ARGV.count < 1
6
+ puts "Usage: [-scrtlpohv] [--trace] slimwatch SLIM_DIR\nFor option values, run slimrb --help"
7
+ exit
8
+ end
9
+
10
+ def main(listen_to, options)
11
+ # Initial run
12
+ Dir.glob("#{ listen_to }/*.slim").each do |filepath|
13
+ slim_it filepath, options
14
+ end
15
+
16
+ # Now listen
17
+ Listen.to(listen_to, :filter => /\.slim$/) do |modified, added, removed|
18
+
19
+ modified.each do |filepath|
20
+ slim_it(filepath, options)
21
+ end
22
+
23
+ added.each do |filepath|
24
+ slim_it(filepath, options)
25
+ end
26
+
27
+ removed.each do |filepath|
28
+ # ignoring these for now
29
+ end
30
+ end
31
+
32
+ end
33
+
34
+ def slim_it(filename, options)
35
+ infile = filename
36
+ outfile = infile.sub(/\.slim$/, '')
37
+
38
+ outfile<< '.html' unless outfile =~ /\.html?$/
39
+
40
+ system("slimrb #{ options } #{ infile } > #{ outfile }")
41
+ end
42
+
43
+ main(ARGV.pop, ARGV.count > 0 ? ARGV.join(' ') : '')
metadata ADDED
@@ -0,0 +1,43 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: slimwatch
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Aaron Craig
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-03-18 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Watches your SLIM files and compiles them to HTML when they change.
14
+ email: me@aaroncraig.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - bin/slimwatch.rb
20
+ homepage: https://github.com/aaroncraigongithub/slimwatch
21
+ licenses: []
22
+ metadata: {}
23
+ post_install_message:
24
+ rdoc_options: []
25
+ require_paths:
26
+ - lib
27
+ required_ruby_version: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ! '>='
30
+ - !ruby/object:Gem::Version
31
+ version: '0'
32
+ required_rubygems_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ! '>='
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ requirements: []
38
+ rubyforge_project:
39
+ rubygems_version: 2.0.3
40
+ signing_key:
41
+ specification_version: 4
42
+ summary: Lightweight command line SLIM template file watcher.
43
+ test_files: []