js2 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/Manifest CHANGED
@@ -23,6 +23,7 @@ lib/js2/util/js2bootstrap.js2
23
23
  lib/js2/util/processor.rb
24
24
  lib/js2/util/rdoc.rb
25
25
  lib/js2/util/sel_decorator.rb
26
+ lib/js2/util/haml_filter.rb
26
27
  test/compiled/bar.js
27
28
  test/compiled/basic.comp.js
28
29
  test/compiled/basic.js
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- JS2_VERSION = '0.1.1'
5
+ JS2_VERSION = '0.1.2'
6
6
  Echoe.new('js2', JS2_VERSION) do |p|
7
7
  p.description = ""
8
8
  p.url = "http://github.com/jeffsu/js2"
data/bin/js2 CHANGED
@@ -116,6 +116,8 @@ if main_action == 'daemon'
116
116
  end
117
117
  elsif main_action == 'compile'
118
118
  puts "compiling once! use daemon to monitor changes and compile automatically."
119
+ res = processor.process!
120
+ puts "Compiling #{Time.now}..." if res[:changed].any?
119
121
  elsif main_action == 'rdoc'
120
122
  res = processor.process!
121
123
  JS2::Util::Rdoc.build(res[:klasses])
data/js2.gemspec CHANGED
@@ -2,30 +2,30 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{js2}
5
- s.version = "0.1.1"
5
+ s.version = "0.1.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jeff Su"]
9
- s.date = %q{2010-04-19}
9
+ s.date = %q{2010-09-06}
10
10
  s.default_executable = %q{js2}
11
11
  s.description = %q{}
12
12
  s.email = %q{me@jeffsu.com}
13
13
  s.executables = ["js2"]
14
- s.extra_rdoc_files = ["README.md", "bin/js2", "lib/js2.rb", "lib/js2/parser/haml.rb", "lib/js2/parser/haml_engine.rb", "lib/js2/parser/lexer.rb", "lib/js2/parser/tokenizer.rb", "lib/js2/ragel/helper.rb", "lib/js2/ragel/tokenizer.rl", "lib/js2/ragel/tokenizer.rl.erb", "lib/js2/standard/class_node.rb", "lib/js2/standard/factory.rb", "lib/js2/standard/node.rb", "lib/js2/util/compilation.rb", "lib/js2/util/config.rb", "lib/js2/util/exec.rb", "lib/js2/util/file_handler.rb", "lib/js2/util/js2bootstrap.js2", "lib/js2/util/processor.rb", "lib/js2/util/rdoc.rb", "lib/js2/util/sel_decorator.rb"]
15
- s.files = ["Manifest", "README.md", "Rakefile", "bin/js2", "config/js2.yml", "js2.gemspec", "lib/js2.rb", "lib/js2/parser/haml.rb", "lib/js2/parser/haml_engine.rb", "lib/js2/parser/lexer.rb", "lib/js2/parser/tokenizer.rb", "lib/js2/ragel/helper.rb", "lib/js2/ragel/tokenizer.rl", "lib/js2/ragel/tokenizer.rl.erb", "lib/js2/standard/class_node.rb", "lib/js2/standard/factory.rb", "lib/js2/standard/node.rb", "lib/js2/util/compilation.rb", "lib/js2/util/config.rb", "lib/js2/util/exec.rb", "lib/js2/util/file_handler.rb", "lib/js2/util/js2bootstrap.js2", "lib/js2/util/processor.rb", "lib/js2/util/rdoc.rb", "lib/js2/util/sel_decorator.rb", "test/compiled/bar.js", "test/compiled/basic.comp.js", "test/compiled/basic.js", "test/compiled/foo.js", "test/fixtures/bar.js2", "test/fixtures/basic.js2", "test/fixtures/basic.js2.haml", "test/fixtures/basic.js2.yml", "test/fixtures/curry.js2", "test/fixtures/foo.js2", "test/fixtures/member.js2", "test/fixtures/private.js2", "test/fixtures/property.js2", "test/test_helper.rb", "test/test_js2.rb", "wiki/features.md", "wiki/installation.md"]
14
+ s.extra_rdoc_files = ["README.md", "bin/js2", "lib/js2.rb", "lib/js2/parser/haml.rb", "lib/js2/parser/haml_engine.rb", "lib/js2/parser/lexer.rb", "lib/js2/parser/tokenizer.rb", "lib/js2/ragel/helper.rb", "lib/js2/ragel/tokenizer.rl", "lib/js2/ragel/tokenizer.rl.erb", "lib/js2/standard/class_node.rb", "lib/js2/standard/factory.rb", "lib/js2/standard/node.rb", "lib/js2/util/compilation.rb", "lib/js2/util/config.rb", "lib/js2/util/exec.rb", "lib/js2/util/file_handler.rb", "lib/js2/util/js2bootstrap.js2", "lib/js2/util/processor.rb", "lib/js2/util/rdoc.rb", "lib/js2/util/sel_decorator.rb", "lib/js2/util/haml_filter.rb"]
15
+ s.files = ["Manifest", "README.md", "Rakefile", "bin/js2", "config/js2.yml", "js2.gemspec", "lib/js2.rb", "lib/js2/parser/haml.rb", "lib/js2/parser/haml_engine.rb", "lib/js2/parser/lexer.rb", "lib/js2/parser/tokenizer.rb", "lib/js2/ragel/helper.rb", "lib/js2/ragel/tokenizer.rl", "lib/js2/ragel/tokenizer.rl.erb", "lib/js2/standard/class_node.rb", "lib/js2/standard/factory.rb", "lib/js2/standard/node.rb", "lib/js2/util/compilation.rb", "lib/js2/util/config.rb", "lib/js2/util/exec.rb", "lib/js2/util/file_handler.rb", "lib/js2/util/js2bootstrap.js2", "lib/js2/util/processor.rb", "lib/js2/util/rdoc.rb", "lib/js2/util/sel_decorator.rb", "lib/js2/util/haml_filter.rb", "test/compiled/bar.js", "test/compiled/basic.comp.js", "test/compiled/basic.js", "test/compiled/foo.js", "test/fixtures/bar.js2", "test/fixtures/basic.js2", "test/fixtures/basic.js2.haml", "test/fixtures/basic.js2.yml", "test/fixtures/curry.js2", "test/fixtures/foo.js2", "test/fixtures/member.js2", "test/fixtures/private.js2", "test/fixtures/property.js2", "test/test_helper.rb", "test/test_js2.rb", "wiki/features.md", "wiki/installation.md"]
16
16
  s.homepage = %q{http://github.com/jeffsu/js2}
17
17
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Js2", "--main", "README.md"]
18
18
  s.require_paths = ["lib"]
19
19
  s.rubyforge_project = %q{js2}
20
- s.rubygems_version = %q{1.3.6}
20
+ s.rubygems_version = %q{1.3.7}
21
21
  s.summary = %q{}
22
- s.test_files = ["test/test_helper.rb", "test/test_js2.rb"]
22
+ s.test_files = ["test/test_js2.rb", "test/test_helper.rb"]
23
23
 
24
24
  if s.respond_to? :specification_version then
25
25
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
26
26
  s.specification_version = 3
27
27
 
28
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
28
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
29
29
  else
30
30
  end
31
31
  else
@@ -0,0 +1,13 @@
1
+ module Haml
2
+ module Filters
3
+ module Js2
4
+ include ::Haml::Filters::Base
5
+ CONFIG = JS2::Util::Config.new
6
+
7
+ def render(text)
8
+ page_node = CONFIG.lexer.parse(text, CONFIG.node_factory)
9
+ return %{<script language="JavaScript">#{page_node.to_s}</script>}
10
+ end
11
+ end
12
+ end
13
+ end
data/lib/js2.rb CHANGED
@@ -30,3 +30,7 @@ require "#{dir}/js2/util/file_handler"
30
30
  require "#{dir}/js2/util/config"
31
31
  require "#{dir}/js2/util/compilation"
32
32
  require "#{dir}/js2/util/rdoc"
33
+
34
+ if defined?(Haml)
35
+ require "#{dir}/js2/util/haml_filter"
36
+ end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: js2
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 31
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 1
8
- - 1
9
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
10
11
  platform: ruby
11
12
  authors:
12
13
  - Jeff Su
@@ -14,8 +15,8 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-04-19 00:00:00 -07:00
18
- default_executable:
18
+ date: 2010-09-06 00:00:00 +08:00
19
+ default_executable: js2
19
20
  dependencies: []
20
21
 
21
22
  description: ""
@@ -46,6 +47,7 @@ extra_rdoc_files:
46
47
  - lib/js2/util/processor.rb
47
48
  - lib/js2/util/rdoc.rb
48
49
  - lib/js2/util/sel_decorator.rb
50
+ - lib/js2/util/haml_filter.rb
49
51
  files:
50
52
  - Manifest
51
53
  - README.md
@@ -72,6 +74,7 @@ files:
72
74
  - lib/js2/util/processor.rb
73
75
  - lib/js2/util/rdoc.rb
74
76
  - lib/js2/util/sel_decorator.rb
77
+ - lib/js2/util/haml_filter.rb
75
78
  - test/compiled/bar.js
76
79
  - test/compiled/basic.comp.js
77
80
  - test/compiled/basic.js
@@ -104,16 +107,20 @@ rdoc_options:
104
107
  require_paths:
105
108
  - lib
106
109
  required_ruby_version: !ruby/object:Gem::Requirement
110
+ none: false
107
111
  requirements:
108
112
  - - ">="
109
113
  - !ruby/object:Gem::Version
114
+ hash: 3
110
115
  segments:
111
116
  - 0
112
117
  version: "0"
113
118
  required_rubygems_version: !ruby/object:Gem::Requirement
119
+ none: false
114
120
  requirements:
115
121
  - - ">="
116
122
  - !ruby/object:Gem::Version
123
+ hash: 11
117
124
  segments:
118
125
  - 1
119
126
  - 2
@@ -121,10 +128,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
128
  requirements: []
122
129
 
123
130
  rubyforge_project: js2
124
- rubygems_version: 1.3.6
131
+ rubygems_version: 1.3.7
125
132
  signing_key:
126
133
  specification_version: 3
127
134
  summary: ""
128
135
  test_files:
129
- - test/test_helper.rb
130
136
  - test/test_js2.rb
137
+ - test/test_helper.rb