stitch_rails 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -25,7 +25,8 @@ module YourApp
25
25
  # file names listed here are not wraped in `require.define`, so they
26
26
  # are executed immediatly. Handy for an app start point. Otherwise you
27
27
  # have add an .js file to require your start file. Suffix should not be added here.
28
- config.stitch.excludes = %w(application spec jasminerice)
28
+ # Glob pattern is also supported.
29
+ config.stitch.excludes = %w(application *_spec jasminerice)
29
30
  end
30
31
  end
31
32
  ```
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.6
1
+ 0.0.7
@@ -40,13 +40,13 @@ module Stitch
40
40
 
41
41
  def evaluate(scope, locals, &block)
42
42
  name = module_name(scope)
43
- if (name == 'stitch_rails') || @@excludes.include?(name)
43
+ if (name == 'stitch_rails') || excluded?(name)
44
44
  @output ||= CoffeeScript.compile(data, options)
45
45
  else
46
46
  @output ||= <<JS
47
47
  require.define({
48
- '#{name}': function(exports, require, module) {
49
- #{CoffeeScript.compile(data, options.merge(:bare => true))}
48
+ #{name.inspect}: function(exports, require, module) {
49
+ #{indent_lines(CoffeeScript.compile(data, options.merge(:bare => true)), 4)}
50
50
  }
51
51
  });
52
52
  JS
@@ -54,6 +54,13 @@ JS
54
54
  end
55
55
 
56
56
  private
57
+ def excluded?(name)
58
+ @@excludes.any? { |pattern| File.fnmatch(pattern, name) }
59
+ end
60
+
61
+ def indent_lines(content, indention)
62
+ content.gsub(/^/, ' ' * indention)
63
+ end
57
64
  # this might need to be customisable to generate the desired module names
58
65
  # this implementation lops off the first segment of the path
59
66
  def module_name(scope)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "stitch_rails"
8
- s.version = "0.0.6"
8
+ s.version = "0.0.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ian Yang"]
12
- s.date = "2012-03-12"
12
+ s.date = "2012-03-15"
13
13
  s.description = "coffee CommonJS"
14
14
  s.email = "me@iany.me"
15
15
  s.extra_rdoc_files = [
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
32
32
  s.homepage = "http://github.com/doitian/stitch_rails"
33
33
  s.licenses = ["MIT"]
34
34
  s.require_paths = ["lib"]
35
- s.rubygems_version = "1.8.10"
35
+ s.rubygems_version = "1.8.11"
36
36
  s.summary = "coffee CommonJS"
37
37
 
38
38
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stitch_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-12 00:00:00.000000000Z
12
+ date: 2012-03-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: tilt
16
- requirement: &2153429660 !ruby/object:Gem::Requirement
16
+ requirement: &13070080 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2153429660
24
+ version_requirements: *13070080
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &2153428460 !ruby/object:Gem::Requirement
27
+ requirement: &13069600 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.0.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2153428460
35
+ version_requirements: *13069600
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: jeweler
38
- requirement: &2153427500 !ruby/object:Gem::Requirement
38
+ requirement: &13068860 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 1.8.3
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2153427500
46
+ version_requirements: *13068860
47
47
  description: coffee CommonJS
48
48
  email: me@iany.me
49
49
  executables: []
@@ -78,7 +78,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
78
78
  version: '0'
79
79
  segments:
80
80
  - 0
81
- hash: 1504000617516445167
81
+ hash: 1416462135696716510
82
82
  required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  requirements: []
89
89
  rubyforge_project:
90
- rubygems_version: 1.8.10
90
+ rubygems_version: 1.8.11
91
91
  signing_key:
92
92
  specification_version: 3
93
93
  summary: coffee CommonJS