Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added stringex gem for permalink url generation

  • Loading branch information...
commit 5ec1f014a0d828fe3d555600b527d7201fbf4d97 1 parent 178a198
Pavel Pravosud rwz authored

Showing 3 changed files with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. +1 0  Gemfile
  2. +2 0  Gemfile.lock
  3. +2 1  Rakefile
1  Gemfile
@@ -10,3 +10,4 @@ gem 'haml', '>= 3.1'
10 10 gem 'compass', '>= 0.11'
11 11 gem 'rubypants'
12 12 gem 'rb-fsevent'
  13 +gem 'stringex'
2  Gemfile.lock
@@ -40,6 +40,7 @@ GEM
40 40 blankslate (>= 2.1.2.3)
41 41 ffi (~> 1.0.7)
42 42 sass (3.1.5)
  43 + stringex (1.3.0)
43 44 syntax (1.0.0)
44 45
45 46 PLATFORMS
@@ -56,3 +57,4 @@ DEPENDENCIES
56 57 rb-fsevent
57 58 rdiscount
58 59 rubypants
  60 + stringex
3  Rakefile
... ... @@ -1,5 +1,6 @@
1 1 require "rubygems"
2 2 require "bundler/setup"
  3 +require "stringex"
3 4
4 5 ## -- Rsync Deploy config -- ##
5 6 # Be sure your public key is listed in your server's ~/.ssh/authorized_keys file
@@ -63,7 +64,7 @@ task :new_post, :title do |t, args|
63 64 require './plugins/titlecase.rb'
64 65 args.with_defaults(:title => 'new-post')
65 66 title = args.title
66   - filename = "#{source_dir}/#{posts_dir}/#{Time.now.strftime('%Y-%m-%d')}-#{title.downcase.gsub(/&/,'and').gsub(/[,'":\?!\(\)\[\]]/,'').gsub(/[\W\.]/, '-').gsub(/-+$/,'')}.#{new_post_ext}"
  67 + filename = "#{source_dir}/#{posts_dir}/#{Time.now.strftime('%Y-%m-%d')}-#{title.to_url}.#{new_post_ext}"
67 68 puts "Creating new post: #{filename}"
68 69 open(filename, 'w') do |post|
69 70 system "mkdir -p #{source_dir}/#{posts_dir}";

0 comments on commit 5ec1f01

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