Skip to content

Commit

Permalink
Clean up old hoe data, reorganize everything for betterness
Browse files Browse the repository at this point in the history
git-svn-id: http://random-data.rubyforge.org/svn@20 5dbe199c-8045-4628-879c-93ead0618a56
  • Loading branch information
subelsky committed Nov 7, 2008
1 parent ef8fb8a commit 141265a
Show file tree
Hide file tree
Showing 23 changed files with 76 additions and 2,297 deletions.
5 changes: 3 additions & 2 deletions History.txt
@@ -1,5 +1,6 @@
== 1.4.0 2008-11-06
* 1 major enhancement:
== 1.5.0 2008-11-06
* 2 major enhancement:
* Totally cleaned up and reconfigured hoe using newgem 1.0's conventions
* Added Markov model text generator (courtesy of Hugh Sasse)

* 1 minor enhancement:
Expand Down
15 changes: 2 additions & 13 deletions Manifest.txt
@@ -1,10 +1,8 @@
History.txt
License.txt
Manifest.txt
README.txt
README.rdoc
Rakefile
config/hoe.rb
config/requirements.rb
lib/random_data.rb
lib/random_data/array_randomizer.rb
lib/random_data/booleans.rb
Expand All @@ -17,19 +15,10 @@ lib/random_data/names.rb
lib/random_data/numbers.rb
lib/random_data/text.rb
lib/random_data/version.rb
log/debug.log
script/console
script/destroy
script/generate
script/txt2html
setup.rb
tasks/deployment.rake
tasks/environment.rake
tasks/website.rake
test/henry_v_prolog.txt
test/test_helper.rb
test/test_random_data.rb
website/index.html
website/index.txt
website/javascripts/rounded_corners_lite.inc.js
website/stylesheets/screen.css
website/template.rhtml
2 changes: 1 addition & 1 deletion README.txt → README.rdoc
@@ -1,4 +1,4 @@
= Random
= random_data

This gem provides a Random singleton class with a series of methods for generating random test data including names, mailing addresses, dates, phone numbers, e-mail addresses, and text. Instead of:

Expand Down
34 changes: 31 additions & 3 deletions Rakefile
@@ -1,4 +1,32 @@
require 'config/requirements'
require 'config/hoe' # setup Hoe + all gem configuration
%w[rubygems rake rake/clean fileutils newgem rubigen].each { |f| require f }
require File.dirname(__FILE__) + '/lib/random_data'

Dir['tasks/**/*.rake'].each { |rake| load rake }
# Generate all the Rake tasks
# Run 'rake -T' to see list of generated tasks (from gem root directory)
$hoe = Hoe.new('random_data', RandomData::VERSION) do |p|
p.developer('Mike Subelsky', 'mike@subelsky.com')
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
p.rubyforge_name = "random-data"
p.description = "A Ruby gem that provides a Random class with a series of methods for generating random test data including names, mailing addresses, dates, phone numbers, e-mail addresses, and text."
p.summary = "A Ruby gem that provides a Random class with a series of methods for generating random test data including names, mailing addresses, dates, phone numbers, e-mail addresses, and text."
p.email = 'random_data@mikeshop.net'
# p.remote_rdoc_dir = 'random-data'

# p.extra_deps = [
# ['activesupport','>= 2.0.2'],
# ]
p.extra_dev_deps = [
['newgem', ">= #{::Newgem::VERSION}"]
]

p.clean_globs |= %w[**/.DS_Store tmp *.log]
path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
p.rsync_args = '-av --delete --ignore-errors'
end

require 'newgem/tasks' # load /tasks/*.rake
Dir['tasks/**/*.rake'].each { |t| load t }

# TODO - want other tests/tasks run by default? Add them to the list
# task :default => [:spec, :features]
74 changes: 0 additions & 74 deletions config/hoe.rb

This file was deleted.

17 changes: 0 additions & 17 deletions config/requirements.rb

This file was deleted.

23 changes: 12 additions & 11 deletions lib/random_data.rb
@@ -1,15 +1,16 @@
$:.unshift File.dirname(__FILE__)
dir = "#{File.dirname(__FILE__)}/random_data"

require 'random_data/array_randomizer'
require 'random_data/booleans'
require 'random_data/contact_info'
require 'random_data/dates'
require 'random_data/locations'
require 'random_data/names'
require 'random_data/numbers'
require 'random_data/text'
require 'random_data/grammar'
require 'random_data/markov'
require "#{dir}/array_randomizer"
require "#{dir}/booleans"
require "#{dir}/contact_info"
require "#{dir}/dates"
require "#{dir}/locations"
require "#{dir}/names"
require "#{dir}/numbers"
require "#{dir}/text"
require "#{dir}/markov"
require "#{dir}/grammar"
require "#{dir}/version"

class Random
extend RandomData::Booleans
Expand Down
8 changes: 1 addition & 7 deletions lib/random_data/version.rb
@@ -1,9 +1,3 @@
module RandomData #:nodoc:
module VERSION #:nodoc:
MAJOR = 1
MINOR = 4
TINY = 0

STRING = [MAJOR, MINOR, TINY].join('.')
end
VERSION = '1.5.0' #:nodoc:
end
Empty file removed log/debug.log
Empty file.
10 changes: 10 additions & 0 deletions script/console
@@ -0,0 +1,10 @@
#!/usr/bin/env ruby
# File: script/console
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'

libs = " -r irb/completion"
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
libs << " -r #{File.dirname(__FILE__) + '/../lib/random_data.rb'}"
puts "Loading random_data gem"
exec "#{irb} #{libs} --simple-prompt"
4 changes: 2 additions & 2 deletions script/destroy
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
APP_ROOT = File.join(File.dirname(__FILE__), '..')
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))

begin
require 'rubigen'
Expand All @@ -10,5 +10,5 @@ end
require 'rubigen/scripts/destroy'

ARGV.shift if ['--help', '-h'].include?(ARGV[0])
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme]
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
RubiGen::Scripts::Destroy.new.run(ARGV)
4 changes: 2 additions & 2 deletions script/generate
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
APP_ROOT = File.join(File.dirname(__FILE__), '..')
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))

begin
require 'rubigen'
Expand All @@ -10,5 +10,5 @@ end
require 'rubigen/scripts/generate'

ARGV.shift if ['--help', '-h'].include?(ARGV[0])
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme]
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
RubiGen::Scripts::Generate.new.run(ARGV)
27 changes: 12 additions & 15 deletions script/txt2html
@@ -1,20 +1,17 @@
#!/usr/bin/env ruby

require 'rubygems'
begin
require 'newgem'
rescue LoadError
puts "\n\nGenerating the website requires the newgem RubyGem"
puts "Install: gem install newgem\n\n"
exit(1)
end
load File.dirname(__FILE__) + "/../Rakefile"
require 'rubyforge'
require 'redcloth'
require 'syntax/convertors/html'
require 'erb'
require File.dirname(__FILE__) + '/../lib/random_data/version.rb'

version = RandomData::VERSION::STRING
download = 'http://rubyforge.org/projects/random_data'
download = "http://rubyforge.org/projects/#{$hoe.rubyforge_name}"
version = $hoe.version

def rubyforge_project_id
RubyForge.new.configure.autoconfig["group_ids"][$hoe.rubyforge_name]
end

class Fixnum
def ordinal
Expand Down Expand Up @@ -42,10 +39,9 @@ end

if ARGV.length >= 1
src, template = ARGV
template ||= File.join(File.dirname(__FILE__), '/../website/template.rhtml')

template ||= File.join(File.dirname(__FILE__), '/../website/template.html.erb')
else
puts("Usage: #{File.split($0).last} source.txt [template.rhtml] > output.html")
puts("Usage: #{File.split($0).last} source.txt [template.html.erb] > output.html")
exit!
end

Expand All @@ -55,7 +51,8 @@ title = nil
body = nil
File.open(src) do |fsrc|
title_text = fsrc.readline
body_text = fsrc.read
body_text_template = fsrc.read
body_text = ERB.new(body_text_template).result(binding)
syntax_items = []
body_text.gsub!(%r!<(pre|code)[^>]*?syntax=['"]([^'"]+)[^>]*>(.*?)</\1>!m){
ident = syntax_items.length
Expand Down

0 comments on commit 141265a

Please sign in to comment.