writefully 0.6.5 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/wf-write +6 -3
- data/lib/writefully/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 737d13e72af27150bbb8aaca6af04bb12ce0000b
|
4
|
+
data.tar.gz: 65b2a9313cd468fd5843b6d1f2255b3dcde3a6c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
data/lib/writefully/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2014-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|