Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated manifest and added gemspec.

  • Loading branch information...
commit b0fb0ab88397831ab49ad0ce70a321de4483efea 1 parent be06c44
@jnunemaker authored
View
5 Manifest.txt
@@ -1,10 +1,13 @@
History.txt
License.txt
Manifest.txt
+PostInstall.txt
README.txt
Rakefile
config/hoe.rb
config/requirements.rb
+examples/account.rb
+examples/profile.rb
examples/profiles.rb
lib/statwhore.rb
lib/statwhore/connection.rb
@@ -14,7 +17,7 @@ lib/statwhore/google/analytics/account.rb
lib/statwhore/google/analytics/profile.rb
lib/statwhore/google/feedburner.rb
lib/statwhore/version.rb
-log/debug.log
+script/console
script/destroy
script/generate
script/txt2html
View
0  PostInstall.txt
No changes.
View
40 config/hoe.rb
@@ -7,6 +7,9 @@
RUBYFORGE_PROJECT = 'statwhore' # The unix name for your project
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
+EXTRA_DEPENDENCIES = [
+ ['googlebase', '>= 0.2.0'], ['activesupport', '>= 2.0.2'], ['hpricot', '>= 0.6']
+]
@config_file = "~/.rubyforge/user-config.yml"
@config = nil
@@ -28,42 +31,43 @@ def rubyforge_username
end
-REV = nil
-# UNCOMMENT IF REQUIRED:
-# REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
+REV = nil
+# UNCOMMENT IF REQUIRED:
+# REV = YAML.load(`svn info`)['Revision']
VERS = Statwhore::VERSION::STRING + (REV ? ".#{REV}" : "")
RDOC_OPTS = ['--quiet', '--title', 'statwhore documentation',
"--opname", "index.html",
- "--line-numbers",
+ "--line-numbers",
"--main", "README",
"--inline-source"]
class Hoe
- def extra_deps
- @extra_deps.reject! { |x| Array(x).first == 'hoe' }
+ def extra_deps
+ @extra_deps.reject! { |x| Array(x).first == 'hoe' }
@extra_deps
- end
+ end
end
# Generate all the Rake tasks
# Run 'rake -T' to see list of generated tasks (from gem root directory)
-hoe = Hoe.new(GEM_NAME, VERS) do |p|
- p.author = AUTHOR
+$hoe = Hoe.new(GEM_NAME, VERS) do |p|
+ p.developer(AUTHOR, EMAIL)
p.description = DESCRIPTION
- p.email = EMAIL
p.summary = DESCRIPTION
p.url = HOMEPATH
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
p.test_globs = ["test/**/test_*.rb"]
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
-
+
# == Optional
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\\n\\n")
- p.extra_deps = [ ['googlebase', '>= 0.2.0'], ['activesupport', '>= 2.0.2'], ['hpricot', '>= 0.6'] ]
- #p.spec_extras = {} # A hash of extra values to set in the gemspec.
-
-end
+ p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
+ p.extra_deps = EXTRA_DEPENDENCIES
+
+ #p.spec_extras = {} # A hash of extra values to set in the gemspec.
+ end
-CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
+CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
-hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
+$hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
+$hoe.rsync_args = '-av --delete --ignore-errors'
+$hoe.spec.post_install_message = File.open(File.dirname(__FILE__) + "/../PostInstall.txt").read rescue ""
View
2  config/requirements.rb
@@ -13,5 +13,3 @@
end
$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
-
-require 'statwhore'
View
10 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/statwhore.rb'}"
+puts "Loading statwhore gem"
+exec "#{irb} #{libs} --simple-prompt"
View
4 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'
@@ -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)
View
4 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'
@@ -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)
View
20 script/txt2html
@@ -1,8 +1,12 @@
#!/usr/bin/env ruby
+GEM_NAME = 'statwhore' # what ppl will type to install your gem
+RUBYFORGE_PROJECT = 'statwhore'
+
require 'rubygems'
begin
require 'newgem'
+ require 'rubyforge'
rescue LoadError
puts "\n\nGenerating the website requires the newgem RubyGem"
puts "Install: gem install newgem\n\n"
@@ -11,10 +15,14 @@ end
require 'redcloth'
require 'syntax/convertors/html'
require 'erb'
-require File.dirname(__FILE__) + '/../lib/statwhore/version.rb'
+require File.dirname(__FILE__) + "/../lib/#{GEM_NAME}/version.rb"
version = Statwhore::VERSION::STRING
-download = 'http://rubyforge.org/projects/statwhore'
+download = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
+
+def rubyforge_project_id
+ RubyForge.new.autoconfig["group_ids"][RUBYFORGE_PROJECT]
+end
class Fixnum
def ordinal
@@ -42,10 +50,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
@@ -55,7 +62,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
View
39 statwhore.gemspec
@@ -0,0 +1,39 @@
+Gem::Specification.new do |s|
+ s.name = %q{statwhore}
+ s.version = "0.0.5"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["John Nunemaker"]
+ s.date = %q{2008-07-30}
+ s.description = %q{for the stat addict in us all}
+ s.email = ["nunemaker@gmail.com"]
+ s.extra_rdoc_files = ["History.txt", "License.txt", "Manifest.txt", "PostInstall.txt", "README.txt"]
+ s.files = ["History.txt", "License.txt", "Manifest.txt", "PostInstall.txt", "README.txt", "Rakefile", "config/hoe.rb", "config/requirements.rb", "examples/account.rb", "examples/profile.rb", "examples/profiles.rb", "lib/statwhore.rb", "lib/statwhore/connection.rb", "lib/statwhore/google.rb", "lib/statwhore/google/analytics.rb", "lib/statwhore/google/analytics/account.rb", "lib/statwhore/google/analytics/profile.rb", "lib/statwhore/google/feedburner.rb", "lib/statwhore/version.rb", "script/console", "script/destroy", "script/generate", "script/txt2html", "setup.rb", "spec/fixtures/analytics_account_find_all.html", "spec/fixtures/analytics_profile_find_all.html", "spec/fixtures/dashboard_report_webgroup.xml", "spec/spec.opts", "spec/spec_helper.rb", "spec/statwhore_google_analytics_account_spec.rb", "spec/statwhore_google_analytics_profile_spec.rb", "spec/statwhore_google_analytics_spec.rb", "tasks/deployment.rake", "tasks/environment.rake", "tasks/website.rake"]
+ s.has_rdoc = true
+ s.homepage = %q{http://statwhore.rubyforge.org}
+ s.post_install_message = %q{}
+ s.rdoc_options = ["--main", "README.txt"]
+ s.require_paths = ["lib"]
+ s.rubyforge_project = %q{statwhore}
+ s.rubygems_version = %q{1.2.0}
+ s.summary = %q{for the stat addict in us all}
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 2
+
+ if current_version >= 3 then
+ s.add_runtime_dependency(%q<googlebase>, [">= 0.2.0"])
+ s.add_runtime_dependency(%q<activesupport>, [">= 2.0.2"])
+ s.add_runtime_dependency(%q<hpricot>, [">= 0.6"])
+ else
+ s.add_dependency(%q<googlebase>, [">= 0.2.0"])
+ s.add_dependency(%q<activesupport>, [">= 2.0.2"])
+ s.add_dependency(%q<hpricot>, [">= 0.6"])
+ end
+ else
+ s.add_dependency(%q<googlebase>, [">= 0.2.0"])
+ s.add_dependency(%q<activesupport>, [">= 2.0.2"])
+ s.add_dependency(%q<hpricot>, [">= 0.6"])
+ end
+end
View
7 tasks/deployment.rake
@@ -25,3 +25,10 @@ desc 'Install the package as a gem, without generating documentation(ri/rdoc)'
task :install_gem_no_doc => [:clean, :package] do
sh "#{'sudo ' unless Hoe::WINDOZE }gem install pkg/*.gem --no-rdoc --no-ri"
end
+
+namespace :manifest do
+ desc 'Recreate Manifest.txt to include ALL files'
+ task :refresh do
+ `rake check_manifest | patch -p0 > Manifest.txt`
+ end
+end
View
8 tasks/website.rake
@@ -1,14 +1,14 @@
desc 'Generate website files'
task :website_generate => :ruby_env do
- # (Dir['website/**/*.txt'] - Dir['website/version*.txt']).each do |txt|
- # sh %{ #{RUBY_APP} script/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} }
- # end
+ (Dir['website/**/*.txt'] - Dir['website/version*.txt']).each do |txt|
+ sh %{ #{RUBY_APP} script/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} }
+ end
end
desc 'Upload website files to rubyforge'
task :website_upload do
host = "#{rubyforge_username}@rubyforge.org"
- remote_dir = "/var/www/gforge-projects/#{RUBYFORGE_PROJECT}/"
+ remote_dir = "/var/www/gforge-projects/#{PATH}/"
local_dir = 'website'
sh %{rsync -aCv #{local_dir}/ #{host}:#{remote_dir}}
end
Please sign in to comment.
Something went wrong with that request. Please try again.