newjs 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 1.4.1 2008-06-21
2
+
3
+ * rstakeout: fixed !# ruby
4
+ * newjs: creates src/proj_name.js.erb to show its a template, not a js file
5
+
1
6
  == 1.4.0 2008-05-03
2
7
 
3
8
  * javascript_test: nested folders for tests; e.g. javascript_test models/game -> test/javascript/models/game_test.html
@@ -1,18 +1,18 @@
1
1
  class NewjsGenerator < RubiGen::Base
2
2
  DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
3
3
  Config::CONFIG['ruby_install_name'])
4
-
4
+
5
5
  default_options :shebang => DEFAULT_SHEBANG,
6
6
  :author => nil,
7
7
  :email => nil,
8
8
  :version => '0.0.1'
9
-
10
-
9
+
10
+
11
11
  attr_reader :name, :module_name
12
12
  attr_reader :version, :version_str, :author, :email
13
13
  attr_reader :title, :url
14
-
15
-
14
+
15
+
16
16
  def initialize(runtime_args, runtime_options = {})
17
17
  super
18
18
  usage if args.empty?
@@ -27,7 +27,7 @@ class NewjsGenerator < RubiGen::Base
27
27
  def manifest
28
28
  script_options = { :chmod => 0755, :shebang => options[:shebang] == DEFAULT_SHEBANG ? nil : options[:shebang] }
29
29
  windows = (RUBY_PLATFORM =~ /dos|win32|cygwin/i) || (RUBY_PLATFORM =~ /(:?mswin|mingw)/)
30
-
30
+
31
31
  record do |m|
32
32
  # Ensure appropriate folder(s) exists
33
33
  m.directory ''
@@ -39,16 +39,16 @@ class NewjsGenerator < RubiGen::Base
39
39
  m.file_copy_each %w[protodoc.rb jstest.rb], "lib"
40
40
  m.template_copy_each %w[Rakefile.erb README.txt.erb History.txt.erb License.txt.erb]
41
41
  m.template_copy_each %w[HEADER.erb], "src"
42
- m.template "src/library.js.erb", "src/#{name}.js"
43
-
42
+ m.template "src/library.js.erb", "src/#{name}.js.erb"
43
+
44
44
  %w[rstakeout js_autotest].each do |file|
45
45
  m.template "script/#{file}", "script/#{file}", script_options
46
- m.template "script/win_script.cmd", "script/#{file}.cmd",
46
+ m.template "script/win_script.cmd", "script/#{file}.cmd",
47
47
  :assigns => { :filename => file } if windows
48
48
  end
49
-
50
- m.dependency "install_rubigen_scripts",
51
- [destination_root, 'javascript', 'javascript_test', 'newjs', 'newjs_theme'],
49
+
50
+ m.dependency "install_rubigen_scripts",
51
+ [destination_root, 'javascript', 'javascript_test', 'newjs', 'newjs_theme'],
52
52
  :shebang => options[:shebang], :collision => :force
53
53
  end
54
54
  end
@@ -82,7 +82,7 @@ EOS
82
82
  "Initial version of the project you are creating.",
83
83
  "Default: 0.0.1") { |x| options[:version] = x }
84
84
  end
85
-
85
+
86
86
  def extract_options
87
87
  @version = options[:version].to_s.split(/\./)
88
88
  @version_str = @version.join('.')
@@ -15,6 +15,7 @@ $:.unshift File.dirname(__FILE__) + "/lib"
15
15
  APP_VERSION = '<%= version_str %>'
16
16
  APP_NAME = '<%= name %>'
17
17
  RUBYFORGE_PROJECT = APP_NAME
18
+ APP_TEMPLATE = "#{APP_NAME}.js.erb"
18
19
  APP_FILE_NAME= "#{APP_NAME}.js"
19
20
 
20
21
  APP_ROOT = File.expand_path(File.dirname(__FILE__))
@@ -36,7 +37,7 @@ task :dist do
36
37
 
37
38
  Dir.chdir(APP_SRC_DIR) do
38
39
  File.open(File.join(APP_DIST_DIR, APP_FILE_NAME), 'w+') do |dist|
39
- dist << Protodoc::Preprocessor.new(APP_FILE_NAME)
40
+ dist << Protodoc::Preprocessor.new(APP_TEMPLATE)
40
41
  end
41
42
  end
42
43
  Dir.chdir(APP_DIST_DIR) do
@@ -1,5 +1,4 @@
1
- #!/usr/local/bin/ruby -w
2
-
1
+ #!/usr/bin/env ruby
3
2
 
4
3
  config = File.dirname(__FILE__) + "/../config/javascript_test_autotest.yml"
5
4
  unless File.exists?(config)
data/lib/newjs/version.rb CHANGED
@@ -2,7 +2,7 @@ module Newjs #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 1
4
4
  MINOR = 4
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -1,5 +1,4 @@
1
- #!/usr/local/bin/ruby -w
2
-
1
+ #!/usr/bin/env ruby
3
2
 
4
3
  config = File.dirname(__FILE__) + "/../config/javascript_test_autotest.yml"
5
4
  unless File.exists?(config)
@@ -6,11 +6,11 @@ class TestNewjsGenerator < Test::Unit::TestCase
6
6
  def setup
7
7
  bare_setup
8
8
  end
9
-
9
+
10
10
  def teardown
11
11
  bare_teardown
12
12
  end
13
-
13
+
14
14
  # Some generator-related assertions:
15
15
  # assert_generated_file(name, &block) # block passed the file contents
16
16
  # assert_directory_exists(name)
@@ -24,7 +24,7 @@ class TestNewjsGenerator < Test::Unit::TestCase
24
24
  # app_root_files - put this in teardown to show files generated by the test method (e.g. p app_root_files)
25
25
  # bare_setup - place this in setup method to create the APP_ROOT folder for each test
26
26
  # bare_teardown - place this in teardown method to destroy the TMP_ROOT or APP_ROOT folder after each test
27
-
27
+
28
28
  def test_generator_without_options
29
29
  run_generator('newjs', [APP_ROOT], sources)
30
30
  assert_directory_exists "lib"
@@ -45,18 +45,18 @@ class TestNewjsGenerator < Test::Unit::TestCase
45
45
  assert_generated_file "tasks/environment.rake"
46
46
  assert_generated_file "tasks/deploy.rake"
47
47
  assert_generated_file "config/javascript_test_autotest.yml.sample"
48
- assert_generated_file "src/myproject.js"
48
+ assert_generated_file "src/myproject.js.erb"
49
49
  assert_generated_file "src/HEADER"
50
50
  assert_generated_file "lib/protodoc.rb"
51
51
  assert_generated_file "lib/jstest.rb"
52
52
  end
53
-
53
+
54
54
  private
55
55
  def sources
56
56
  [RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path))
57
57
  ]
58
58
  end
59
-
59
+
60
60
  def generator_path
61
61
  "app_generators"
62
62
  end
data/website/index.html CHANGED
@@ -31,7 +31,7 @@
31
31
  <h1>JavaScript Project Generator</h1>
32
32
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/newjs"; return false'>
33
33
  <p>Get Version</p>
34
- <a href="http://rubyforge.org/projects/newjs" class="numbers">1.4.0</a>
34
+ <a href="http://rubyforge.org/projects/newjs" class="numbers">1.4.1</a>
35
35
  </div>
36
36
  <h1>&#x2192; &#8216;newjs&#8217;</h1>
37
37
 
@@ -144,7 +144,7 @@ test file(s). By default you&#8217;d call it <code>test/some_lib_test.html</code
144
144
  <h3>Generating test <span class="caps">HTML</span> files</h3>
145
145
 
146
146
 
147
- <p>And then what? Personally, I can never remember what basic <span class="caps">HTML</span> + JavaScript
147
+ <p>And then what? Personally, I can never remember what basic <span class="caps">HTML </span>+ JavaScript
148
148
  goes in the test <span class="caps">HTML</span> files. I quite like the <a href="http://drnicwilliams.com/2008/01/04/autotesting-javascript-in-rails/">javascript_test plugin</a> for <a href="http://www.rubyonrails.org/">Ruby
149
149
  on Rails</a>, which allows you to generate a
150
150
  test <span class="caps">HTML</span> stub. So I&#8217;ve included a version of it
@@ -415,7 +415,7 @@ and you&#8217;ll love every minute of it.</p>
415
415
 
416
416
  <p>Comments are welcome. Send an email to <a href="mailto:drnicwilliams@gmail.com">Dr Nic Williams</a> via the <a href="http://groups.google.com/group/javascript-project-generator">forum</a></p>
417
417
  <p class="coda">
418
- <a href="drnicwilliams@gmail.com">Dr Nic Williams</a>, 17th February 2008<br>
418
+ <a href="drnicwilliams@gmail.com">Dr Nic Williams</a>, 21st June 2008<br>
419
419
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
420
420
  </p>
421
421
  </div>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newjs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dr Nic Williams
@@ -9,11 +9,12 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-05-03 00:00:00 +10:00
12
+ date: 2008-07-08 00:00:00 +10:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: RedCloth
17
+ type: :runtime
17
18
  version_requirement:
18
19
  version_requirements: !ruby/object:Gem::Requirement
19
20
  requirements:
@@ -23,6 +24,7 @@ dependencies:
23
24
  version:
24
25
  - !ruby/object:Gem::Dependency
25
26
  name: syntax
27
+ type: :runtime
26
28
  version_requirement:
27
29
  version_requirements: !ruby/object:Gem::Requirement
28
30
  requirements:
@@ -32,6 +34,7 @@ dependencies:
32
34
  version:
33
35
  - !ruby/object:Gem::Dependency
34
36
  name: activesupport
37
+ type: :runtime
35
38
  version_requirement:
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
@@ -41,6 +44,7 @@ dependencies:
41
44
  version:
42
45
  - !ruby/object:Gem::Dependency
43
46
  name: rubigen
47
+ type: :runtime
44
48
  version_requirement:
45
49
  version_requirements: !ruby/object:Gem::Requirement
46
50
  requirements:
@@ -48,6 +52,16 @@ dependencies:
48
52
  - !ruby/object:Gem::Version
49
53
  version: 1.2.2
50
54
  version:
55
+ - !ruby/object:Gem::Dependency
56
+ name: hoe
57
+ type: :development
58
+ version_requirement:
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 1.7.0
64
+ version:
51
65
  description: = New JavaScript Generator - newjs * http://newjs.rubyforge.org == Description
52
66
  email:
53
67
  - drnicwilliams@gmail.com
@@ -182,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
196
  requirements: []
183
197
 
184
198
  rubyforge_project: newjs
185
- rubygems_version: 1.1.1
199
+ rubygems_version: 1.2.0
186
200
  signing_key:
187
201
  specification_version: 2
188
202
  summary: = New JavaScript Generator - newjs