newjs 1.0.0 → 1.0.1

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/History.txt CHANGED
@@ -1,4 +1,11 @@
1
- == 0.0.1 2008-02-14
1
+ == 1.0.1 2008-02-15
2
+
3
+ * 1 major bugfix:
4
+ * install_website:
5
+ * website_upload now works
6
+ * uses config/website.yml
7
+
8
+ == 1.0.0 2008-02-14
2
9
 
3
10
  * 1 major enhancement:
4
11
  * Initial release
data/Manifest.txt CHANGED
@@ -37,6 +37,7 @@ lib/newjs/version.rb
37
37
  log/debug.log
38
38
  newjs_generators/install_website/USAGE
39
39
  newjs_generators/install_website/install_website_generator.rb
40
+ newjs_generators/install_website/templates/config/website.yml.sample.erb
40
41
  newjs_generators/install_website/templates/script/txt2html
41
42
  newjs_generators/install_website/templates/script/win_script.cmd
42
43
  newjs_generators/install_website/templates/tasks/website.rake
@@ -18,6 +18,9 @@ APP_DIST_DIR = File.join(APP_ROOT, 'dist')
18
18
  APP_PKG_DIR = File.join(APP_ROOT, 'pkg')
19
19
  APP_VERSION = '<%= version_str %>'
20
20
 
21
+
22
+ unless ENV['rakefile_just_config']
23
+
21
24
  task :default => [:dist, :package, :clean_package_source]
22
25
 
23
26
  desc "Builds the distribution"
@@ -80,3 +83,5 @@ task :clean_package_source do
80
83
  end
81
84
 
82
85
  Dir['tasks/**/*.rake'].each { |rake| load rake }
86
+
87
+ end
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 = 0
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -11,6 +11,7 @@ class InstallWebsiteGenerator < RubiGen::Base
11
11
 
12
12
  attr_reader :name, :module_name
13
13
  attr_reader :author, :email
14
+ attr_reader :username, :rubyforge_path
14
15
 
15
16
  def initialize(runtime_args, runtime_options = {})
16
17
  super
@@ -29,11 +30,15 @@ class InstallWebsiteGenerator < RubiGen::Base
29
30
  # Ensure appropriate folder(s) exists
30
31
  m.directory 'website/javascripts'
31
32
  m.directory 'website/stylesheets'
33
+ m.directory 'config'
32
34
  m.directory 'script'
33
35
  m.directory 'tasks'
34
36
 
35
37
  # Website
36
38
  m.template_copy_each %w( index.txt index.html ), "website"
39
+ m.template "config/website.yml.sample.erb", "config/website.yml.sample"
40
+
41
+ m.file_copy_each %w( website.rake ), "tasks"
37
42
 
38
43
  %w( txt2html ).each do |file|
39
44
  m.template "script/#{file}", "script/#{file}", script_options
@@ -41,7 +46,6 @@ class InstallWebsiteGenerator < RubiGen::Base
41
46
  :assigns => { :filename => file } if windows
42
47
  end
43
48
 
44
- m.file_copy_each %w[ website.rake ], "tasks"
45
49
 
46
50
  m.dependency "plain_theme", [], :destination => destination_root
47
51
  end
@@ -63,10 +67,15 @@ EOS
63
67
  # at the top of the file next to "default_options"
64
68
  opts.on("-a", "--author=\"Your Name\"", String,
65
69
  "You. The author of this RubyGem. You name goes in in the website.",
66
- "Default: 'TODO'") { |options[:author]| }
70
+ "Default: 'TODO'") { |x| options[:author] = x }
67
71
  opts.on("-e", "--email=your@email.com", String,
68
72
  "Your email for people to contact you.",
69
- "Default: nil") { |options[:author]| }
73
+ "Default: nil") { |x| options[:email] = x}
74
+ opts.on("-u", "--username=rubyforge_username", String,
75
+ "RubyForge username (if required)",
76
+ "Default: nil") { |x| options[:username] = x }
77
+ opts.on("--rubyforge_path=project_name", String,
78
+ "Default: nil") { |x| options[:rubyforge_path] = x }
70
79
  end
71
80
 
72
81
  def extract_options
@@ -75,5 +84,7 @@ EOS
75
84
  # raw instance variable value.
76
85
  @author = options[:author]
77
86
  @email = options[:email]
87
+ @username = options[:username] || "your_username"
88
+ @rubyforge_path = options[:rubyforge_path] || name
78
89
  end
79
90
  end
@@ -0,0 +1,2 @@
1
+ host: <%= username %>@rubyforge.org
2
+ remote_dir: /var/www/gforge-projects/<%= rubyforge_path %>
@@ -11,6 +11,7 @@ end
11
11
  require 'redcloth'
12
12
  require 'syntax/convertors/html'
13
13
  require 'erb'
14
+ ENV['rakefile_just_config'] = "true"
14
15
  load File.dirname(__FILE__) + '/../Rakefile'
15
16
 
16
17
  version = APP_VERSION
@@ -1,3 +1,21 @@
1
+ require 'yaml'
2
+
3
+ def website_config
4
+ unless @website_config
5
+ begin
6
+ @website_config = YAML.load(File.read(File.expand_path(File.dirname(__FILE__) + "/../config/website.yml")))
7
+ rescue
8
+ puts <<-EOS
9
+ To upload your website to a host, you need to configure
10
+ config/website.yml. See config/website.yml.sample for
11
+ an example.
12
+ EOS
13
+ exit
14
+ end
15
+ end
16
+ @website_config
17
+ end
18
+
1
19
  desc 'Generate website files'
2
20
  task :website_generate => :ruby_env do
3
21
  (Dir['website/**/*.txt'] - Dir['website/version*.txt']).each do |txt|
@@ -7,9 +25,9 @@ end
7
25
 
8
26
  desc 'Upload website files to rubyforge'
9
27
  task :website_upload do
10
- host = "#{rubyforge_username}@rubyforge.org"
11
- remote_dir = "/var/www/gforge-projects/#{PATH}/"
12
- local_dir = 'website'
28
+ host = website_config["host"] # "#{rubyforge_username}@rubyforge.org"
29
+ remote_dir = website_config["remote_dir"] # "/var/www/gforge-projects/#{PATH}/"
30
+ local_dir = 'website'
13
31
  sh %{rsync -aCv #{local_dir}/ #{host}:#{remote_dir}}
14
32
  end
15
33
 
@@ -20,6 +20,7 @@ class TestInstallWebsiteGenerator < Test::Unit::TestCase
20
20
  end
21
21
  assert_generated_file("script/txt2html")
22
22
  assert_generated_file("tasks/website.rake")
23
+ assert_generated_file("config/website.yml.sample")
23
24
  end
24
25
 
25
26
  private
data/website/index.html CHANGED
@@ -33,7 +33,7 @@
33
33
  <h1>JavaScript Project Generator</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/newjs"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/newjs" class="numbers">1.0.0</a>
36
+ <a href="http://rubyforge.org/projects/newjs" class="numbers">1.0.1</a>
37
37
  </div>
38
38
  <h1>&#x2192; &#8216;newjs&#8217;</h1>
39
39
 
@@ -220,7 +220,14 @@ The project&#8217;s version number is automatically inserted into the page
220
220
  (change version numbers via <code>APP_VERSION</code> in <code>Rakefile</code>).</p>
221
221
 
222
222
 
223
- <p>To upload the website (and its <span class="caps">CSS</span>)</p>
223
+ <p>To upload the website (and its <span class="caps">CSS</span> etc) run:</p>
224
+
225
+
226
+ <pre>rake website</pre>
227
+
228
+ <p>The default <code>tasks/website.rake</code> file pushes the files
229
+ to a <a href="http://rubyforge.org">rubyforge.org</a> project account. Modify it
230
+ to rsync files elsewhere.</p>
224
231
 
225
232
 
226
233
  <h2>Screencast coming soon</h2>
data/website/index.txt CHANGED
@@ -150,7 +150,13 @@ And open <code>website/index.html</code> in your browser to preview.
150
150
  The project's version number is automatically inserted into the page
151
151
  (change version numbers via <code>APP_VERSION</code> in <code>Rakefile</code>).
152
152
 
153
- To upload the website (and its CSS)
153
+ To upload the website (and its CSS etc) run:
154
+
155
+ <pre>rake website</pre>
156
+
157
+ The default <code>tasks/website.rake</code> file pushes the files
158
+ to a "rubyforge.org":http://rubyforge.org project account. Modify it
159
+ to rsync files elsewhere.
154
160
 
155
161
  h2. Screencast coming soon
156
162
 
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.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dr Nic Williams
@@ -103,6 +103,7 @@ files:
103
103
  - log/debug.log
104
104
  - newjs_generators/install_website/USAGE
105
105
  - newjs_generators/install_website/install_website_generator.rb
106
+ - newjs_generators/install_website/templates/config/website.yml.sample.erb
106
107
  - newjs_generators/install_website/templates/script/txt2html
107
108
  - newjs_generators/install_website/templates/script/win_script.cmd
108
109
  - newjs_generators/install_website/templates/tasks/website.rake