webby 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/History.txt +3 -0
  2. data/Manifest.txt +44 -0
  3. data/README.txt +50 -0
  4. data/Rakefile +29 -0
  5. data/bin/webby +14 -0
  6. data/data/Rakefile +6 -0
  7. data/data/content/css/blueprint/License.txt +21 -0
  8. data/data/content/css/blueprint/Readme.txt +93 -0
  9. data/data/content/css/blueprint/lib/buttons.css +112 -0
  10. data/data/content/css/blueprint/lib/compressed.css +127 -0
  11. data/data/content/css/blueprint/lib/grid.css +177 -0
  12. data/data/content/css/blueprint/lib/img/baseline-black.png +0 -0
  13. data/data/content/css/blueprint/lib/img/baseline.png +0 -0
  14. data/data/content/css/blueprint/lib/img/grid.png +0 -0
  15. data/data/content/css/blueprint/lib/img/icons/cross.png +0 -0
  16. data/data/content/css/blueprint/lib/img/icons/textfield_key.png +0 -0
  17. data/data/content/css/blueprint/lib/img/icons/tick.png +0 -0
  18. data/data/content/css/blueprint/lib/reset.css +37 -0
  19. data/data/content/css/blueprint/lib/typography.css +159 -0
  20. data/data/content/css/blueprint/print.css +75 -0
  21. data/data/content/css/blueprint/screen.css +34 -0
  22. data/data/content/css/site.css +0 -0
  23. data/data/content/index.rhtml +18 -0
  24. data/data/layouts/default.rhtml +55 -0
  25. data/data/tasks/create.rake +7 -0
  26. data/data/templates/page.erb +18 -0
  27. data/lib/webby.rb +67 -0
  28. data/lib/webby/auto_builder.rb +75 -0
  29. data/lib/webby/builder.rb +165 -0
  30. data/lib/webby/file.rb +191 -0
  31. data/lib/webby/main.rb +129 -0
  32. data/lib/webby/pages_db.rb +70 -0
  33. data/lib/webby/renderer.rb +94 -0
  34. data/lib/webby/resource.rb +174 -0
  35. data/lib/webby/utils.rb +24 -0
  36. data/lib/webby/webby_task.rb +136 -0
  37. data/spec/spec.opts +1 -0
  38. data/spec/spec_helper.rb +12 -0
  39. data/spec/webby/file_spec.rb +107 -0
  40. data/tasks/doc.rake +60 -0
  41. data/tasks/gem.rake +112 -0
  42. data/tasks/manifest.rake +39 -0
  43. data/tasks/setup.rb +108 -0
  44. data/tasks/spec.rake +37 -0
  45. metadata +128 -0
@@ -0,0 +1,60 @@
1
+ # $Id$
2
+
3
+ require 'rake/rdoctask'
4
+ require 'rake/contrib/sshpublisher'
5
+
6
+ namespace :doc do
7
+
8
+ desc 'Generate RDoc documentation'
9
+ Rake::RDocTask.new do |rd|
10
+ rd.main = PROJ.rdoc_main
11
+ rd.options << '-d' if !WIN32 and `which dot` =~ %r/\/dot/
12
+ rd.rdoc_dir = 'doc'
13
+
14
+ incl = Regexp.new(PROJ.rdoc_include.join('|'))
15
+ excl = Regexp.new(PROJ.rdoc_exclude.join('|'))
16
+ files = PROJ.files.find_all do |fn|
17
+ case fn
18
+ when excl: false
19
+ when incl: true
20
+ else false end
21
+ end
22
+ rd.rdoc_files.push(*files)
23
+
24
+ title = "#{PROJ.name}-#{PROJ.version} Documentation"
25
+ title = "#{PROJ.rubyforge_name}'s " + title if PROJ.rubyforge_name != title
26
+
27
+ rd.options << "-t #{title}"
28
+ end
29
+
30
+ desc 'Generate ri locally for testing'
31
+ task :ri => :clobber_ri do
32
+ sh "#{RDOC} --ri -o ri ."
33
+ end
34
+
35
+ desc 'Remove ri products'
36
+ task :clobber_ri do
37
+ rm_r 'ri' rescue nil
38
+ end
39
+
40
+ if PROJ.rubyforge_name && HAVE_RUBYFORGE
41
+ desc "Publish RDoc to RubyForge"
42
+ task :release => %w(doc:clobber_rdoc doc:rdoc) do
43
+ config = YAML.load(
44
+ File.read(File.expand_path('~/.rubyforge/user-config.yml'))
45
+ )
46
+
47
+ host = "#{config['username']}@rubyforge.org"
48
+ remote_dir = "/var/www/gforge-projects/#{rubyforge_name}/"
49
+ remote_dir << PROJ.rdoc_remote_dir || PROJ.name
50
+ local_dir = 'doc'
51
+
52
+ Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
53
+ end
54
+ end
55
+
56
+ end # namespace :doc
57
+
58
+ task :clobber => %w(doc:clobber_rdoc doc:clobber_ri)
59
+
60
+ # EOF
@@ -0,0 +1,112 @@
1
+ # $Id$
2
+
3
+ require 'rake/gempackagetask'
4
+ require 'rubyforge' if PROJ.rubyforge_name && HAVE_RUBYFORGE
5
+
6
+ namespace :gem do
7
+
8
+ spec = Gem::Specification.new do |s|
9
+ s.name = PROJ.name
10
+ s.version = PROJ.version
11
+ s.summary = PROJ.summary
12
+ s.authors = Array(PROJ.authors)
13
+ s.email = PROJ.email
14
+ s.homepage = Array(PROJ.url).first
15
+ s.rubyforge_project = PROJ.rubyforge_name
16
+
17
+ s.description = PROJ.description
18
+
19
+ PROJ.dependencies.each do |dep|
20
+ s.add_dependency(*dep)
21
+ end
22
+ if PROJ.rubyforge_name && HAVE_RUBYFORGE
23
+ s.add_dependency('rubyforge', ">= #{::RubyForge::VERSION}")
24
+ end
25
+ s.add_dependency('rake', ">= #{RAKEVERSION}")
26
+
27
+ s.files = PROJ.files
28
+ s.executables = PROJ.executables.map {|fn| File.basename(fn)}
29
+ s.extensions = PROJ.files.grep %r/extconf\.rb$/
30
+
31
+ s.bindir = 'bin'
32
+ dirs = Dir['{lib,ext}']
33
+ s.require_paths = dirs unless dirs.empty?
34
+
35
+ rdoc_files = PROJ.files.grep %r/txt$/
36
+ rdoc_files.delete 'Manifest.txt'
37
+ s.rdoc_options = PROJ.rdoc_opts + ['--main', PROJ.rdoc_main]
38
+ s.extra_rdoc_files = rdoc_files
39
+ s.has_rdoc = true
40
+
41
+ if test ?f, PROJ.test_file
42
+ s.test_file = PROJ.test_file
43
+ else
44
+ s.test_files = PROJ.tests.to_a
45
+ end
46
+
47
+ # Do any extra stuff the user wants
48
+ # spec_extras.each do |msg, val|
49
+ # case val
50
+ # when Proc
51
+ # val.call(s.send(msg))
52
+ # else
53
+ # s.send "#{msg}=", val
54
+ # end
55
+ # end
56
+ end
57
+
58
+ desc 'Show information about the gem'
59
+ task :debug do
60
+ puts spec.to_ruby
61
+ end
62
+
63
+ Rake::GemPackageTask.new(spec) do |pkg|
64
+ pkg.need_tar = PROJ.need_tar
65
+ pkg.need_zip = PROJ.need_zip
66
+ end
67
+
68
+ desc 'Install the gem'
69
+ task :install => [:clobber, :package] do
70
+ sh "#{SUDO} #{GEM} install pkg/#{spec.file_name}"
71
+ end
72
+
73
+ desc 'Uninstall the gem'
74
+ task :uninstall do
75
+ sh "#{SUDO} #{GEM} uninstall -v '#{PROJ.version}' #{PROJ.name}"
76
+ end
77
+
78
+ if PROJ.rubyforge_name && HAVE_RUBYFORGE
79
+ desc 'Package and upload to RubyForge'
80
+ task :release => [:clobber, :package] do |t|
81
+ v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
82
+ abort "Versions don't match #{v} vs #{PROJ.version}" if v != PROJ.version
83
+ pkg = "pkg/#{spec.full_name}"
84
+
85
+ if $DEBUG then
86
+ puts "release_id = rf.add_release #{PROJ.rubyforge_name.inspect}, #{PROJ.name.inspect}, #{PROJ.version.inspect}, \"#{pkg}.tgz\""
87
+ puts "rf.add_file #{PROJ.rubyforge_name.inspect}, #{PROJ.name.inspect}, release_id, \"#{pkg}.gem\""
88
+ end
89
+
90
+ rf = RubyForge.new
91
+ puts 'Logging in'
92
+ rf.login
93
+
94
+ c = rf.userconfig
95
+ c['release_notes'] = PROJ.description if PROJ.description
96
+ c['release_changes'] = PROJ.changes if PROJ.changes
97
+ c['preformatted'] = true
98
+
99
+ files = [(PROJ.need_tar ? "#{pkg}.tgz" : nil),
100
+ (PROJ.need_zip ? "#{pkg}.zip" : nil),
101
+ "#{pkg}.gem"].compact
102
+
103
+ puts "Releasing #{PROJ.name} v. #{PROJ.version}"
104
+ rf.add_release PROJ.rubyforge_name, PROJ.name, PROJ.version, *files
105
+ end
106
+ end
107
+
108
+ end # namespace :gem
109
+
110
+ task :clobber => 'gem:clobber_package'
111
+
112
+ # EOF
@@ -0,0 +1,39 @@
1
+ # $Id$
2
+
3
+ require 'find'
4
+
5
+ namespace :manifest do
6
+
7
+ desc 'Verify the manfiest'
8
+ task :check do
9
+ fn = 'Manifest.tmp'
10
+ files = []
11
+ exclude = Regexp.new(PROJ.exclude.join('|'))
12
+ Find.find '.' do |path|
13
+ next unless test ?f, path
14
+ next if path =~ exclude
15
+ files << path[2..-1]
16
+ end
17
+
18
+ File.open(fn, 'w') {|fp| fp.puts files.sort}
19
+ system "#{DIFF} -du Manifest.txt #{fn}"
20
+ rm fn rescue nil
21
+ end
22
+
23
+ desc 'Create a new manifest'
24
+ task :create do
25
+ fn = 'Manifest.txt'
26
+ files = []
27
+ exclude = Regexp.new(PROJ.exclude.join('|'))
28
+ Find.find '.' do |path|
29
+ next unless test ?f, path
30
+ next if path =~ exclude
31
+ files << path[2..-1]
32
+ end
33
+
34
+ files << fn unless test ?f, fn
35
+ File.open(fn, 'w') {|fp| fp.puts files.sort}
36
+ end
37
+ end
38
+
39
+ # EOF
@@ -0,0 +1,108 @@
1
+ # $Id: setup.rb 1 2007-08-18 21:39:50Z tim_pease $
2
+
3
+ require 'rubygems'
4
+ require 'ostruct'
5
+
6
+ PROJ = OpenStruct.new
7
+
8
+ PROJ.name = nil
9
+ PROJ.summary = nil
10
+ PROJ.description = nil
11
+ PROJ.changes = nil
12
+ PROJ.authors = nil
13
+ PROJ.email = nil
14
+ PROJ.url = nil
15
+ PROJ.version = ENV['VERSION'] || '0.0.0'
16
+ PROJ.rubyforge_name = nil
17
+ PROJ.exclude = %w(tmp$ bak$ ~$ CVS \.svn)
18
+
19
+ # Rspec
20
+ PROJ.specs = FileList['spec/**/*_spec.rb']
21
+ PROJ.spec_opts = []
22
+
23
+ # Test::Unit
24
+ PROJ.tests = FileList['test/**/test_*.rb']
25
+ PROJ.test_file = 'test/all.rb'
26
+ PROJ.test_opts = []
27
+
28
+ # Rcov
29
+ PROJ.rcov_opts = ['--sort', 'coverage', '-T']
30
+
31
+ # Rdoc
32
+ PROJ.rdoc_opts = []
33
+ PROJ.rdoc_include = %w(^lib ^bin ^ext txt$)
34
+ PROJ.rdoc_exclude = %w(extconf\.rb$ ^Manifest\.txt$)
35
+ PROJ.rdoc_main = 'README.txt'
36
+ PROJ.rdoc_remote_dir = nil
37
+
38
+ # Extensions
39
+ PROJ.extensions = FileList['ext/**/extconf.rb']
40
+ PROJ.ruby_opts = %w(-w)
41
+ PROJ.libs = []
42
+ %w(lib ext).each {|dir| PROJ.libs << dir if test ?d, dir}
43
+
44
+ # Gem Packaging
45
+ PROJ.files =
46
+ if test ?f, 'Manifest.txt'
47
+ files = File.readlines('Manifest.txt').map {|fn| fn.chomp.strip}
48
+ files.delete ''
49
+ files
50
+ else [] end
51
+ PROJ.executables = PROJ.files.find_all {|fn| fn =~ %r/^bin/}
52
+ PROJ.dependencies = []
53
+ PROJ.need_tar = true
54
+ PROJ.need_zip = false
55
+
56
+ # Import the rake tasks
57
+ FileList['tasks/*.rake'].each {|task| import task}
58
+
59
+ # Setup some constants
60
+ WIN32 = %r/win32/ =~ RUBY_PLATFORM unless defined? WIN32
61
+
62
+ DEV_NULL = WIN32 ? 'NUL:' : '/dev/null'
63
+
64
+ def quiet( &block )
65
+ io = [STDOUT.dup, STDERR.dup]
66
+ STDOUT.reopen DEV_NULL
67
+ STDERR.reopen DEV_NULL
68
+ block.call
69
+ ensure
70
+ STDOUT.reopen io.first
71
+ STDERR.reopen io.last
72
+ end
73
+
74
+ DIFF = if WIN32 then 'diff.exe'
75
+ else
76
+ if quiet {system "gdiff", __FILE__, __FILE__} then 'gdiff'
77
+ else 'diff' end
78
+ end unless defined? DIFF
79
+
80
+ SUDO = if WIN32 then ''
81
+ else
82
+ if quiet {system 'which sudo'} then 'sudo'
83
+ else '' end
84
+ end
85
+
86
+ RCOV = WIN32 ? 'rcov.cmd' : 'rcov'
87
+ GEM = WIN32 ? 'gem.cmd' : 'gem'
88
+
89
+ %w(rcov rspec rubyforge).each do |g|
90
+ begin
91
+ gem g
92
+ Object.instance_eval {const_set "HAVE_#{g.upcase}", true}
93
+ rescue LoadError
94
+ Object.instance_eval {const_set "HAVE_#{g.upcase}", false}
95
+ end
96
+ end
97
+
98
+ # Reads a file at +path+ and spits out an array of the +paragraphs+
99
+ # specified.
100
+ #
101
+ # changes = paragraphs_of('History.txt', 0..1).join("\n\n")
102
+ # summary, *description = paragraphs_of('README.txt', 3, 3..8)
103
+ #
104
+ def paragraphs_of(path, *paragraphs)
105
+ File.read(path).delete("\r").split(/\n\n+/).values_at(*paragraphs)
106
+ end
107
+
108
+ # EOF
@@ -0,0 +1,37 @@
1
+ # $Id$
2
+
3
+ if HAVE_RSPEC
4
+
5
+ require 'spec/rake/spectask'
6
+
7
+ namespace :spec do
8
+
9
+ desc 'Run all specs with basic output'
10
+ Spec::Rake::SpecTask.new(:run) do |t|
11
+ t.spec_opts = PROJ.spec_opts
12
+ t.spec_files = PROJ.specs
13
+ end
14
+
15
+ desc 'Run all specs with text output'
16
+ Spec::Rake::SpecTask.new(:specdoc) do |t|
17
+ t.spec_opts = PROJ.spec_opts + ['--format', 'specdoc']
18
+ t.spec_files = PROJ.specs
19
+ end
20
+
21
+ if HAVE_RCOV
22
+ desc 'Run all specs with RCov'
23
+ Spec::Rake::SpecTask.new(:rcov) do |t|
24
+ t.spec_opts = PROJ.spec_opts
25
+ t.spec_files = PROJ.specs
26
+ t.rcov = true
27
+ t.rcov_opts = PROJ.rcov_opts + ['--exclude', 'spec']
28
+ end
29
+ end
30
+
31
+ end # namespace :spec
32
+
33
+ task :clobber => 'spec:clobber_rcov' if HAVE_RCOV
34
+
35
+ end # if HAVE_RSPEC
36
+
37
+ # EOF
metadata ADDED
@@ -0,0 +1,128 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.9.4
3
+ specification_version: 1
4
+ name: webby
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.1.0
7
+ date: 2007-08-22 00:00:00 -06:00
8
+ summary: static website creation and management
9
+ require_paths:
10
+ - lib
11
+ email: tim.pease@gmail.com
12
+ homepage: http://webby.rubyforge.org/
13
+ rubyforge_project: webby
14
+ description: Webby is a tool for creating and managing static websites. Web pages are written using ERB, Textile, Markdown, HAML, etc. The Webby rake tasks transform the pages into valid HTML, and these pages can be uploaded to a web server for general consumption.
15
+ autorequire:
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: true
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ post_install_message:
29
+ authors:
30
+ - Tim Pease
31
+ files:
32
+ - History.txt
33
+ - Manifest.txt
34
+ - README.txt
35
+ - Rakefile
36
+ - bin/webby
37
+ - data/Rakefile
38
+ - data/content/css/blueprint/License.txt
39
+ - data/content/css/blueprint/Readme.txt
40
+ - data/content/css/blueprint/lib/buttons.css
41
+ - data/content/css/blueprint/lib/compressed.css
42
+ - data/content/css/blueprint/lib/grid.css
43
+ - data/content/css/blueprint/lib/img/baseline-black.png
44
+ - data/content/css/blueprint/lib/img/baseline.png
45
+ - data/content/css/blueprint/lib/img/grid.png
46
+ - data/content/css/blueprint/lib/img/icons/cross.png
47
+ - data/content/css/blueprint/lib/img/icons/textfield_key.png
48
+ - data/content/css/blueprint/lib/img/icons/tick.png
49
+ - data/content/css/blueprint/lib/reset.css
50
+ - data/content/css/blueprint/lib/typography.css
51
+ - data/content/css/blueprint/print.css
52
+ - data/content/css/blueprint/screen.css
53
+ - data/content/css/site.css
54
+ - data/content/index.rhtml
55
+ - data/layouts/default.rhtml
56
+ - data/tasks/create.rake
57
+ - data/templates/page.erb
58
+ - lib/webby.rb
59
+ - lib/webby/auto_builder.rb
60
+ - lib/webby/builder.rb
61
+ - lib/webby/file.rb
62
+ - lib/webby/main.rb
63
+ - lib/webby/pages_db.rb
64
+ - lib/webby/renderer.rb
65
+ - lib/webby/resource.rb
66
+ - lib/webby/utils.rb
67
+ - lib/webby/webby_task.rb
68
+ - spec/spec.opts
69
+ - spec/spec_helper.rb
70
+ - spec/webby/file_spec.rb
71
+ - tasks/doc.rake
72
+ - tasks/gem.rake
73
+ - tasks/manifest.rake
74
+ - tasks/setup.rb
75
+ - tasks/spec.rake
76
+ test_files: []
77
+
78
+ rdoc_options:
79
+ - --main
80
+ - README.txt
81
+ extra_rdoc_files:
82
+ - History.txt
83
+ - README.txt
84
+ - data/content/css/blueprint/License.txt
85
+ - data/content/css/blueprint/Readme.txt
86
+ executables:
87
+ - webby
88
+ extensions: []
89
+
90
+ requirements: []
91
+
92
+ dependencies:
93
+ - !ruby/object:Gem::Dependency
94
+ name: rspec
95
+ version_requirement:
96
+ version_requirements: !ruby/object:Gem::Version::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: 1.0.5
101
+ version:
102
+ - !ruby/object:Gem::Dependency
103
+ name: directory_watcher
104
+ version_requirement:
105
+ version_requirements: !ruby/object:Gem::Version::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: 1.0.0
110
+ version:
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubyforge
113
+ version_requirement:
114
+ version_requirements: !ruby/object:Gem::Version::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: 0.4.3
119
+ version:
120
+ - !ruby/object:Gem::Dependency
121
+ name: rake
122
+ version_requirement:
123
+ version_requirements: !ruby/object:Gem::Version::Requirement
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: 0.7.3
128
+ version: