blogit 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -49,7 +49,7 @@ module Blogit
49
49
  time_string = time_object.strftime(format)
50
50
  # if there's a specified format and it's a symbol, assume it's a predefined format
51
51
  elsif format && format.is_a?(Symbol)
52
- time_string = time_object.to_s(format)
52
+ time_string = I18n.localize(time_object, format: format)
53
53
  else
54
54
  time_string = time_object.to_s
55
55
  end
File without changes
@@ -7,7 +7,7 @@
7
7
  <%= render partial: "blogit/posts/post",
8
8
  collection: @posts,
9
9
  spacer_template: "blog_post_spacer",
10
- locals: {show_comments_count: true} %>
10
+ locals: {show_comments_count: (Blogit.configuration.include_comments == :active_records) } %>
11
11
  <% else %>
12
12
 
13
13
  <%= render partial: "blogit/posts/empty" %>
@@ -1,3 +1,4 @@
1
1
  <%= render @post %>
2
2
  <%= share_bar_for @post %>
3
+ <%= render "blogit/posts/post_footer", post: @post %>
3
4
  <%= comments_for @post %>
@@ -87,6 +87,7 @@ module Blogit
87
87
  # the "main_app." prefix ?
88
88
  attr_accessor :inline_main_app_named_routes
89
89
 
90
+ # When using redcarpet as content parser, pass these options as defaults.
90
91
  REDCARPET_OPTIONS = {
91
92
  hard_wrap: true,
92
93
  filter_html: true,
@@ -135,17 +136,17 @@ module Blogit
135
136
  # If the user has defined a disqus shortname but hasn't set include_comments to
136
137
  # disqus, print a warning to the console.
137
138
  def twitter_username=(username)
138
- if @twitter_username.present? and not @include_share_bar
139
+ if not @include_share_bar
139
140
  blogit_warn "You've set config.twitter_username in your blogit config file but config.include_share_bar is set to false"
140
141
  end
141
142
  @twitter_username = username
142
143
  end
143
-
144
+
144
145
  private
145
-
146
+
146
147
  def blogit_warn(message)
147
148
  warn "[Blogit]: #{message}"
148
149
  end
149
-
150
+
150
151
  end
151
152
  end
@@ -1,3 +1,3 @@
1
1
  module Blogit
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
@@ -65,14 +65,14 @@ Blogit.configure do |config|
65
65
 
66
66
  # When using redcarpet as content parser, pass these options as defaults.
67
67
  # @see here for more options: https://github.com/tanoku/redcarpet
68
- config.redcarpet_options = {
69
- hard_wrap: true,
70
- filter_html: true,
71
- autolink: true,
72
- no_intraemphasis: true,
73
- fenced_code_blocks: true,
74
- gh_blockcode: true
75
- }
68
+ # config.redcarpet_options = {
69
+ # hard_wrap: true,
70
+ # filter_html: true,
71
+ # autolink: true,
72
+ # no_intraemphasis: true,
73
+ # fenced_code_blocks: true,
74
+ # gh_blockcode: true
75
+ # }
76
76
 
77
77
  # If set to true, it will be possible to call named routes of the main app
78
78
  # directly, without the "main_app." prefix.
@@ -27,6 +27,6 @@
27
27
  <footer id="application_footer">
28
28
  By <%= link_to("Gavin Morrice", "http://gavinmorrice.com") %>
29
29
  </footer>
30
- <%= javascript_include_tag "blogit", "application" %>
30
+ <%= javascript_include_tag "application", "blogit" %>
31
31
  </body>
32
32
  </html>
@@ -5,6 +5,7 @@ require 'rails/all'
5
5
  Bundler.require
6
6
 
7
7
  require "blogit"
8
+ require "jquery-rails" # this should be auto-included with the Bundler.require :default, Rails.env, but it's not happening
8
9
 
9
10
  module Dummy
10
11
  class Application < Rails::Application
@@ -77,24 +77,24 @@ describe Blogit::PostsHelper do
77
77
  post_css = "archive-post"
78
78
 
79
79
  helper.blog_posts_archive_tag(year_css, month_css, post_css).should == ["<ul class=\"#{year_css}\">",
80
- "<li><a onclick=\"toggleBrothersDisplay(this, 'UL')\">2011</a>",
80
+ "<li><a data-blogit-click-to-toggle-children>2011</a>",
81
81
  "<ul class=\"#{month_css}\">",
82
- "<li><a onclick=\"toggleBrothersDisplay(this, 'UL')\">December</a>",
82
+ "<li><a data-blogit-click-to-toggle-children>December</a>",
83
83
  "<ul class=\"#{post_css}\">",
84
84
  "<li><a href=\"#{blogit.post_path(dec_2011)}\">#{dec_2011.title}</a></li>",
85
85
  "</ul>",
86
86
  "</li>",
87
87
  "</ul>",
88
88
  "</li>",
89
- "<li><a onclick=\"toggleBrothersDisplay(this, 'UL')\">2012</a>",
89
+ "<li><a data-blogit-click-to-toggle-children>2012</a>",
90
90
  "<ul class=\"#{month_css}\">",
91
- "<li><a onclick=\"toggleBrothersDisplay(this, 'UL')\">July</a>",
91
+ "<li><a data-blogit-click-to-toggle-children>July</a>",
92
92
  "<ul class=\"#{post_css}\">",
93
93
  "<li><a href=\"#{blogit.post_path(july_2012_1)}\">#{july_2012_1.title}</a></li>",
94
94
  "<li><a href=\"#{blogit.post_path(july_2012_2)}\">#{july_2012_2.title}</a></li>",
95
95
  "</ul>",
96
96
  "</li>",
97
- "<li><a onclick=\"toggleBrothersDisplay(this, 'UL')\">September</a>",
97
+ "<li><a data-blogit-click-to-toggle-children>September</a>",
98
98
  "<ul class=\"#{post_css}\">",
99
99
  "<li><a href=\"#{blogit.post_path(sept_2012)}\">#{sept_2012.title}</a></li>",
100
100
  "</ul>",
@@ -11,7 +11,7 @@ describe Blogit::Configuration do
11
11
  it "should set :disqus_shortname to blank" do
12
12
  blog_configuration.disqus_shortname.should == ""
13
13
  end
14
-
14
+
15
15
  it "should print a warning to the console if disqus_shortname is set but include_comments is not disqus" do
16
16
  blog_configuration.expects(:warn)
17
17
  blog_configuration.include_comments = :active_record
@@ -20,7 +20,7 @@ describe Blogit::Configuration do
20
20
 
21
21
  it "should print a warning to the console if twitter_username is set but include_share_bar is false" do
22
22
  blog_configuration.expects(:warn)
23
- blog_configuration.include_share_bar = true
23
+ blog_configuration.include_share_bar = false
24
24
  blog_configuration.twitter_username = "bodacious"
25
25
  end
26
26
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blogit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-19 00:00:00.000000000 Z
12
+ date: 2012-11-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: RedCloth
@@ -319,6 +319,7 @@ files:
319
319
  - app/views/blogit/posts/_pagination.html.erb
320
320
  - app/views/blogit/posts/_post.html.erb
321
321
  - app/views/blogit/posts/_post_body.html.erb
322
+ - app/views/blogit/posts/_post_footer.html.erb
322
323
  - app/views/blogit/posts/_post_head.html.erb
323
324
  - app/views/blogit/posts/_post_links.html.erb
324
325
  - app/views/blogit/posts/_share_bar.html.erb
@@ -452,7 +453,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
452
453
  version: '0'
453
454
  segments:
454
455
  - 0
455
- hash: 1374940806755364989
456
+ hash: -3493006387519842400
456
457
  required_rubygems_version: !ruby/object:Gem::Requirement
457
458
  none: false
458
459
  requirements:
@@ -461,7 +462,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
461
462
  version: '0'
462
463
  segments:
463
464
  - 0
464
- hash: 1374940806755364989
465
+ hash: -3493006387519842400
465
466
  requirements: []
466
467
  rubyforge_project:
467
468
  rubygems_version: 1.8.24