blog_logic 1.4.3 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/models/blog.rb +7 -0
- data/app/models/post.rb +7 -0
- data/blog_logic.gemspec +2 -2
- data/features/support/env.rb +37 -31
- data/lib/tasks/cucumber.rake +12 -0
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.4
|
data/app/models/blog.rb
CHANGED
@@ -62,6 +62,13 @@ class Blog
|
|
62
62
|
"/#{self.slug}"
|
63
63
|
end
|
64
64
|
|
65
|
+
# Returns this blog's path with a trailing slash.
|
66
|
+
#
|
67
|
+
# @return [String] the path for this blog
|
68
|
+
def path_ts
|
69
|
+
"#{self.path}/"
|
70
|
+
end
|
71
|
+
|
65
72
|
# Returns this blog's posts keyed by publication date.
|
66
73
|
#
|
67
74
|
# @return [Hash] this blog's posts keyed by publication date
|
data/app/models/post.rb
CHANGED
@@ -108,6 +108,13 @@ class Post
|
|
108
108
|
"#{self.blog.path}/#{self.slug}".gsub('//', '/')
|
109
109
|
end
|
110
110
|
|
111
|
+
# Returns this post's path with a trailing slash.
|
112
|
+
#
|
113
|
+
# @return [String] the path for this post
|
114
|
+
def path_ts
|
115
|
+
"#{self.path}/"
|
116
|
+
end
|
117
|
+
|
111
118
|
# Returns the previous post in the blog.
|
112
119
|
#
|
113
120
|
# @return [Post] the previous post
|
data/blog_logic.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "blog_logic"
|
8
|
-
s.version = "1.4.
|
8
|
+
s.version = "1.4.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Bantik"]
|
12
|
-
s.date = "2011-11-
|
12
|
+
s.date = "2011-11-14"
|
13
13
|
s.description = "An engine for search-engine-optimized blog management."
|
14
14
|
s.email = "corey@seologic.com"
|
15
15
|
s.extra_rdoc_files = [
|
data/features/support/env.rb
CHANGED
@@ -3,43 +3,49 @@
|
|
3
3
|
# newer version of cucumber-rails. Consider adding your own code to a new file
|
4
4
|
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
5
5
|
# files.
|
6
|
+
require 'cucumber/rails'
|
7
|
+
require 'spec/blueprints'
|
6
8
|
|
7
|
-
ENV["RAILS_ENV"] ||= "test"
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
|
9
|
-
require File.expand_path(File.dirname(__FILE__) + "/../../spec/blueprints")
|
10
|
-
|
11
|
-
require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support
|
12
|
-
require 'cucumber/rails/rspec'
|
13
|
-
require 'cucumber/rails/world'
|
14
|
-
require 'cucumber/web/tableish'
|
15
|
-
|
16
|
-
require 'capybara/rails'
|
17
|
-
require 'capybara/cucumber'
|
18
|
-
require 'capybara/session'
|
19
|
-
#require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript
|
20
9
|
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
|
21
10
|
# order to ease the transition to Capybara we set the default here. If you'd
|
22
11
|
# prefer to use XPath just remove this line and adjust any selectors in your
|
23
12
|
# steps to use the XPath syntax.
|
24
13
|
Capybara.default_selector = :css
|
25
14
|
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
15
|
+
# By default, any exception happening in your Rails application will bubble up
|
16
|
+
# to Cucumber so that your scenario will fail. This is a different from how
|
17
|
+
# your application behaves in the production environment, where an error page will
|
18
|
+
# be rendered instead.
|
19
|
+
#
|
20
|
+
# Sometimes we want to override this default behaviour and allow Rails to rescue
|
21
|
+
# exceptions and display an error page (just like when the app is running in production).
|
22
|
+
# Typical scenarios where you want to do this is when you test your error pages.
|
23
|
+
# There are two ways to allow Rails to rescue exceptions:
|
24
|
+
#
|
25
|
+
# 1) Tag your scenario (or feature) with @allow-rescue
|
26
|
+
#
|
27
|
+
# 2) Set the value below to true. Beware that doing this globally is not
|
28
|
+
# recommended as it will mask a lot of errors for you!
|
29
|
+
#
|
30
|
+
ActionController::Base.allow_rescue = false
|
31
|
+
|
32
|
+
# Remove/comment out the lines below if your app doesn't have a database.
|
33
|
+
# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
|
34
|
+
DatabaseCleaner.strategy = :truncation
|
35
|
+
|
36
|
+
# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
|
37
|
+
# See the DatabaseCleaner documentation for details. Example:
|
38
|
+
#
|
39
|
+
# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
|
40
|
+
# DatabaseCleaner.strategy = :truncation, {:except => %w[widgets]}
|
41
|
+
# end
|
42
|
+
#
|
43
|
+
# Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
|
44
|
+
# DatabaseCleaner.strategy = :transaction
|
45
|
+
# end
|
30
46
|
#
|
31
|
-
# If you set this to true, Rails will rescue all errors and render error
|
32
|
-
# pages, more or less in the same way your application would behave in the
|
33
|
-
# default production environment. It's not recommended to do this for all
|
34
|
-
# of your scenarios, as this makes it hard to discover errors in your application.
|
35
|
-
# ActionController::Base.allow_rescue = false
|
36
47
|
|
37
|
-
#
|
38
|
-
#
|
39
|
-
|
40
|
-
|
41
|
-
require 'database_cleaner'
|
42
|
-
DatabaseCleaner.strategy = :truncation
|
43
|
-
rescue LoadError => ignore_if_database_cleaner_not_present
|
44
|
-
end
|
45
|
-
end
|
48
|
+
# Possible values are :truncation and :transaction
|
49
|
+
# The :transaction strategy is faster, but might give you threading problems.
|
50
|
+
# See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature
|
51
|
+
Cucumber::Rails::Database.javascript_strategy = :truncation
|
data/lib/tasks/cucumber.rake
CHANGED
@@ -34,6 +34,12 @@ begin
|
|
34
34
|
|
35
35
|
desc 'Run all features'
|
36
36
|
task :all => [:ok, :wip]
|
37
|
+
|
38
|
+
task :statsetup do
|
39
|
+
require 'rails/code_statistics'
|
40
|
+
::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
|
41
|
+
::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features')
|
42
|
+
end
|
37
43
|
end
|
38
44
|
desc 'Alias for cucumber:ok'
|
39
45
|
task :cucumber => 'cucumber:ok'
|
@@ -43,6 +49,12 @@ begin
|
|
43
49
|
task :features => :cucumber do
|
44
50
|
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
|
45
51
|
end
|
52
|
+
|
53
|
+
# In case we don't have ActiveRecord, append a no-op task that we can depend upon.
|
54
|
+
task 'db:test:prepare' do
|
55
|
+
end
|
56
|
+
|
57
|
+
task :stats => 'cucumber:statsetup'
|
46
58
|
rescue LoadError
|
47
59
|
desc 'cucumber rake task not available (cucumber not installed)'
|
48
60
|
task :cucumber do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blog_logic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 1.4.
|
9
|
+
- 4
|
10
|
+
version: 1.4.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Bantik
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-11-
|
18
|
+
date: 2011-11-14 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: bson_ext
|