middleman-blog_page 0.0.2 → 0.0.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d06177ba498fa506b0b1bd24cb1f9b7ee22ecc6
|
4
|
+
data.tar.gz: 095728fe7246d0775111e6528c41200af09ce5ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63dda3380f7ac1da43341320c548790ff6d0da096b4b77b8b52d67f18e294965e86315d3b47c19c11fe543ab742b9ab92a72a5cf6b90a3bc96e358fdc74a0d36
|
7
|
+
data.tar.gz: 94469ecb5136b08800f58c92a0ba25b82bc4562927e664b7f173eadf159a19d9bd52dfae9c11d92f43f45fdef0d97b883fa9ae0ae4adf86a1c4ea40a5059b904
|
data/lib/middleman-blog_page.rb
CHANGED
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'middleman-core/cli'
|
2
|
+
require 'date'
|
3
|
+
|
4
|
+
module Middleman
|
5
|
+
module Cli
|
6
|
+
# This class provides an "article" command for the middleman CLI.
|
7
|
+
class BlogPage < Thor
|
8
|
+
include Thor::Actions
|
9
|
+
|
10
|
+
check_unknown_options!
|
11
|
+
|
12
|
+
namespace :blog_page
|
13
|
+
|
14
|
+
# Template files are relative to this file
|
15
|
+
# @return [String]
|
16
|
+
def self.source_root
|
17
|
+
File.dirname(__FILE__)
|
18
|
+
end
|
19
|
+
|
20
|
+
# Tell Thor to exit with a nonzero exit code on failure
|
21
|
+
def self.exit_on_failure?
|
22
|
+
true
|
23
|
+
end
|
24
|
+
|
25
|
+
desc "blog_page TITLE", "Create a new blog page"
|
26
|
+
def blog_page(title)
|
27
|
+
shared_instance = ::Middleman::Application.server.inst
|
28
|
+
|
29
|
+
# This only exists when the config.rb sets it!
|
30
|
+
if shared_instance.respond_to? :blog_pages
|
31
|
+
@title = title
|
32
|
+
@slug = title.parameterize
|
33
|
+
|
34
|
+
article_path = shared_instance.blog_page.options.sources.
|
35
|
+
sub(':title', @slug)
|
36
|
+
|
37
|
+
template "blog_page.tt", File.join(shared_instance.source_dir, article_path + shared_instance.blog.options.default_extension)
|
38
|
+
else
|
39
|
+
raise Thor::Error.new "You need to activate the blog_page extension in config.rb before you can create an article"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
data/middleman-blog_page.gemspec
CHANGED
@@ -13,7 +13,6 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.description = %q{Blog page engine for Middleman}
|
14
14
|
s.license = "MIT"
|
15
15
|
s.files = `git ls-files -z`.split("\0")
|
16
|
-
s.test_files = `git ls-files -z -- {fixtures,features}/*`.split("\0")
|
17
16
|
s.require_paths = ["lib"]
|
18
17
|
s.add_dependency("middleman-core", ["~> 3.2"])
|
19
18
|
s.add_dependency("tzinfo", ["~> 0.3.0"])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-blog_page
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jasl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman-core
|
@@ -49,10 +49,11 @@ files:
|
|
49
49
|
- Gemfile
|
50
50
|
- LICENSE.md
|
51
51
|
- README.md
|
52
|
-
- Rakefile
|
53
52
|
- lib/middleman-blog_page.rb
|
54
53
|
- lib/middleman-blog_page/blog_page_article.rb
|
55
54
|
- lib/middleman-blog_page/blog_page_data.rb
|
55
|
+
- lib/middleman-blog_page/commands/blog_page.rb
|
56
|
+
- lib/middleman-blog_page/commands/blog_page.tt
|
56
57
|
- lib/middleman-blog_page/extension_3_0.rb
|
57
58
|
- lib/middleman-blog_page/extension_3_1.rb
|
58
59
|
- lib/middleman-blog_page/version.rb
|
data/Rakefile
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'bundler'
|
2
|
-
Bundler::GemHelper.install_tasks
|
3
|
-
|
4
|
-
require 'cucumber/rake/task'
|
5
|
-
|
6
|
-
require 'middleman-core'
|
7
|
-
|
8
|
-
Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
|
9
|
-
ENV["TEST"] = "true"
|
10
|
-
|
11
|
-
exempt_tags = ""
|
12
|
-
exempt_tags << "--tags ~@nojava " if RUBY_PLATFORM == "java"
|
13
|
-
exempt_tags << "--tags ~@three_one " unless ::Middleman::VERSION.match(/^3\.1\./)
|
14
|
-
|
15
|
-
t.cucumber_opts = "--color --tags ~@wip #{exempt_tags} --strict --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}"
|
16
|
-
end
|
17
|
-
|
18
|
-
require 'rake/clean'
|
19
|
-
|
20
|
-
task :test => ["cucumber"]
|
21
|
-
|
22
|
-
begin
|
23
|
-
require 'cane/rake_task'
|
24
|
-
|
25
|
-
desc "Run cane to check quality metrics"
|
26
|
-
Cane::RakeTask.new(:quality) do |cane|
|
27
|
-
cane.no_style = true
|
28
|
-
cane.no_doc = true
|
29
|
-
cane.abc_glob = "lib/middleman-blog_page/**/*.rb"
|
30
|
-
end
|
31
|
-
rescue LoadError
|
32
|
-
# warn "cane not available, quality task not provided."
|
33
|
-
end
|
34
|
-
|
35
|
-
desc "Build HTML documentation"
|
36
|
-
task :doc do
|
37
|
-
sh 'bundle exec yard'
|
38
|
-
end
|