simb 0.0.4 → 0.0.5
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/README.md +7 -2
- data/bin/simb +15 -0
- data/lib/simb.rb +26 -0
- data/lib/simb/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: bcb44bd24d63550f716f694544d91f706e77570f
|
4
|
+
data.tar.gz: 5911d4ec1d36872413de8b033ce140ff11a5616f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bc07f09f2dcbc1d9f2d3e30c32982a8090d6f77c16a006655a3649f686973554bb060188b7ef4a1d6ef340aa4ffa0f0e5c4afd4d2b65a830b1faa054a973846
|
7
|
+
data.tar.gz: fbe7f10f0f90282daef4d7aee252bb68b8597c2829157bb8cf478d0fe87a34ab1dc8df239a241d49f451e8b56bc9ad60e6612537889ef27fddbacaa8c287eb77
|
data/README.md
CHANGED
@@ -14,6 +14,10 @@ Make a post:
|
|
14
14
|
|
15
15
|
simb new-post sweet-post my-awesome-blog
|
16
16
|
|
17
|
+
Configure it:
|
18
|
+
|
19
|
+
simb config my-awesome-blog
|
20
|
+
|
17
21
|
Publish it:
|
18
22
|
|
19
23
|
simb publish my-awesome-blog
|
@@ -26,6 +30,7 @@ That's pretty much it.
|
|
26
30
|
- [ ] Theme manager
|
27
31
|
- [ ] Add posts from any location (`simb add-post path/to/some/other/postdir`)
|
28
32
|
- [ ] Cleanup
|
29
|
-
- [
|
30
|
-
- [ ]
|
33
|
+
- [x] Remove second password request block
|
34
|
+
- [ ] Setup SSH if not already configured...
|
35
|
+
- [x] Organize code ('cause it's bleh)
|
31
36
|
```
|
data/bin/simb
CHANGED
@@ -13,11 +13,26 @@ class SimbCLI < Thor
|
|
13
13
|
Simb.new_post(post_name, blog)
|
14
14
|
end
|
15
15
|
|
16
|
+
desc "list-posts BLOG", "list the posts for a blog"
|
17
|
+
def list_posts(blog)
|
18
|
+
puts Simb.list_posts(blog).map{|a|a[0]}.join("\n")
|
19
|
+
end
|
20
|
+
|
21
|
+
desc "list-blogs", "list blogs"
|
22
|
+
def list_blogs
|
23
|
+
puts Simb.list_blogs
|
24
|
+
end
|
25
|
+
|
16
26
|
desc "config BLOG", "edit _config.yml for BLOG"
|
17
27
|
def config(blog)
|
18
28
|
Simb.edit_config(blog)
|
19
29
|
end
|
20
30
|
|
31
|
+
desc "post-file FILENAME BLOG", "copy a markdown file to simb directory"
|
32
|
+
def post_file(file, blog)
|
33
|
+
Simb.add_file(file, blog)
|
34
|
+
end
|
35
|
+
|
21
36
|
desc "publish BLOG", "publish BLOG to github pages"
|
22
37
|
def publish(blog)
|
23
38
|
if Simb.blog_initted? (blog)
|
data/lib/simb.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "simb/version"
|
2
2
|
require "github_api"
|
3
|
+
require "fileutils"
|
3
4
|
|
4
5
|
module Simb
|
5
6
|
ROOTDIR="#{ENV['HOME']}/.simb/"
|
@@ -43,6 +44,27 @@ module Simb
|
|
43
44
|
editor file
|
44
45
|
end
|
45
46
|
|
47
|
+
def self.list_posts(blog)
|
48
|
+
Dir.chdir("#{ROOTDIR}#{blog}/_posts") do
|
49
|
+
Dir.glob("*").map do |a|
|
50
|
+
if a.split('-').size < 4
|
51
|
+
[a.gsub('.markdown', ''), a]
|
52
|
+
else
|
53
|
+
f = "[#{a.split('-')[0..2].join('-')}]"
|
54
|
+
f += " #{a.split('-')[3..-1].join(' ').gsub('.markdown', '')}"
|
55
|
+
[f, a]
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.list_blogs
|
62
|
+
Dir.chdir("#{ROOTDIR}") do
|
63
|
+
Dir.glob("*/").map{|a|a[0..-2]}.join("\n")
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
|
46
68
|
def self.edit_config(blog)
|
47
69
|
Dir.chdir("#{ROOTDIR}#{blog}") do
|
48
70
|
editor "_config.yml"
|
@@ -86,4 +108,8 @@ module Simb
|
|
86
108
|
commit(blog) # go back and publish now
|
87
109
|
end
|
88
110
|
end
|
111
|
+
|
112
|
+
def self.add_file(file, blog)
|
113
|
+
FileUtils.copy(file, "#{ROOTDIR}/#{blog}/_posts/#{post_filename file.gsub(/\..*/, '')}")
|
114
|
+
end
|
89
115
|
end
|
data/lib/simb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- charles-l
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|