writefully 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51fdadd52037940dfd3708e1a4b96d350912b217
4
- data.tar.gz: 85c08dfe89c56fcfd51cc995287fa80c8f7f7fb0
3
+ metadata.gz: 737d13e72af27150bbb8aaca6af04bb12ce0000b
4
+ data.tar.gz: 65b2a9313cd468fd5843b6d1f2255b3dcde3a6c4
5
5
  SHA512:
6
- metadata.gz: b7e7f753a04169d267e6c0b5fac58b7be258e5aecbd7755182373898b42ada8cda8d2a39416dbd79e02dd7b6847c860a1f05709a82cc9773e57807a695ac771c
7
- data.tar.gz: aaf59e00f24051a0bd89ea2103a6dc820f4fde4cb819d6e176c0e67bdb2485f4729f373303073d33bb236110065f8f8492bb15f6eb53b35bd247acf34797c805
6
+ metadata.gz: c8a724395f9fc2557482be433c23429905132ffc06f2f12057a67d972acd842b45a15c82d51fdc879455e5d685418109f85b4a2e23e04dba240ec3330038140a
7
+ data.tar.gz: cdc89c162aaec26f0eaa0a78a49460e64d6ed7bcb552c7d7152f015f687846ef63cec6eb166e65b878ec75b6db48d40493662504788ea9da79d6746f6471df52
data/bin/wf-write CHANGED
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'thor'
4
- require 'active_support/inflector'
5
4
 
6
5
  module Writefully
7
6
  class Write < Thor
@@ -14,7 +13,7 @@ module Writefully
14
13
  no_tasks do
15
14
  def create_content_with type, slug
16
15
  new_position = get_last_post(type).split(/\//).last.match(/\A\d*/).to_s.to_i + 1
17
- dir_name = File.join(type.pluralize, [new_position, slug].join('-'))
16
+ dir_name = File.join(content_type(type), [new_position, slug].join('-'))
18
17
  Dir.mkdir dir_name
19
18
  add_assets dir_name
20
19
  add_readme_md dir_name
@@ -39,8 +38,12 @@ module Writefully
39
38
  file.close
40
39
  end
41
40
 
41
+ def content_type type
42
+ Dir.glob("*").select { |dir| dir.match(::Regexp.new(type)) }.first
43
+ end
44
+
42
45
  def get_last_post type
43
- Dir.glob("#{type.pluralize}/*").sort_by do |item|
46
+ Dir.glob("#{content_type(type)}/*").sort_by do |item|
44
47
  item.split(/\//).last.match(/\A\d*/).to_s.to_i
45
48
  end.last
46
49
  end
@@ -1,3 +1,3 @@
1
1
  module Writefully
2
- VERSION = "0.6.5"
2
+ VERSION = "0.6.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: writefully
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zack Siri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-21 00:00:00.000000000 Z
11
+ date: 2014-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails