diff --git a/bin/jekyll b/bin/jekyll index 0eea75e0..6d3767e6 100755 --- a/bin/jekyll +++ b/bin/jekyll @@ -48,7 +48,7 @@ command :build do |c| c.option '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file' c.option '--future', 'Publishes posts with a future date' - c.option '--limit_posts MAX_POSTS', 'Limits the number of posts to parse and publish' + c.option '--limit_posts MAX_POSTS', Integer, 'Limits the number of posts to parse and publish' c.option '-w', '--watch', 'Watch for changes and rebuild' c.option '--lsi', 'Use LSI for improved related posts' c.option '--drafts', 'Render posts in the _drafts folder' @@ -66,7 +66,7 @@ command :serve do |c| c.option '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file' c.option '--future', 'Publishes posts with a future date' - c.option '--limit_posts MAX_POSTS', 'Limits the number of posts to parse and publish' + c.option '--limit_posts MAX_POSTS', Integer, 'Limits the number of posts to parse and publish' c.option '-w', '--watch', 'Watch for changes and rebuild' c.option '--lsi', 'Use LSI for improved related posts' c.option '--drafts', 'Render posts in the _drafts folder' diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 107b0951..227f5312 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -27,8 +27,7 @@ module Jekyll self.include = config['include'] self.future = config['future'] self.show_drafts = config['show_drafts'] - # given as String if it is came from CLI option - self.limit_posts = config['limit_posts'].to_i + self.limit_posts = config['limit_posts'] self.keep_files = config['keep_files'] self.reset diff --git a/test/test_generated_site.rb b/test/test_generated_site.rb index 4d12867f..09532226 100644 --- a/test/test_generated_site.rb +++ b/test/test_generated_site.rb @@ -68,15 +68,5 @@ class TestGeneratedSite < Test::Unit::TestCase @site = Site.new(Jekyll.configuration) end end - - should "ensure if limit_posts is a String (from CLI option)" do - clear_dest - stub(Jekyll).configuration do - Jekyll::Configuration::DEFAULTS.merge({'limit_posts' => "3"}) - end - @site = Site.new(Jekyll.configuration) - - assert_equal 3, @site.limit_posts - end end end