guard-coffeedripper 0.1.1 → 0.1.2

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/README.md CHANGED
@@ -0,0 +1,39 @@
1
+ Guard::CoffeeDripper
2
+ ====
3
+ Guard::CoffeeDripper is MargeTool for CoffeeScript
4
+
5
+ Install
6
+ ----
7
+ Install the gem:
8
+
9
+ gem install guard-coffeedripper
10
+
11
+ Add it to your Gemfile (inside test group):
12
+
13
+ gem 'guard-coffeedripper'
14
+
15
+ Add coffeedripper definition to your Guardfile and config/coffee-dripper.yaml by running this command:
16
+
17
+ guard init coffeedripper
18
+
19
+ Usage
20
+ ----
21
+
22
+ Please read Guard usage doc
23
+ Guardfile for Rails3.0 and barista
24
+
25
+ guard 'coffeedripper', :output => 'app/coffscripts/' do
26
+ watch(%r{^app/coffeescripts/(.+)\.bean$}) {|m| "#{m[1]}.bean"}
27
+ end
28
+
29
+ or Rails3.1
30
+
31
+ guard 'coffeedripper', :output => 'app/assets/javascripts/' do
32
+ watch(%r{^app/assets/javascripts/(.+)\.bean$}) {|m| "#{m[1]}.bean"}
33
+ end
34
+
35
+ config/coffee-dipper.yaml
36
+ appplication.js.coffee:
37
+ - hoge.bean
38
+ - huga.bean
39
+
@@ -1,3 +1,12 @@
1
- guard 'coffeedripper' do
2
- watch(%r{^app/coffeescripts/(.+)\.bean$})
3
- end
1
+ #
2
+ # example for coffeedripper and barista
3
+ #
4
+ guard 'coffeedripper' do
5
+ watch(%r{^app/coffeescripts/(.+)\.bean$}) {|m| "#{m[1]}.bean"}
6
+ end
7
+ #
8
+ # example for coffeedripper and rails3.1
9
+ #
10
+ guard 'coffeedripper', :output => 'app/assets/javascripts/' do
11
+ watch(%r{^app/assets/javascripts/(.+)\.bean$}) {|m| "#{m[1]}.bean"}
12
+ end
@@ -0,0 +1,12 @@
1
+ ################
2
+ # Example
3
+ # application.js.cofee and hoge.coffee is output file name
4
+ # part1.bean, part2.bean part3.bean is input filename writen by coffeescript
5
+ ################
6
+ # application.js.coffee:
7
+ # - part1.bean
8
+ # - part2.bean
9
+ # ho.js.coffee
10
+ # - part1.bean
11
+ # - part3.bean
12
+
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module CoffeeDripperVersion
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
  end
5
5
  end
@@ -6,13 +6,23 @@ module Guard
6
6
  class CoffeeDripper < Guard
7
7
 
8
8
  attr_accessor :config
9
+ def self.init(guard_name = nil)
10
+ if !File.exist?("config/coffeedripper.yaml")
11
+ puts "Writing new Guardfile to #{Dir.pwd}/config/coffee-dripper.yaml"
12
+ FileUtils.cp(File.expand_path('../coffeedripper/templates/coffee-dripper.yaml', __FILE__), 'config/coffee-dripper.yaml')
13
+ elsif guard_name.nil?
14
+ ::Guard::UI.error "Guardfile already exists at #{Dir.pwd}/config/coffee-dripper.yaml"
15
+ exit 1
16
+ end
17
+ end
18
+
9
19
  def initialize(watchers=[], options={})
10
20
  super
11
21
  @watchers, @options = watchers, options
12
22
  @options[:output] ||= 'app/coffeescripts/'
13
23
  @options[:input] ||= 'app/coffeescripts/'
14
- @options[:ext] ||= 'coffeebean'
15
- @options[:config] ||= 'config/coffeedripper.yaml'
24
+ @options[:ext] ||= 'bean'
25
+ @options[:config] ||= 'config/coffee-dripper.yaml'
16
26
  load_config
17
27
  end
18
28
 
@@ -46,7 +56,7 @@ module Guard
46
56
  str += load_bean(bean)
47
57
  end
48
58
  write(output, str)
49
- puts "Dripped End #{output}"
59
+ puts "Drip End #{output}"
50
60
  end
51
61
 
52
62
  def load_bean(bean)
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: guard-coffeedripper
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.1
5
+ version: 0.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - amacou
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-06-12 00:00:00 +09:00
13
+ date: 2011-06-19 00:00:00 +09:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -56,6 +56,7 @@ extensions: []
56
56
  extra_rdoc_files: []
57
57
 
58
58
  files:
59
+ - lib/guard/coffeedripper/templates/coffee-dripper.yaml
59
60
  - lib/guard/coffeedripper/templates/Guardfile
60
61
  - lib/guard/coffeedripper/version.rb
61
62
  - lib/guard/coffeedripper.rb