scruffy 0.2.6 → 0.3.0.beta1
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 → CHANGES.txt} +15 -12
- data/README.txt +25 -25
- data/lib/scruffy.rb +0 -5
- data/lib/scruffy/components.rb +1 -0
- data/lib/scruffy/components/axes.rb +23 -0
- data/lib/scruffy/components/background.rb +3 -3
- data/lib/scruffy/components/base.rb +3 -0
- data/lib/scruffy/components/data_markers.rb +23 -8
- data/lib/scruffy/components/graphs.rb +4 -0
- data/lib/scruffy/components/grid.rb +45 -4
- data/lib/scruffy/components/legend.rb +63 -21
- data/lib/scruffy/components/title.rb +1 -1
- data/lib/scruffy/components/value_markers.rb +9 -16
- data/lib/scruffy/formatters.rb +41 -3
- data/lib/scruffy/graph.rb +27 -11
- data/lib/scruffy/graph_state.rb +5 -0
- data/lib/scruffy/helpers.rb +1 -0
- data/lib/scruffy/helpers/layer_container.rb +28 -4
- data/lib/scruffy/helpers/marker_helper.rb +25 -0
- data/lib/scruffy/helpers/point_container.rb +46 -17
- data/lib/scruffy/layers.rb +6 -1
- data/lib/scruffy/layers/bar.rb +35 -14
- data/lib/scruffy/layers/base.rb +51 -21
- data/lib/scruffy/layers/box.rb +114 -0
- data/lib/scruffy/layers/line.rb +31 -14
- data/lib/scruffy/layers/multi.rb +74 -0
- data/lib/scruffy/layers/multi_area.rb +119 -0
- data/lib/scruffy/layers/multi_bar.rb +51 -0
- data/lib/scruffy/layers/scatter.rb +13 -5
- data/lib/scruffy/layers/stacked.rb +2 -1
- data/lib/scruffy/rasterizers.rb +1 -0
- data/lib/scruffy/rasterizers/mini_magick_rasterizer.rb +24 -0
- data/lib/scruffy/rasterizers/rmagick_rasterizer.rb +8 -2
- data/lib/scruffy/renderers.rb +2 -0
- data/lib/scruffy/renderers/axis_legend.rb +41 -0
- data/lib/scruffy/renderers/base.rb +6 -4
- data/lib/scruffy/renderers/basic.rb +20 -0
- data/lib/scruffy/renderers/standard.rb +7 -6
- data/lib/scruffy/themes.rb +37 -1
- data/lib/scruffy/version.rb +1 -7
- data/spec/output/array.svg +55 -0
- data/spec/output/hash.svg +55 -0
- data/spec/scruffy/graph_spec.rb +4 -4
- data/spec/scruffy/layers/base_spec.rb +15 -10
- metadata +84 -96
- data/CHANGES +0 -104
- data/License.txt +0 -20
- data/MIT-LICENSE +0 -20
- data/Manifest.txt +0 -104
- data/PostInstall.txt +0 -6
- data/README +0 -9
- data/Rakefile +0 -108
- data/config/hoe.rb +0 -78
- data/config/requirements.rb +0 -15
- data/script/console +0 -10
- data/script/destroy +0 -14
- data/script/generate +0 -14
- data/script/txt2html +0 -82
- data/setup.rb +0 -1585
- data/spec/scruffy/layers/line_spec.rb +0 -10
- data/tasks/deployment.rake +0 -34
- data/tasks/environment.rake +0 -7
- data/tasks/website.rake +0 -17
- data/test/graph_creation_test.rb +0 -101
- data/test/test_helper.rb +0 -2
- data/website/images/blank.gif.html +0 -7
- data/website/images/graphs/all_smiles.png +0 -0
- data/website/images/graphs/bar_test.png +0 -0
- data/website/images/graphs/bar_test.svg +0 -71
- data/website/images/graphs/line_test.png +0 -0
- data/website/images/graphs/line_test.svg +0 -60
- data/website/images/graphs/multi_test.png +0 -0
- data/website/images/graphs/multi_test.svg +0 -296
- data/website/images/graphs/pie_test.png +0 -0
- data/website/images/graphs/pie_test.svg +0 -40
- data/website/images/graphs/split_test.png +0 -0
- data/website/images/graphs/split_test.svg +0 -295
- data/website/images/graphs/stacking_test.png +0 -0
- data/website/images/graphs/stacking_test.svg +0 -146
- data/website/images/header.png +0 -0
- data/website/images/header_gradient.png +0 -0
- data/website/images/overlay.png +0 -0
- data/website/images/scruffy.png +0 -0
- data/website/index.html +0 -225
- data/website/index.txt +0 -204
- data/website/javascripts/application.js +0 -2
- data/website/javascripts/controls.js +0 -815
- data/website/javascripts/dragdrop.js +0 -913
- data/website/javascripts/effects.js +0 -958
- data/website/javascripts/lightbox.js +0 -437
- data/website/javascripts/prototype.js +0 -2006
- data/website/javascripts/rounded_corners_lite.inc.js +0 -285
- data/website/stylesheets/lightbox.css +0 -27
- data/website/stylesheets/screen.css +0 -147
- data/website/stylesheets/scruffy.css +0 -227
- data/website/template.html.erb +0 -47
data/MIT-LICENSE
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2006 Brasten Sager (brasten@nagilum.com)
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Manifest.txt
DELETED
@@ -1,104 +0,0 @@
|
|
1
|
-
CHANGES
|
2
|
-
History.txt
|
3
|
-
License.txt
|
4
|
-
MIT-LICENSE
|
5
|
-
Manifest.txt
|
6
|
-
PostInstall.txt
|
7
|
-
README
|
8
|
-
README.txt
|
9
|
-
Rakefile
|
10
|
-
config/hoe.rb
|
11
|
-
config/requirements.rb
|
12
|
-
lib/scruffy.rb
|
13
|
-
lib/scruffy/components.rb
|
14
|
-
lib/scruffy/components/background.rb
|
15
|
-
lib/scruffy/components/base.rb
|
16
|
-
lib/scruffy/components/data_markers.rb
|
17
|
-
lib/scruffy/components/graphs.rb
|
18
|
-
lib/scruffy/components/grid.rb
|
19
|
-
lib/scruffy/components/label.rb
|
20
|
-
lib/scruffy/components/legend.rb
|
21
|
-
lib/scruffy/components/style_info.rb
|
22
|
-
lib/scruffy/components/title.rb
|
23
|
-
lib/scruffy/components/value_markers.rb
|
24
|
-
lib/scruffy/components/viewport.rb
|
25
|
-
lib/scruffy/formatters.rb
|
26
|
-
lib/scruffy/graph.rb
|
27
|
-
lib/scruffy/graph_state.rb
|
28
|
-
lib/scruffy/helpers.rb
|
29
|
-
lib/scruffy/helpers/canvas.rb
|
30
|
-
lib/scruffy/helpers/layer_container.rb
|
31
|
-
lib/scruffy/helpers/meta.rb
|
32
|
-
lib/scruffy/helpers/point_container.rb
|
33
|
-
lib/scruffy/layers.rb
|
34
|
-
lib/scruffy/layers/all_smiles.rb
|
35
|
-
lib/scruffy/layers/area.rb
|
36
|
-
lib/scruffy/layers/average.rb
|
37
|
-
lib/scruffy/layers/bar.rb
|
38
|
-
lib/scruffy/layers/base.rb
|
39
|
-
lib/scruffy/layers/line.rb
|
40
|
-
lib/scruffy/layers/pie.rb
|
41
|
-
lib/scruffy/layers/pie_slice.rb
|
42
|
-
lib/scruffy/layers/scatter.rb
|
43
|
-
lib/scruffy/layers/sparkline_bar.rb
|
44
|
-
lib/scruffy/layers/stacked.rb
|
45
|
-
lib/scruffy/rasterizers.rb
|
46
|
-
lib/scruffy/rasterizers/batik_rasterizer.rb
|
47
|
-
lib/scruffy/rasterizers/rmagick_rasterizer.rb
|
48
|
-
lib/scruffy/renderers.rb
|
49
|
-
lib/scruffy/renderers/base.rb
|
50
|
-
lib/scruffy/renderers/cubed.rb
|
51
|
-
lib/scruffy/renderers/cubed3d.rb
|
52
|
-
lib/scruffy/renderers/empty.rb
|
53
|
-
lib/scruffy/renderers/pie.rb
|
54
|
-
lib/scruffy/renderers/reversed.rb
|
55
|
-
lib/scruffy/renderers/sparkline.rb
|
56
|
-
lib/scruffy/renderers/split.rb
|
57
|
-
lib/scruffy/renderers/standard.rb
|
58
|
-
lib/scruffy/themes.rb
|
59
|
-
lib/scruffy/version.rb
|
60
|
-
script/console
|
61
|
-
script/destroy
|
62
|
-
script/generate
|
63
|
-
script/txt2html
|
64
|
-
setup.rb
|
65
|
-
spec/scruffy/graph_spec.rb
|
66
|
-
spec/scruffy/layers/base_spec.rb
|
67
|
-
spec/scruffy/layers/line_spec.rb
|
68
|
-
spec/spec_helper.rb
|
69
|
-
tasks/deployment.rake
|
70
|
-
tasks/environment.rake
|
71
|
-
tasks/website.rake
|
72
|
-
test/graph_creation_test.rb
|
73
|
-
test/test_helper.rb
|
74
|
-
website/images/blank.gif.html
|
75
|
-
website/images/graphs/all_smiles.png
|
76
|
-
website/images/graphs/bar_test.png
|
77
|
-
website/images/graphs/bar_test.svg
|
78
|
-
website/images/graphs/line_test.png
|
79
|
-
website/images/graphs/line_test.svg
|
80
|
-
website/images/graphs/multi_test.png
|
81
|
-
website/images/graphs/multi_test.svg
|
82
|
-
website/images/graphs/pie_test.png
|
83
|
-
website/images/graphs/pie_test.svg
|
84
|
-
website/images/graphs/split_test.png
|
85
|
-
website/images/graphs/split_test.svg
|
86
|
-
website/images/graphs/stacking_test.png
|
87
|
-
website/images/graphs/stacking_test.svg
|
88
|
-
website/images/header.png
|
89
|
-
website/images/header_gradient.png
|
90
|
-
website/images/overlay.png
|
91
|
-
website/images/scruffy.png
|
92
|
-
website/index.html
|
93
|
-
website/index.txt
|
94
|
-
website/javascripts/application.js
|
95
|
-
website/javascripts/controls.js
|
96
|
-
website/javascripts/dragdrop.js
|
97
|
-
website/javascripts/effects.js
|
98
|
-
website/javascripts/lightbox.js
|
99
|
-
website/javascripts/prototype.js
|
100
|
-
website/javascripts/rounded_corners_lite.inc.js
|
101
|
-
website/stylesheets/lightbox.css
|
102
|
-
website/stylesheets/screen.css
|
103
|
-
website/stylesheets/scruffy.css
|
104
|
-
website/template.html.erb
|
data/PostInstall.txt
DELETED
data/README
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
==Scruffy Graphs
|
2
|
-
|
3
|
-
Author:: Brasten Sager (brasten@nagilum.com)
|
4
|
-
Date:: August 5th, 2006
|
5
|
-
|
6
|
-
Scruffy is a Ruby library for generating high quality, good looking graphs. It is designed
|
7
|
-
to be easy to use and highly customizable.
|
8
|
-
|
9
|
-
For basic usage instructions, refer to the documentation for Scruffy::Graph.
|
data/Rakefile
DELETED
@@ -1,108 +0,0 @@
|
|
1
|
-
require 'config/requirements'
|
2
|
-
require 'config/hoe' # setup Hoe + all gem configuration
|
3
|
-
|
4
|
-
Dir['tasks/**/*.rake'].each { |rake| load rake }
|
5
|
-
|
6
|
-
#
|
7
|
-
#require 'rubygems'
|
8
|
-
#require 'rake'
|
9
|
-
#require 'rake/testtask'
|
10
|
-
#require 'rake/rdoctask'
|
11
|
-
#require 'rake/packagetask'
|
12
|
-
#require 'rake/gempackagetask'
|
13
|
-
#require 'rake/contrib/rubyforgepublisher'
|
14
|
-
#require 'lib/scruffy'
|
15
|
-
#require 'spec'
|
16
|
-
#require 'diff/lcs'
|
17
|
-
#require 'spec/rake/spectask'
|
18
|
-
#
|
19
|
-
#PKG_NAME = "scruffy"
|
20
|
-
#PKG_VERSION = Scruffy::VERSION::STRING
|
21
|
-
#PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
22
|
-
#PKG_FILES = FileList[
|
23
|
-
# '[A-Z]*',
|
24
|
-
# 'lib/**/*.rb',
|
25
|
-
# 'spec/**/*.rb'
|
26
|
-
#]
|
27
|
-
#
|
28
|
-
#desc 'Runs all RSpec specs (set RCOV=true for coverage output)'
|
29
|
-
#Spec::Rake::SpecTask.new do |t|
|
30
|
-
# t.spec_files = FileList['spec/**/*_spec.rb']
|
31
|
-
# t.rcov = ENV['RCOV']
|
32
|
-
#end
|
33
|
-
#
|
34
|
-
#desc "Deploy docs to RubyForge"
|
35
|
-
#task :rdoc_deploy => [:rdoc] do
|
36
|
-
# dirs = %w{doc}
|
37
|
-
# onserver = "brasten@rubyforge.org:/var/www/gforge-projects/scruffy"
|
38
|
-
# dirs.each do | dir|
|
39
|
-
# `scp -r "#{`pwd`.chomp}/#{dir}" "#{onserver}"`
|
40
|
-
# end
|
41
|
-
#end
|
42
|
-
#
|
43
|
-
## Genereate the RDoc documentation
|
44
|
-
#Rake::RDocTask.new { |rdoc|
|
45
|
-
# rdoc.rdoc_dir = 'doc'
|
46
|
-
# rdoc.title = "Scruffy - Graphing Library for Ruby"
|
47
|
-
## rdoc.options << '--line-numbers --inline-source --main README --accessor adv_attr_accessor=M'
|
48
|
-
## rdoc.template = "#{ENV['template']}.rb" if ENV['template']
|
49
|
-
# rdoc.rdoc_files.include('README', 'CHANGES', 'MIT-LICENSE')
|
50
|
-
# rdoc.rdoc_files.include('lib/scruffy.rb')
|
51
|
-
# rdoc.rdoc_files.include('lib/scruffy/*.rb')
|
52
|
-
# rdoc.rdoc_files.include('lib/scruffy/layers/*.rb')
|
53
|
-
# rdoc.rdoc_files.include('lib/scruffy/renderers/*.rb')
|
54
|
-
# rdoc.rdoc_files.include('lib/scruffy/components/*.rb')
|
55
|
-
# rdoc.rdoc_files.include('lib/scruffy/helpers/*.rb')
|
56
|
-
# rdoc.rdoc_files.include('lib/scruffy/rasterizers/*.rb')
|
57
|
-
#}
|
58
|
-
#
|
59
|
-
#spec = Gem::Specification.new do |s|
|
60
|
-
# s.name = PKG_NAME
|
61
|
-
# s.version = PKG_VERSION
|
62
|
-
# s.author = AUTHOR
|
63
|
-
# s.email = "brasten@nagilum.com"
|
64
|
-
# s.homepage = "http://scruffy.rubyforge.org"
|
65
|
-
# s.summary = "A powerful, clean graphing library for Ruby."
|
66
|
-
# s.add_dependency('builder', '>= 2.0')
|
67
|
-
# s.description = <<-EOF
|
68
|
-
# Scruffy is a Ruby library for generating powerful graphs. It is based on
|
69
|
-
# SVG, allowing for powerful, clean code, as well as a good foundation for
|
70
|
-
# future features.
|
71
|
-
# EOF
|
72
|
-
#
|
73
|
-
# s.files = PKG_FILES.to_a
|
74
|
-
# s.has_rdoc = true
|
75
|
-
# s.rubyforge_project = "scruffy"
|
76
|
-
#end
|
77
|
-
#
|
78
|
-
#Rake::GemPackageTask.new(spec) do |pkg|
|
79
|
-
# pkg.need_zip = true
|
80
|
-
# pkg.need_tar = true
|
81
|
-
#end
|
82
|
-
#
|
83
|
-
#task :verify_user do
|
84
|
-
# raise "RUBYFORGE_USER environment variable not set!" unless ENV['RUBYFORGE_USER']
|
85
|
-
#end
|
86
|
-
#
|
87
|
-
#task :verify_password do
|
88
|
-
# raise "RUBYFORGE_PASSWORD environment variable not set!" unless ENV['RUBYFORGE_PASSWORD']
|
89
|
-
#end
|
90
|
-
#
|
91
|
-
#desc "Publish gem+tgz+zip on RubyForge. You must make sure lib/version.rb is aligned with the CHANGELOG file"
|
92
|
-
#task :publish_packages => [:verify_user, :verify_password, :package] do
|
93
|
-
# require 'meta_project'
|
94
|
-
# require 'rake/contrib/xforge'
|
95
|
-
# release_files = FileList[
|
96
|
-
# "pkg/#{PKG_FILE_NAME}.gem",
|
97
|
-
# "pkg/#{PKG_FILE_NAME}.tgz",
|
98
|
-
# "pkg/#{PKG_FILE_NAME}.zip"
|
99
|
-
# ]
|
100
|
-
#
|
101
|
-
# Rake::XForge::Release.new(MetaProject::Project::XForge::RubyForge.new(PKG_NAME)) do |xf|
|
102
|
-
# # Never hardcode user name and password in the Rakefile!
|
103
|
-
# xf.user_name = ENV['RUBYFORGE_USER']
|
104
|
-
# xf.password = ENV['RUBYFORGE_PASSWORD']
|
105
|
-
# xf.files = release_files.to_a
|
106
|
-
# xf.release_name = "Scruffy #{PKG_VERSION}"
|
107
|
-
# end
|
108
|
-
#end
|
data/config/hoe.rb
DELETED
@@ -1,78 +0,0 @@
|
|
1
|
-
require 'scruffy/version'
|
2
|
-
|
3
|
-
AUTHOR = 'Brasten Sager' # can also be an array of Authors
|
4
|
-
# , 'David Parry', 'A.J. Ostman', 'Mat Schaffer']
|
5
|
-
# (Using array of authors doesn't work for some reason.
|
6
|
-
|
7
|
-
EMAIL = ["brasten@nagilum.com", "david.parry@suranyami.com"]
|
8
|
-
DESCRIPTION = "Scruffy is a Ruby library for generating high quality, good looking graphs. It is designed to be easy to use and highly customizable."
|
9
|
-
SUMMARY = 'A powerful, clean graphing library for Ruby.'
|
10
|
-
GEM_NAME = 'scruffy' # what ppl will type to install your gem
|
11
|
-
RUBYFORGE_PROJECT = 'scruffy' # The unix name for your project
|
12
|
-
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
13
|
-
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
|
14
|
-
EXTRA_DEPENDENCIES = [
|
15
|
-
['builder', '>= 2.0'],
|
16
|
-
['diff-lcs', '>= 1.1.2']
|
17
|
-
] # An array of rubygem dependencies [name, version]
|
18
|
-
|
19
|
-
@config_file = "~/.rubyforge/user-config.yml"
|
20
|
-
@config = nil
|
21
|
-
RUBYFORGE_USERNAME = "unknown"
|
22
|
-
def rubyforge_username
|
23
|
-
unless @config
|
24
|
-
begin
|
25
|
-
@config = YAML.load(File.read(File.expand_path(@config_file)))
|
26
|
-
rescue
|
27
|
-
puts <<-EOS
|
28
|
-
ERROR: No rubyforge config file found: #{@config_file}
|
29
|
-
Run 'rubyforge setup' to prepare your env for access to Rubyforge
|
30
|
-
- See http://newgem.rubyforge.org/rubyforge.html for more details
|
31
|
-
EOS
|
32
|
-
exit
|
33
|
-
end
|
34
|
-
end
|
35
|
-
RUBYFORGE_USERNAME.replace @config["username"]
|
36
|
-
end
|
37
|
-
|
38
|
-
|
39
|
-
REV = nil
|
40
|
-
# UNCOMMENT IF REQUIRED:
|
41
|
-
# REV = YAML.load(`svn info`)['Revision']
|
42
|
-
VERS = Scruffy::VERSION::STRING + (REV ? ".#{REV}" : "")
|
43
|
-
RDOC_OPTS = ['--quiet', '--title', 'scruffy documentation',
|
44
|
-
"--opname", "index.html",
|
45
|
-
"--line-numbers",
|
46
|
-
"--main", "README",
|
47
|
-
"--inline-source"]
|
48
|
-
|
49
|
-
class Hoe
|
50
|
-
def extra_deps
|
51
|
-
@extra_deps.reject! { |x| Array(x).first == 'hoe' }
|
52
|
-
@extra_deps
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
# Generate all the Rake tasks
|
57
|
-
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
58
|
-
$hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
59
|
-
p.developer(AUTHOR, EMAIL)
|
60
|
-
p.description = DESCRIPTION
|
61
|
-
p.summary = SUMMARY
|
62
|
-
p.url = HOMEPATH
|
63
|
-
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
64
|
-
p.test_globs = ["test/**/*_test.rb"]
|
65
|
-
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
|
66
|
-
|
67
|
-
# == Optional
|
68
|
-
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
69
|
-
#p.extra_deps = EXTRA_DEPENDENCIES
|
70
|
-
|
71
|
-
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
72
|
-
end
|
73
|
-
|
74
|
-
CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
|
75
|
-
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
|
76
|
-
$hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
77
|
-
$hoe.rsync_args = '-av --delete --ignore-errors'
|
78
|
-
$hoe.spec.post_install_message = File.open(File.dirname(__FILE__) + "/../PostInstall.txt").read rescue ""
|
data/config/requirements.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
include FileUtils
|
3
|
-
|
4
|
-
require 'rubygems'
|
5
|
-
%w[rake hoe newgem rubigen].each do |req_gem|
|
6
|
-
begin
|
7
|
-
require req_gem
|
8
|
-
rescue LoadError
|
9
|
-
puts "This Rakefile requires the '#{req_gem}' RubyGem."
|
10
|
-
puts "Installation: gem install #{req_gem} -y"
|
11
|
-
exit
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
|
data/script/console
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# File: script/console
|
3
|
-
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
-
|
5
|
-
libs = " -r irb/completion"
|
6
|
-
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
-
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
-
libs << " -r #{File.dirname(__FILE__) + '/../lib/scruffy.rb'}"
|
9
|
-
puts "Loading scruffy gem"
|
10
|
-
exec "#{irb} #{libs} --simple-prompt"
|
data/script/destroy
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'rubigen'
|
6
|
-
rescue LoadError
|
7
|
-
require 'rubygems'
|
8
|
-
require 'rubigen'
|
9
|
-
end
|
10
|
-
require 'rubigen/scripts/destroy'
|
11
|
-
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
-
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
-
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/generate
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'rubigen'
|
6
|
-
rescue LoadError
|
7
|
-
require 'rubygems'
|
8
|
-
require 'rubigen'
|
9
|
-
end
|
10
|
-
require 'rubigen/scripts/generate'
|
11
|
-
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
-
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
-
RubiGen::Scripts::Generate.new.run(ARGV)
|
data/script/txt2html
DELETED
@@ -1,82 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
GEM_NAME = 'scruffy' # what ppl will type to install your gem
|
4
|
-
RUBYFORGE_PROJECT = 'scruffy'
|
5
|
-
|
6
|
-
require 'rubygems'
|
7
|
-
begin
|
8
|
-
require 'newgem'
|
9
|
-
require 'rubyforge'
|
10
|
-
rescue LoadError
|
11
|
-
puts "\n\nGenerating the website requires the newgem RubyGem"
|
12
|
-
puts "Install: gem install newgem\n\n"
|
13
|
-
exit(1)
|
14
|
-
end
|
15
|
-
require 'redcloth'
|
16
|
-
require 'syntax/convertors/html'
|
17
|
-
require 'erb'
|
18
|
-
require File.dirname(__FILE__) + "/../lib/#{GEM_NAME}/version.rb"
|
19
|
-
|
20
|
-
version = Scruffy::VERSION::STRING
|
21
|
-
download = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
|
22
|
-
|
23
|
-
def rubyforge_project_id
|
24
|
-
RubyForge.new.autoconfig["group_ids"][RUBYFORGE_PROJECT]
|
25
|
-
end
|
26
|
-
|
27
|
-
class Fixnum
|
28
|
-
def ordinal
|
29
|
-
# teens
|
30
|
-
return 'th' if (10..19).include?(self % 100)
|
31
|
-
# others
|
32
|
-
case self % 10
|
33
|
-
when 1: return 'st'
|
34
|
-
when 2: return 'nd'
|
35
|
-
when 3: return 'rd'
|
36
|
-
else return 'th'
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
class Time
|
42
|
-
def pretty
|
43
|
-
return "#{mday}#{mday.ordinal} #{strftime('%B')} #{year}"
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def convert_syntax(syntax, source)
|
48
|
-
return Syntax::Convertors::HTML.for_syntax(syntax).convert(source).gsub(%r!^<pre>|</pre>$!,'')
|
49
|
-
end
|
50
|
-
|
51
|
-
if ARGV.length >= 1
|
52
|
-
src, template = ARGV
|
53
|
-
template ||= File.join(File.dirname(__FILE__), '/../website/template.html.erb')
|
54
|
-
else
|
55
|
-
puts("Usage: #{File.split($0).last} source.txt [template.html.erb] > output.html")
|
56
|
-
exit!
|
57
|
-
end
|
58
|
-
|
59
|
-
template = ERB.new(File.open(template).read)
|
60
|
-
|
61
|
-
title = nil
|
62
|
-
body = nil
|
63
|
-
File.open(src) do |fsrc|
|
64
|
-
title_text = fsrc.readline
|
65
|
-
body_text_template = fsrc.read
|
66
|
-
body_text = ERB.new(body_text_template).result(binding)
|
67
|
-
syntax_items = []
|
68
|
-
body_text.gsub!(%r!<(pre|code)[^>]*?syntax=['"]([^'"]+)[^>]*>(.*?)</\1>!m){
|
69
|
-
ident = syntax_items.length
|
70
|
-
element, syntax, source = $1, $2, $3
|
71
|
-
syntax_items << "<#{element} class='syntax'>#{convert_syntax(syntax, source)}</#{element}>"
|
72
|
-
"syntax-temp-#{ident}"
|
73
|
-
}
|
74
|
-
title = RedCloth.new(title_text).to_html.gsub(%r!<.*?>!,'').strip
|
75
|
-
body = RedCloth.new(body_text).to_html
|
76
|
-
body.gsub!(%r!(?:<pre><code>)?syntax-temp-(\d+)(?:</code></pre>)?!){ syntax_items[$1.to_i] }
|
77
|
-
end
|
78
|
-
stat = File.stat(src)
|
79
|
-
created = stat.ctime
|
80
|
-
modified = stat.mtime
|
81
|
-
|
82
|
-
$stdout << template.result(binding)
|