jekyllpress 1.2.1 → 1.3.0

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
  SHA256:
3
- metadata.gz: c48ef53412dcbfca1a0040de96622f760e6b235d7616e1b0a4fe8e0e202ed525
4
- data.tar.gz: 6e1c9070e00b22451e5573bc31b3f1aef894c0664d1cc9f88a384892f8f95e72
3
+ metadata.gz: 017be71cf20b07221b069939edcd6b57f3c87ff342d2b02968ad216bde0b0dde
4
+ data.tar.gz: cb1911c10b77f8c7e59605e276822c4f15990b3dc8972db8cee1d7d89cb195f0
5
5
  SHA512:
6
- metadata.gz: 89f716f1a89d7f77e8e4b055ea133f6864e060c0fe59d06fc7bb4f7952830943c346a258044f83ab103cf98b9a808eef154099d17829e1cd41bf61189ce9d846
7
- data.tar.gz: bd5b195da714f0cd3cb86dbde84efb9245b83b4e3e7da01d84bf5ed9835fef7b772f4dcd49bbd90063930d8c6819d79163d685eefcd35981d986b3eff85b7680
6
+ metadata.gz: 7cd53e1d7dfdb47fe284b95a7d705037c44f53c1f30c8dacda7229bb0fb304e8b35c21710d627fe9ec406890eb0857c96bd0ed3bd8e3e065a91d3dafde6552b3
7
+ data.tar.gz: 6a75413dd79b946b52057bdf088b5ea6c5b14e2fd965c52731493d1ce9ba4fd4bf65075a894dcd6725dae0d3baeb792e75230b45948353942edaea4f76a21cd0
data/bin/jp ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'jekyllpress'
4
+ Jekyllpress::App.start(ARGV)
@@ -31,7 +31,7 @@ module Jekyllpress
31
31
  '---
32
32
  layout: <%= @layout %>
33
33
  title: "<%= @title %>"
34
- date: <%= @date %> <%= @time %>
34
+ date: <%= @date %>T<%= @time %>
35
35
  categories: <%= Array(@categories) %>
36
36
  tags: <%= Array(@tags) %>
37
37
  source: "<%= @url %>"
@@ -78,6 +78,37 @@ module Jekyllpress
78
78
  end
79
79
  end
80
80
 
81
+ desc "np TITLE", "Create a new posts with title TITLE"
82
+ method_option :categories, :desc => "list of categories to assign this post", :type => :array, :aliases => %w[-c]
83
+ method_option :tags, :desc => "list of tags to assign this post", :type => :array, :aliases => %w[-t]
84
+ method_option :layout, :desc => "specify an alternate layout for the post", :type => :string, :aliases => %w[-l], :default => "post"
85
+ method_option :url, :desc => "source URL for blog post", :type => :string
86
+ method_option :template, :desc => "specify an alternate template to use for the post", :type => :string
87
+ method_option :date, :desc => "provide an alternate date for the post", :type => :string, :default => Date.today.iso8601
88
+ method_option :time, :desc => "provide an alternate time of day for the post", :type => :string, :default => Time.now.strftime("%H:%M")
89
+ method_option :location, :desc => "Location for page to appear in directory", :type => :string, :aliases => %w[-L --loc], :default => nil
90
+ def np(title="")
91
+ check_templates
92
+ @title = title.to_s
93
+ @title = ask("Title for your post: ") if @title.empty?
94
+
95
+ @date = options.fetch("date", Date.today.iso8601)
96
+ @time = options.fetch("time", Time.now.strftime("%H:%M"))
97
+ @categories = options.fetch("categories", [])
98
+ @tags = options.fetch("tags", [])
99
+ @layout = options[:layout]
100
+ @url = options[:url]
101
+ @template = options.fetch("template") { new_post_template }
102
+ @location = options.fetch("location", posts_dir) || posts_dir
103
+
104
+ with_config do |config|
105
+ check_templates
106
+ @filename = destination(source, @location, post_filename(@title, @date))
107
+ template(File.join(template_dir, @template), @filename)
108
+ [__method__, @title, @date, @time, @filename, @categories, @tags, @layout, @url, @template, @location]
109
+ end
110
+ end
111
+
81
112
  desc "new_page TITLE", "Create a new page with title TITLE"
82
113
  method_option :location, :desc => "Location for page to appear in directory", :type => :string, :aliases => %w[-l --loc]
83
114
  method_option :layout, :desc => "specify an alternate layout for the page", :type => :string, :default => "page"
@@ -1,3 +1,3 @@
1
1
  module Jekyllpress
2
- VERSION = "1.2.1"
2
+ VERSION = "1.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyllpress
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tamara Temple
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-10 00:00:00.000000000 Z
11
+ date: 2019-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -183,6 +183,7 @@ email:
183
183
  - tamouse@gmail.com
184
184
  executables:
185
185
  - jekyllpress
186
+ - jp
186
187
  extensions: []
187
188
  extra_rdoc_files: []
188
189
  files:
@@ -196,6 +197,7 @@ files:
196
197
  - README.md
197
198
  - Rakefile
198
199
  - bin/jekyllpress
200
+ - bin/jp
199
201
  - jekyllpress.gemspec
200
202
  - lib/jekyllpress.rb
201
203
  - lib/jekyllpress/version.rb