Skip to content
Browse files

Started converting dbpedialite to ruby 1.9.3

  • Loading branch information...
1 parent 0ef2aa0 commit 436c05573b2622ca4934ca6ebf42c81da6e31f77 @njh committed
Showing with 69 additions and 61 deletions.
  1. +1 −1 .ruby-version
  2. +2 −2 Gemfile
  3. +63 −50 Gemfile.lock
  4. +1 −1 dbpedialite.rb
  5. +2 −7 spec/dbpedialite_spec.rb
View
2 .ruby-version
@@ -1 +1 @@
-1.8.7-p358
+1.9.3-p194
View
4 Gemfile
@@ -1,5 +1,5 @@
source "http://rubygems.org"
-#ruby "1.8.7"
+ruby "1.9.3"
gem 'sinatra'
gem 'sinatra-contrib', :require => 'sinatra/content_for'
@@ -25,7 +25,7 @@ group :test do
gem 'rspec', '>=2.7.0'
gem 'mocha'
gem 'fakeweb'
- gem 'rcov'
+ gem 'simplecov'
gem 'rack-test', :require => 'rack/test'
gem 'rdf-rdfa', :require => 'rdf/rdfa'
gem 'equivalent-xml'
View
113 Gemfile.lock
@@ -1,73 +1,86 @@
GEM
remote: http://rubygems.org/
specs:
- addressable (2.2.8)
- backports (2.6.5)
- diff-lcs (1.1.3)
+ addressable (2.3.5)
+ backports (3.3.4)
+ diff-lcs (1.2.4)
doodle (0.2.3)
+ ebnf (0.3.1)
+ rdf
+ sxp
emk-sinatra-url-for (0.2.1)
sinatra (>= 0.9.1.1)
- equivalent-xml (0.2.9)
+ equivalent-xml (0.3.0)
nokogiri (>= 1.4.3)
- eventmachine (1.0.0)
fakeweb (1.3.0)
- haml (3.1.4)
+ haml (4.0.3)
+ tilt
htmlentities (4.3.1)
- json_pure (1.7.0)
+ json (1.8.0)
+ json_pure (1.8.0)
metaclass (0.0.1)
- mocha (0.11.4)
+ mini_portile (0.5.1)
+ mocha (0.14.0)
metaclass (~> 0.0.1)
- nokogiri (1.5.5)
- rack (1.4.1)
- rack-protection (1.2.0)
+ multi_json (1.8.0)
+ nokogiri (1.6.0)
+ mini_portile (~> 0.5.0)
+ rack (1.5.2)
+ rack-protection (1.5.0)
rack
- rack-test (0.6.1)
+ rack-test (0.6.2)
rack (>= 1.0)
- rake (0.9.2.2)
- rcov (1.0.0)
- rdf (0.3.5.2)
- addressable (>= 2.2.6)
- rdf-json (0.3.0)
- json_pure (>= 1.4.2)
- rdf (~> 0.3.0)
- rdf-rdfa (0.3.10)
- haml (>= 3.0.0)
- htmlentities (>= 4.3.0)
- rdf (>= 0.3.3)
- rdf-xsd (>= 0.3.5)
- rdf-rdfxml (0.3.7)
- rdf (>= 0.3.4)
- rdf-xsd (>= 0.3.5)
- rdf-trix (0.3.0)
- rdf (~> 0.3.0)
- rdf-turtle (0.1.1)
- rdf (>= 0.3.4)
- rdf-xsd (0.3.5)
+ rake (10.1.0)
+ rdf (1.0.8)
+ addressable (>= 2.2)
+ rdf-json (1.0.0)
+ json_pure (>= 1.4)
+ rdf (>= 1.0)
+ rdf-rdfa (1.0.2)
+ haml (>= 4.0)
+ htmlentities (>= 4.3.1)
+ rdf (>= 1.0.5)
+ rdf-xsd (>= 1.0)
+ rdf-rdfxml (1.0.2)
+ rdf (>= 1.0)
+ rdf-xsd (>= 1.0)
+ rdf-trix (1.0.0)
+ rdf (>= 1.0)
+ rdf-turtle (1.0.9)
+ ebnf (>= 0.3.0)
+ rdf (>= 1.0.7)
+ rdf-xsd (1.0.2.1)
nokogiri (>= 1.5.0)
rdf (>= 0.3.4)
- rdiscount (1.6.8)
- rspec (2.10.0)
- rspec-core (~> 2.10.0)
- rspec-expectations (~> 2.10.0)
- rspec-mocks (~> 2.10.0)
- rspec-core (2.10.1)
- rspec-expectations (2.10.0)
- diff-lcs (~> 1.1.3)
- rspec-mocks (2.10.1)
+ rdiscount (2.1.6)
+ rspec (2.14.1)
+ rspec-core (~> 2.14.0)
+ rspec-expectations (~> 2.14.0)
+ rspec-mocks (~> 2.14.0)
+ rspec-core (2.14.5)
+ rspec-expectations (2.14.3)
+ diff-lcs (>= 1.1.3, < 2.0)
+ rspec-mocks (2.14.3)
shotgun (0.9)
rack (>= 1.0)
- sinatra (1.3.3)
- rack (~> 1.3, >= 1.3.6)
- rack-protection (~> 1.2)
- tilt (~> 1.3, >= 1.3.3)
- sinatra-contrib (1.3.2)
+ simplecov (0.7.1)
+ multi_json (~> 1.0)
+ simplecov-html (~> 0.7.1)
+ simplecov-html (0.7.1)
+ sinatra (1.4.3)
+ rack (~> 1.4)
+ rack-protection (~> 1.4)
+ tilt (~> 1.3, >= 1.3.4)
+ sinatra-contrib (1.4.1)
backports (>= 2.0)
- eventmachine
+ multi_json
rack-protection
rack-test
- sinatra (~> 1.3.0)
+ sinatra (~> 1.4.0)
tilt (~> 1.3)
- tilt (1.3.3)
+ sxp (0.1.3)
+ json (>= 1.1.1)
+ tilt (1.4.1)
PLATFORMS
ruby
@@ -82,7 +95,6 @@ DEPENDENCIES
nokogiri
rack-test
rake
- rcov
rdf (>= 0.3.1)
rdf-json
rdf-rdfa
@@ -92,5 +104,6 @@ DEPENDENCIES
rdiscount
rspec (>= 2.7.0)
shotgun
+ simplecov
sinatra
sinatra-contrib
View
2 dbpedialite.rb
@@ -154,7 +154,7 @@ def format_iso8061(datetime)
end
before do
- if production? and request.host != DEFAULT_HOST
+ if settings.production? and request.host != DEFAULT_HOST
headers 'Cache-Control' => 'public,max-age=3600'
redirect "http://" + DEFAULT_HOST + request.path, 301
end
View
9 spec/dbpedialite_spec.rb
@@ -4,8 +4,6 @@
## Note: these are integration tests. Mocking is done using FakeWeb.
-set :environment, :test
-
describe 'dbpedia lite' do
include Rack::Test::Methods
@@ -16,6 +14,7 @@ def app
before :each do
app.enable :raise_errors
app.disable :show_exceptions
+ app.settings.set :environment, :test
end
context "GETing the homepage" do
@@ -46,14 +45,10 @@ def app
context "in a production environment" do
before :each do
- set :environment, :production
+ app.settings.set :environment, :production
get '/'
end
- after :each do
- set :environment, :test
- end
-
it "should redirect" do
last_response.status.should == 301
last_response.location.should == 'http://dbpedialite.org/'

0 comments on commit 436c055

Please sign in to comment.
Something went wrong with that request. Please try again.