stitch-rb 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/stitch.rb CHANGED
@@ -4,7 +4,6 @@ require "stitch/version"
4
4
  module Stitch
5
5
  autoload :Compiler, "stitch/compiler"
6
6
  autoload :Package, "stitch/package"
7
- autoload :Dependency, "stitch/dependency"
8
7
  autoload :Source, "stitch/source"
9
8
  autoload :Server, "stitch/server"
10
9
  end
@@ -11,7 +11,7 @@ module Stitch
11
11
 
12
12
  def compile(path)
13
13
  source = File.read(path)
14
- CoffeeScript.compile(source)
14
+ CoffeeScript.compile(source, :filename => path.to_s)
15
15
  end
16
16
  end
17
17
  end
@@ -21,7 +21,7 @@ module Stitch
21
21
  protected
22
22
  def compile_dependencies
23
23
  @dependencies.map {|path|
24
- Dependency.from_path(path)
24
+ Source.from_path(path)
25
25
  }.flatten.map { |dep|
26
26
  dep.compile
27
27
  }.join("\n")
@@ -1,3 +1,3 @@
1
1
  module Stitch
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,29 +1,23 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: stitch-rb
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.5
4
5
  prerelease:
5
- version: 0.0.4
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Alex MacCaw
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-07-19 00:00:00 -04:00
14
- default_executable:
12
+ date: 2011-10-19 00:00:00.000000000Z
15
13
  dependencies: []
16
-
17
14
  description: A JavaScript package manager
18
- email:
15
+ email:
19
16
  - maccman@gmail.com
20
17
  executables: []
21
-
22
18
  extensions: []
23
-
24
19
  extra_rdoc_files: []
25
-
26
- files:
20
+ files:
27
21
  - .gitignore
28
22
  - Gemfile
29
23
  - LICENSE
@@ -40,39 +34,33 @@ files:
40
34
  - lib/stitch/compilers/coffeescript.rb
41
35
  - lib/stitch/compilers/javascript.rb
42
36
  - lib/stitch/compilers/tmpl.rb
43
- - lib/stitch/dependency.rb
44
37
  - lib/stitch/package.rb
45
38
  - lib/stitch/server.rb
46
39
  - lib/stitch/source.rb
47
40
  - lib/stitch/version.rb
48
41
  - stitch.gemspec
49
- has_rdoc: true
50
- homepage: ""
42
+ homepage: ''
51
43
  licenses: []
52
-
53
44
  post_install_message:
54
45
  rdoc_options: []
55
-
56
- require_paths:
46
+ require_paths:
57
47
  - lib
58
- required_ruby_version: !ruby/object:Gem::Requirement
48
+ required_ruby_version: !ruby/object:Gem::Requirement
59
49
  none: false
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: "0"
64
- required_rubygems_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
55
  none: false
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- version: "0"
56
+ requirements:
57
+ - - ! '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
70
60
  requirements: []
71
-
72
61
  rubyforge_project:
73
- rubygems_version: 1.6.0
62
+ rubygems_version: 1.8.6
74
63
  signing_key:
75
64
  specification_version: 3
76
65
  summary: Stitch ported to Ruby
77
66
  test_files: []
78
-
@@ -1,44 +0,0 @@
1
- require "pathname"
2
-
3
- module Stitch
4
- class Dependency
5
- class << self
6
- def from_path(path, result = [])
7
- path = Pathname.new(path)
8
-
9
- if path.directory?
10
- path.children.each do |child|
11
- from_path(child, result)
12
- end
13
- else
14
- dependency = self.new(path)
15
- result << dependency if dependency.valid?
16
- end
17
- result
18
- end
19
- end
20
-
21
- attr_reader :path
22
-
23
- def initialize(path)
24
- @path = Pathname.new(path)
25
- end
26
-
27
- def ext
28
- path.extname
29
- end
30
-
31
- def compile
32
- compiler.compile(path)
33
- end
34
-
35
- def valid?
36
- !!compiler
37
- end
38
-
39
- protected
40
- def compiler
41
- Compiler.for_extension(ext)
42
- end
43
- end
44
- end