Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moved from Jeweler to Bundler, fixed a couple of resulting issues

  • Loading branch information...
commit 55ae8df2be00909d14837d68c5f8dd76c124e0ac 1 parent a69b47d
@colszowka colszowka authored
View
2  .gitignore
@@ -18,6 +18,8 @@ coverage
rdoc
pkg
.bundle
+Gemfile.lock
+.rvmrc
## PROJECT::SPECIFIC
View
15 Gemfile
@@ -1,16 +1,3 @@
source :rubygems
-gem 'sinatra', ">= 1.0.0"
-gem 'stupid_formatter', '>= 0.2.0'
-gem 'builder', ">= 2.1.2"
-group :development do
- gem "shoulda", "= 2.10.3"
- gem "hpricot", ">= 0.8.0"
- gem "rack-test", ">= 0.5.0"
- gem 'jeweler', ">= 1.4.0"
-
- if "1.9".respond_to?(:encoding)
- gem "simple_cov", ">= 0.1.2"
- gem "simple_cov-html", ">= 0.1.1"
- end
-end
+gemspec
View
42 Gemfile.lock
@@ -1,42 +0,0 @@
-GEM
- remote: http://rubygems.org/
- specs:
- builder (2.1.2)
- coderay (0.9.3)
- gemcutter (0.6.1)
- git (1.2.5)
- hpricot (0.8.2)
- jeweler (1.4.0)
- gemcutter (>= 0.1.0)
- git (>= 1.2.5)
- rubyforge (>= 2.0.0)
- json_pure (1.4.6)
- rack (1.2.1)
- rack-test (0.5.4)
- rack (>= 1.0)
- rdiscount (1.6.5)
- rubyforge (2.0.4)
- json_pure (>= 1.1.7)
- shoulda (2.10.3)
- simple_cov (0.1.2)
- simple_cov-html (0.1.1)
- simple_cov (>= 0.0.2)
- sinatra (1.0)
- rack (>= 1.0)
- stupid_formatter (0.2.0)
- coderay (>= 0.9.0)
- rdiscount (>= 1.5.0)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- builder (>= 2.1.2)
- hpricot (>= 0.8.0)
- jeweler (>= 1.4.0)
- rack-test (>= 0.5.0)
- shoulda (= 2.10.3)
- simple_cov (>= 0.1.2)
- simple_cov-html (>= 0.1.1)
- sinatra (>= 1.0.0)
- stupid_formatter (>= 0.2.0)
View
52 Rakefile
@@ -1,34 +1,6 @@
# encoding: utf-8
-require 'rubygems'
-require 'rake'
-
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "serious"
- gem.summary = %Q{Serious is a simple, file-driven blog engine inspired by toto and driven by sinatra with an emphasis on easy setup}
- gem.description = %Q{Serious is a simple, file-driven blog engine inspired by toto and driven by sinatra with an emphasis on easy setup.}
- gem.email = "christoph at olszowka.de"
- gem.homepage = "http://github.com/colszowka/serious"
- gem.authors = ["Christoph Olszowka"]
-
- gem.bindir = 'bin'
- gem.executables = ['serious']
- gem.default_executable = 'serious'
-
- gem.add_dependency 'sinatra', ">= 1.0.0"
- gem.add_dependency 'stupid_formatter', '>= 0.2.0'
- gem.add_dependency 'builder', ">= 2.1.2"
-
- gem.add_development_dependency "shoulda", ">= 2.10.0"
- gem.add_development_dependency "hpricot", ">= 0.8.0"
- gem.add_development_dependency "rack-test", ">= 0.5.0"
- gem.add_development_dependency "jeweler", ">= 1.4.0"
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
-end
+require 'bundler'
+Bundler::GemHelper.install_tasks
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
@@ -37,29 +9,11 @@ Rake::TestTask.new(:test) do |test|
test.verbose = true
end
-begin
- require 'rcov/rcovtask'
- Rcov::RcovTask.new do |test|
- test.libs << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
- end
-rescue LoadError
- task :rcov do
- abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
- end
-end
-
-task :test => :check_dependencies
-
task :default => :test
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
-
rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "serious #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
-end
+end
View
1  VERSION
@@ -1 +0,0 @@
-0.3.0
View
2  bin/serious
@@ -95,7 +95,7 @@ end
puts "Creating bundler Gemfile"
File.open("Gemfile", "w+") do |gems|
gems.puts "source :rubygems"
- gems.puts 'gem "serious", ">= ' + File.read(File.join(GEM_ROOT, 'VERSION')).strip.chomp + '"'
+ gems.puts 'gem "serious"'
end
puts "Creating Rakefile"
View
5 lib/serious.rb
@@ -11,8 +11,6 @@
require 'stupid_formatter'
require 'yaml'
require 'builder'
-
-$:.unshift File.dirname(__FILE__)
require 'ruby_ext'
class Serious < Sinatra::Base
@@ -88,6 +86,7 @@ def render_partial(name)
end
end
+require 'serious/version'
require 'serious/article'
require 'serious/page'
# Set up default stupid_formatter chain
@@ -103,7 +102,7 @@ def render_partial(name)
Serious.set :archived_on_index, 10 # Number of items to display small (title only) on main page
Serious.set :cache_timeout, 300
Serious.set :run, false
-Serious.set :environment, :production
+Serious.set :environment, :test
Serious.set :date_format, "%B %o %Y"
Serious.set :disqus, false
Serious.set :google_analytics, false
View
5 lib/serious/version.rb
@@ -0,0 +1,5 @@
+# Define it as a plain constant instead of Bundler best-practice of
+# Serious::VERSION since Serious is a class that inherits from Sinatra::Base
+# and we'd be getting Superclass mismatch errors here since Sinatra is
+# unavailable when evaluating this file standalone...
+SERIOUS_VERSION = '0.3.1'
View
5 lib/site/views/atom.builder
@@ -1,4 +1,4 @@
-xml.instruct!
+xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
xml.title Serious.title
xml.id Serious.url
@@ -17,5 +17,4 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
xml.content article.body.formatted, "type" => "html"
end
end
-end
-
+end
View
131 serious.gemspec
@@ -1,107 +1,34 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "serious/version"
Gem::Specification.new do |s|
- s.name = %q{serious}
- s.version = "0.3.0"
+ s.name = "serious"
+ s.version = SERIOUS_VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Christoph Olszowka"]
+ s.email = ["christoph at olszowka de"]
+ s.homepage = "https://github.com/colszowka/serious"
+ s.summary = %Q{Serious is a simple, file-driven blog engine inspired by toto and driven by sinatra with an emphasis on easy setup}
+ s.description = %Q{Serious is a simple, file-driven blog engine inspired by toto and driven by sinatra with an emphasis on easy setup}
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Christoph Olszowka"]
- s.date = %q{2010-08-17}
- s.default_executable = %q{serious}
- s.description = %q{Serious is a simple, file-driven blog engine inspired by toto and driven by sinatra with an emphasis on easy setup.}
- s.email = %q{christoph at olszowka.de}
- s.executables = ["serious"]
- s.extra_rdoc_files = [
- "LICENSE",
- "README.rdoc"
- ]
- s.files = [
- ".document",
- ".gitignore",
- "CHANGELOG.rdoc",
- "Gemfile",
- "Gemfile.lock",
- "LICENSE",
- "README.rdoc",
- "Rakefile",
- "VERSION",
- "bin/serious",
- "lib/ruby_ext.rb",
- "lib/serious.rb",
- "lib/serious/article.rb",
- "lib/serious/page.rb",
- "lib/serious/tasks.rb",
- "lib/site/public/css/coderay.css",
- "lib/site/public/css/serious.css",
- "lib/site/views/404.erb",
- "lib/site/views/_archives.erb",
- "lib/site/views/_article.erb",
- "lib/site/views/_disqus.erb",
- "lib/site/views/_google_analytics.erb",
- "lib/site/views/archives.erb",
- "lib/site/views/atom.builder",
- "lib/site/views/index.erb",
- "lib/site/views/layout.erb",
- "serious.gemspec",
- "test/articles/2000-01-01-disco-2000.txt",
- "test/articles/2009-04-01-foo-bar.txt",
- "test/articles/2009-12-11-ruby-is-the-shit.txt",
- "test/articles/2009-12-24-merry-christmas.txt",
- "test/helper.rb",
- "test/pages/about.txt",
- "test/pages/foo-bar.txt",
- "test/test_article.rb",
- "test/test_bin.rb",
- "test/test_page.rb",
- "test/test_ruby_ext.rb",
- "test/test_serious.rb"
- ]
- s.homepage = %q{http://github.com/colszowka/serious}
- s.rdoc_options = ["--charset=UTF-8"]
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.7}
- s.summary = %q{Serious is a simple, file-driven blog engine inspired by toto and driven by sinatra with an emphasis on easy setup}
- s.test_files = [
- "test/helper.rb",
- "test/test_article.rb",
- "test/test_bin.rb",
- "test/test_page.rb",
- "test/test_ruby_ext.rb",
- "test/test_serious.rb"
- ]
-
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
-
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<sinatra>, [">= 1.0.0"])
- s.add_runtime_dependency(%q<stupid_formatter>, [">= 0.2.0"])
- s.add_runtime_dependency(%q<builder>, [">= 2.1.2"])
- s.add_development_dependency(%q<shoulda>, [">= 2.10.0"])
- s.add_development_dependency(%q<hpricot>, [">= 0.8.0"])
- s.add_development_dependency(%q<rack-test>, [">= 0.5.0"])
- s.add_development_dependency(%q<jeweler>, [">= 1.4.0"])
- else
- s.add_dependency(%q<sinatra>, [">= 1.0.0"])
- s.add_dependency(%q<stupid_formatter>, [">= 0.2.0"])
- s.add_dependency(%q<builder>, [">= 2.1.2"])
- s.add_dependency(%q<shoulda>, [">= 2.10.0"])
- s.add_dependency(%q<hpricot>, [">= 0.8.0"])
- s.add_dependency(%q<rack-test>, [">= 0.5.0"])
- s.add_dependency(%q<jeweler>, [">= 1.4.0"])
- end
- else
- s.add_dependency(%q<sinatra>, [">= 1.0.0"])
- s.add_dependency(%q<stupid_formatter>, [">= 0.2.0"])
- s.add_dependency(%q<builder>, [">= 2.1.2"])
- s.add_dependency(%q<shoulda>, [">= 2.10.0"])
- s.add_dependency(%q<hpricot>, [">= 0.8.0"])
- s.add_dependency(%q<rack-test>, [">= 0.5.0"])
- s.add_dependency(%q<jeweler>, [">= 1.4.0"])
- end
-end
+ s.rubyforge_project = "serious"
+
+ s.bindir = 'bin'
+ s.executables = ['serious']
+ s.default_executable = 'serious'
+
+ s.add_dependency 'sinatra', ">= 1.0.0"
+ s.add_dependency 'stupid_formatter', '>= 0.2.0'
+ s.add_dependency 'builder', ">= 2.1.2"
+
+ s.add_development_dependency "shoulda", "2.10.3"
+ s.add_development_dependency "hpricot", ">= 0.8.0"
+ s.add_development_dependency "rack-test", ">= 0.5.0"
+ s.add_development_dependency 'simplecov'
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+end
View
20 test/helper.rb
@@ -1,25 +1,17 @@
# encoding: utf-8
+ENV['RACK_ENV'] = 'test'
require 'rubygems'
-require 'bundler'
-Bundler.setup(:default, :development)
-if "1.9".respond_to?(:encoding)
- require 'simple_cov'
- require 'simple_cov-html'
- SimpleCov.start do
- add_filter do |src_file|
- !(src_file.filename =~ /^#{Dir.getwd}/)
- end
- end
-end
+require 'bundler/setup'
+require 'simplecov'
+SimpleCov.start
+
+require 'serious'
require 'test/unit'
require 'shoulda'
require 'rack/test'
require 'hpricot'
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-$LOAD_PATH.unshift(File.dirname(__FILE__))
-require 'serious'
class Test::Unit::TestCase
include Rack::Test::Methods
View
2  test/test_bin.rb
@@ -40,7 +40,7 @@ class TestBin < Test::Unit::TestCase
when_running_serious_with 'foo', '--no-git' do
should_have_dir 'foo/articles'
should_have_dir 'foo/pages'
- should_have_file 'foo/Gemfile', 'gem "serious", "'
+ should_have_file 'foo/Gemfile', 'gem "serious"'
should_not_have_path 'foo/public'
should_not_have_path 'foo/views'
should_have_git_commit 'foo', 'Initial commit'
View
2  test/test_serious.rb
@@ -201,7 +201,7 @@ class TestSerious < Test::Unit::TestCase
should_respond_with 200
should_set_cache_control_to 300
- should_contain_text "Merry Christmas! &#9731;", "feed entry:first title"
+ should_contain_text "Merry Christmas! ", "feed entry:first title"
should_contain_text "Christoph Olszowka", "feed entry:first author name:first"
end
Please sign in to comment.
Something went wrong with that request. Please try again.