frenchpress 0.2 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 733b1dd11e9a3d619d074e3a4852ed1ddb97aec6
4
- data.tar.gz: fe3db9f717e99d5d0bbbfeb985988257da2f9227
3
+ metadata.gz: 85ee50fd5483a6776b5f16198f97bdbffb3b5db5
4
+ data.tar.gz: dc2d9f1b7b17076fea9129f26a2988551a7bcffa
5
5
  SHA512:
6
- metadata.gz: 1b3821caa532752576333993b9ca64e17c25241081f3034496aa40d5c7a30e63476b31e13cb91d955c114f6eabfc4268f2b4d63a85c9c9b3e9d4053a8112c1a6
7
- data.tar.gz: 2b5c6720160bf48a4f658a4e30028d46fc80fbb3fabfcefb4f09e8c4bef2ac0fb99cfef1089ef70faf61332ce75b9c3cf05829a5348582e50b7a7d5a7246beda
6
+ metadata.gz: 874bf7ebe42052710272efa76c8f63cc51a5fdfb9caef5031cced27d7ffe314b08bc8695fc396a059730850ea92bee4ec34e27e5f3d72cd3a8611c8496a32189
7
+ data.tar.gz: f24a2725b656a81854148114afd098ea1c450ed2c7850f3c48d2a05dfde7ac2be4f58d840348f5fa12507d0625f5fde13b4afd7afd6688571a09c6a2d3f32896
@@ -1 +1 @@
1
- 0.2
1
+ 0.2.1
@@ -6,7 +6,7 @@
6
6
  <link href='https://fonts.googleapis.com/css?family=Poiret+One|Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
7
7
  </head>
8
8
  <body>
9
- <h1><a href="/">{{ site.title }}Title</a></h1>
9
+ <h1><a href="/">{{ site.title }}</a></h1>
10
10
  <div id="posts">
11
11
  {% for post in site.posts %}
12
12
  <div class="post">
@@ -15,7 +15,7 @@
15
15
  {% endif %}
16
16
  <p class="post-date"><a href="{{ post.url }}">{{ post.date | date: "%b %d %y" }}</a></p>
17
17
  <div class="post-content">{{ post.content }}</div>
18
- <p class="post-reply">To reply: "frenchpress reply {{ site.url }}/{{ post.url }}"</p>
18
+ <p class="post-reply">To reply: "frenchpress reply {{ site.url }}{{ post.url }}"</p>
19
19
  </div>
20
20
  {% endfor %}
21
21
  </div>
@@ -16,9 +16,10 @@ class FrenchPress
16
16
  @dir = dir
17
17
  end
18
18
 
19
- def new_blog
19
+ def new_blog(args)
20
20
  dir = File.expand_path File.join(File.dirname(__FILE__), '..', '..')
21
21
  copy_install_files dir
22
+ write_config(args) if args
22
23
  end
23
24
 
24
25
  def copy_install_files(dir, update = false)
@@ -68,13 +69,17 @@ class FrenchPress
68
69
  end
69
70
 
70
71
  def update
71
- Dir.chdir(@dir) do
72
- FileUtils.rm_rf '_layouts'
73
- FileUtils.rm_rf 'css'
74
- FileUtils.rm_rf 'index.html'
75
- end
72
+ Dir.chdir(@dir) { FileUtils.rm_r ['_layouts', 'css', 'index.html'] }
76
73
  dir = File.expand_path File.join(File.dirname(__FILE__), '..', '..')
77
74
  copy_install_files dir, true
78
75
  end
76
+
77
+ def write_config(args)
78
+ Dir.chdir(@dir) do
79
+ File.open('_config.yml', 'a+') do |f|
80
+ f.write args.to_yaml
81
+ end
82
+ end
83
+ end
79
84
  end
80
85
  end
@@ -6,8 +6,13 @@ class FrenchPress
6
6
  class_option :dir
7
7
 
8
8
  desc 'init', 'Initialize a new frenchpress blog.'
9
+ option :url
10
+ option :title
9
11
  def init
10
- FrenchPress.open(options[:dir]).new_blog
12
+ FrenchPress.open(options[:dir]).new_blog(
13
+ url: options[:url],
14
+ title: options[:title]
15
+ )
11
16
  end
12
17
 
13
18
  desc 'post', 'Create a new post from given file or URL.'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frenchpress
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Fahringer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-03 00:00:00.000000000 Z
11
+ date: 2015-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor