webby 0.7.2 → 0.7.3

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,3 +1,10 @@
1
+ == 0.7.3 / 2008-02-05
2
+
3
+ * 2 bug fixes
4
+ - The setup.rb task now requires rubygems in case it is not in the
5
+ user's rubyopt
6
+ - Fixed file line endings on Windows when creating a new site
7
+
1
8
  == 0.7.2 / 2008-02-02
2
9
 
3
10
  * 4 minor enhancements
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- # $Id: Rakefile 124 2008-02-03 00:24:10Z tim_pease $
1
+ # $Id: Rakefile 130 2008-02-04 22:28:22Z tim_pease $
2
2
 
3
3
  load 'tasks/setup.rb'
4
4
 
@@ -33,6 +33,7 @@ depend_on 'directory_watcher'
33
33
  depend_on 'heel'
34
34
  depend_on 'hpricot'
35
35
  depend_on 'logging', '0.6.1'
36
+ depend_on 'rake'
36
37
  depend_on 'rspec'
37
38
  depend_on 'RedCloth'
38
39
 
@@ -1,4 +1,4 @@
1
- ---
1
+ ---
2
2
  extension: css
3
3
  filter: erb
4
4
  layout: nil # no layout
@@ -13,7 +13,7 @@ color:
13
13
  highlight: "#B2CCFF"
14
14
  quiet: "#666"
15
15
  alt: "#666"
16
- ---
16
+ ---
17
17
 
18
18
  body {
19
19
  font-family: Verdana, "Bitstream Vera Sans", sans-serif;
@@ -56,8 +56,8 @@ p.quiet { color: <%= @page.color['quiet'] %>; }
56
56
  .alt { color: <%= @page.color['alt'] %>; }
57
57
 
58
58
  p.title {
59
- color: #111;
60
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
59
+ color: #111;
60
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
61
61
  font-size: 2em;
62
62
  margin-bottom: 0.75em;
63
63
  }
@@ -1,9 +1,9 @@
1
- ---
1
+ ---
2
2
  title: Home Page
3
3
  filter:
4
4
  - erb
5
5
  - textile
6
- ---
6
+ ---
7
7
  p(title). <%= @page.title %>
8
8
 
9
9
  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc congue ipsum vestibulum libero. Aenean vitae justo. Nam eget tellus. Etiam convallis, est eu lobortis mattis, lectus tellus tempus felis, a ultricies erat ipsum at metus.
@@ -1,7 +1,7 @@
1
- ---
1
+ ---
2
2
  extension: html
3
3
  filter: erb
4
- ---
4
+ ---
5
5
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
6
6
  "DTD/xhtml1-strict.dtd">
7
7
 
@@ -24,12 +24,12 @@ filter: erb
24
24
  <body>
25
25
 
26
26
  <div class="container">
27
-
27
+
28
28
  <div class="column span-20 prepend-2 append-2 first last" id="header">
29
29
  <p class="title">A New Website</p>
30
30
  <hr>
31
31
  </div>
32
-
32
+
33
33
  <div class="column span-15 prepend-2 first">
34
34
  <%= @content %>
35
35
  </div>
@@ -37,7 +37,7 @@ filter: erb
37
37
  <div class="column span-5 append-2 last">
38
38
  <h4>Sidebar</h4>
39
39
  <p>Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras ornare mattis nunc. Mauris venenatis, pede sed aliquet vehicula, lectus tellus pulvinar neque, non cursus sem nisi vel augue. </p>
40
-
40
+
41
41
  <div class="box">
42
42
  <p class="last">Mauris a lectus. Aliquam erat volutpat. Phasellus ultrices mi a sapien. Nunc rutrum egestas lorem. Duis ac sem sagittis elit tincidunt gravida.</p>
43
43
  </div>
@@ -52,7 +52,7 @@ filter: erb
52
52
  <hr />
53
53
  <p>This website was created with <a href="http://webby.rubyforge.org">Webby</a></p>
54
54
  </div>
55
-
55
+
56
56
  </div>
57
57
  </body>
58
58
  </html>
data/data/tasks/setup.rb CHANGED
@@ -1,6 +1,11 @@
1
1
  # $Id$
2
2
 
3
- require 'webby'
3
+ begin
4
+ require 'webby'
5
+ rescue LoadError
6
+ require 'rubygems'
7
+ require 'webby'
8
+ end
4
9
 
5
10
  SITE = Webby.site
6
11
 
@@ -1,10 +1,10 @@
1
- ---
1
+ ---
2
2
  title: New Page
3
3
  created_at: <%= Time.now.to_y %>
4
4
  filter:
5
5
  - erb
6
6
  - textile
7
- ---
7
+ ---
8
8
  p(title). <%%= h(@page.title) %>
9
9
 
10
10
  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc congue ipsum vestibulum libero. Aenean vitae justo. Nam eget tellus. Etiam convallis, est eu lobortis mattis, lectus tellus tempus felis, a ultricies erat ipsum at metus.
@@ -1,10 +1,10 @@
1
- ---
1
+ ---
2
2
  extension: css
3
3
  filter: sass
4
4
  layout: nil # no layout
5
5
  sass_options:
6
6
  :style: :expanded
7
- ---
7
+ ---
8
8
  !text = #000
9
9
  !border = #CCC
10
10
  !header = #111
@@ -23,7 +23,7 @@ body
23
23
 
24
24
  // Headings
25
25
  // ------------------------------------------------------------------------
26
- h1,h2,h3,h4,h5,h6
26
+ h1,h2,h3,h4,h5,h6
27
27
  :color = !header
28
28
  :font-weight bold
29
29
 
@@ -77,24 +77,24 @@ p.quiet
77
77
  // ------------------------------------------------------------------------
78
78
  #header
79
79
 
80
- #navigation
80
+ #navigation
81
81
  ul
82
82
  :margin-left 0
83
83
  :text-align right
84
84
  :font-size 16px
85
85
  :list-style-type none
86
- li
87
- a
86
+ li
87
+ a
88
88
  :display block
89
89
  :text-decoration none
90
90
  :padding-right 5px
91
- &:hover
91
+ &:hover
92
92
  :background-color = !highlight
93
93
 
94
94
  #footer
95
- hr
95
+ hr
96
96
  :margin-bottom 18px
97
- p
97
+ p
98
98
  :text-align right
99
99
 
100
100
  .CodeRay
@@ -73,7 +73,7 @@ filter:
73
73
  - erb
74
74
  - textile
75
75
  ---
76
- h2. <%= @page.title %>
76
+ h2. <%%= @page.title %>
77
77
 
78
78
  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc congue ipsum
79
79
  vestibulum libero. Aenean vitae justo. Nam eget tellus. Etiam convallis, est eu
@@ -155,7 +155,7 @@ filter: erb
155
155
  <title><%= @page.title %></title>
156
156
  </head>
157
157
  <body>
158
- <%= @content %>
158
+ <%%= @content %>
159
159
  </body>
160
160
  </html>
161
161
  </pre>
@@ -1,10 +1,10 @@
1
- ---
1
+ ---
2
2
  extension: html
3
3
  filter:
4
4
  - erb
5
5
  - basepath
6
6
  - tidy
7
- ---
7
+ ---
8
8
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
9
9
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
10
10
 
@@ -1,10 +1,10 @@
1
- ---
1
+ ---
2
2
  title: New Page
3
3
  created_at: <%= Time.now.to_y %>
4
4
  filter:
5
5
  - erb
6
6
  - textile
7
- ---
8
- h2. <%%= Textile %>
7
+ ---
8
+ p(title). <%%= h(@page.title) %>
9
9
 
10
10
  You can read more about textile "here":http://whytheluckystiff.net/ruby/redcloth/
data/lib/webby.rb CHANGED
@@ -1,4 +1,4 @@
1
- # $Id: webby.rb 112 2008-01-26 05:31:48Z tim_pease $
1
+ # $Id: webby.rb 130 2008-02-04 22:28:22Z tim_pease $
2
2
 
3
3
  require 'logging'
4
4
  require 'ostruct'
@@ -14,7 +14,7 @@ Logging::Appender.stdout.layout = Logging::Layouts::Pattern.new(
14
14
 
15
15
  module Webby
16
16
 
17
- VERSION = '0.7.2' # :nodoc:
17
+ VERSION = '0.7.3' # :nodoc:
18
18
 
19
19
  # Path to the Webby package
20
20
  PATH = ::File.expand_path(::File.join(::File.dirname(__FILE__), '..'))
data/lib/webby/file.rb CHANGED
@@ -1,4 +1,4 @@
1
- # $Id: file.rb 71 2007-12-13 05:45:53Z tim_pease $
1
+ # $Id: file.rb 134 2008-02-05 16:12:48Z tim_pease $
2
2
 
3
3
  require 'yaml'
4
4
 
data/lib/webby/main.rb CHANGED
@@ -1,4 +1,4 @@
1
- # $Id: main.rb 35 2007-09-25 23:31:03Z tim_pease $
1
+ # $Id: main.rb 133 2008-02-05 06:33:39Z tim_pease $
2
2
 
3
3
  require 'fileutils'
4
4
  require 'find'
@@ -11,6 +11,8 @@ module Webby
11
11
  #
12
12
  class Main
13
13
 
14
+ WINDOWS = %r/djgpp|(cyg|ms|bcc)win|mingw/ =~ RUBY_PLATFORM # :nodoc:
15
+
14
16
  # Directory where the Webby website will be created
15
17
  attr_accessor :site
16
18
 
@@ -142,7 +144,29 @@ class Main
142
144
  src = ::File.join(data, file)
143
145
  dst = ::File.join(site, file)
144
146
  test(?e, dst) ? updating(dst) : creating(dst)
145
- FileUtils.cp src, dst
147
+ # FileUtils.cp(src, dst)
148
+ if WINDOWS then win_line_endings(src, dst)
149
+ else FileUtils.cp(src, dst) end
150
+ end
151
+
152
+ # call-seq:
153
+ # win_line_endings( src, dst )
154
+ #
155
+ # Copy the file from the _src_ location to the _dst_ location and
156
+ # transform the line endings to the windows "\r\n" format.
157
+ #
158
+ def win_line_endings( src, dst )
159
+ case ::File.extname(src)
160
+ when *%w[.png .gif .jpg .jpeg]
161
+ FileUtils.cp src, dst
162
+ else
163
+ ::File.open(dst,'w') do |fd|
164
+ ::File.foreach(src, "\n") do |line|
165
+ line.tr!("\r\n",'')
166
+ fd.puts line
167
+ end
168
+ end
169
+ end
146
170
  end
147
171
 
148
172
  # call-seq:
data/tasks/manifest.rake CHANGED
@@ -17,7 +17,18 @@ namespace :manifest do
17
17
  end
18
18
 
19
19
  File.open(fn, 'w') {|fp| fp.puts files.sort}
20
- system "#{DIFF} -du Manifest.txt #{fn}"
20
+ lines = %x(#{DIFF} -du Manifest.txt #{fn}).split("\n")
21
+ if HAVE_FACETS_ANSICODE and ENV.has_key?('TERM')
22
+ lines.map! do |line|
23
+ case line
24
+ when %r/^(-{3}|\+{3})/; nil
25
+ when %r/^@/; Console::ANSICode.blue line
26
+ when %r/^\+/; Console::ANSICode.green line
27
+ when %r/^\-/; Console::ANSICode.red line
28
+ else line end
29
+ end
30
+ end
31
+ puts lines.compact
21
32
  rm fn rescue nil
22
33
  end
23
34
 
data/tasks/setup.rb CHANGED
@@ -1,4 +1,4 @@
1
- # $Id$
1
+ # $Id: setup.rb 133 2008-02-05 06:33:39Z tim_pease $
2
2
 
3
3
  require 'rubygems'
4
4
  require 'rake'
@@ -73,7 +73,7 @@ rakefiles.unshift(rakefiles.delete('tasks/post_load.rake')).compact!
73
73
  import(*rakefiles)
74
74
 
75
75
  # Setup some constants
76
- WIN32 = %r/win32/ =~ RUBY_PLATFORM unless defined? WIN32
76
+ WIN32 = %r/djgpp|(cyg|ms|bcc)win|mingw/ =~ RUBY_PLATFORM unless defined? WIN32
77
77
 
78
78
  DEV_NULL = WIN32 ? 'NUL:' : '/dev/null'
79
79
 
@@ -102,7 +102,7 @@ SUDO = if WIN32 then ''
102
102
  RCOV = WIN32 ? 'rcov.cmd' : 'rcov'
103
103
  GEM = WIN32 ? 'gem.cmd' : 'gem'
104
104
 
105
- %w(rcov spec/rake/spectask rubyforge bones).each do |lib|
105
+ %w(rcov spec/rake/spectask rubyforge bones facets/ansicode).each do |lib|
106
106
  begin
107
107
  require lib
108
108
  Object.instance_eval {const_set "HAVE_#{lib.tr('/','_').upcase}", true}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Pease
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-02-02 00:00:00 -07:00
12
+ date: 2008-02-05 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -48,6 +48,15 @@ dependencies:
48
48
  - !ruby/object:Gem::Version
49
49
  version: 0.6.1
50
50
  version:
51
+ - !ruby/object:Gem::Dependency
52
+ name: rake
53
+ version_requirement:
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: 0.8.1
59
+ version:
51
60
  - !ruby/object:Gem::Dependency
52
61
  name: rspec
53
62
  version_requirement: