middleman-blog-drafts 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5411e1cced547a8c93ce28423232d05a205fe8dc
4
+ data.tar.gz: 896813a71b38c3ebc709555aea36ff34598c09a3
5
+ SHA512:
6
+ metadata.gz: 0d85dd8d6e96b5d55216c2be0400bf441edc4c8c033bccefdea145bac4eda233159629e54fd22759efbe9fa12ef97205800f59c45812059d4cf016c3b76427c8
7
+ data.tar.gz: 90bdcdcafcf524652955ec0f9ae9e8b027271e6edc0350b17f746fda1033a2130e87c912e052add0130e41c4b10c10bb6a77cb739abc3d21b4e7ecc3277bd966
data/.gitignore CHANGED
@@ -1,4 +1,3 @@
1
1
  # Ignore bundler lock file
2
- Gemfile.lock
3
2
  /tmp
4
3
  /pkg
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ bundler_args: --without development
3
+ rvm:
4
+ - 2.0.0
5
+ - 1.9.3
data/Gemfile CHANGED
@@ -1,16 +1,18 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in middleman-blog-drafts.gemspec
4
4
  gemspec
5
5
 
6
6
  group :development do
7
- gem "rake", "~> 0.9.2"
8
7
  gem "rdoc", "~> 3.9"
9
8
  gem "yard", "~> 0.8.0"
10
9
  gem "guard-cucumber"
11
10
  end
12
11
 
13
- group :test do
12
+ group :development, :test do
13
+ gem "sass"
14
+ gem "compass"
15
+ gem "rake", "~> 0.9.2"
14
16
  gem "cucumber", "~> 1.2.0"
15
17
  gem "fivemat"
16
18
  gem "aruba", "~> 0.4.11"
data/Gemfile.lock ADDED
@@ -0,0 +1,118 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ middleman-blog-drafts (0.1.0)
5
+ middleman-blog
6
+ middleman-core (>= 3.1.4)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ activesupport (3.2.14)
12
+ i18n (~> 0.6, >= 0.6.4)
13
+ multi_json (~> 1.0)
14
+ aruba (0.4.11)
15
+ childprocess (>= 0.2.3)
16
+ cucumber (>= 1.1.1)
17
+ ffi (>= 1.0.11)
18
+ rspec (>= 2.7.0)
19
+ builder (3.2.2)
20
+ childprocess (0.3.9)
21
+ ffi (~> 1.0, >= 1.0.11)
22
+ chunky_png (1.2.8)
23
+ coderay (1.0.9)
24
+ compass (0.12.2)
25
+ chunky_png (~> 1.2)
26
+ fssm (>= 0.2.7)
27
+ sass (~> 3.1)
28
+ cucumber (1.2.5)
29
+ builder (>= 2.1.2)
30
+ diff-lcs (>= 1.1.3)
31
+ gherkin (~> 2.11.7)
32
+ multi_json (~> 1.3)
33
+ diff-lcs (1.2.4)
34
+ ffi (1.9.0)
35
+ fivemat (1.2.1)
36
+ formatador (0.2.4)
37
+ fssm (0.2.10)
38
+ gherkin (2.11.8)
39
+ multi_json (~> 1.3)
40
+ guard (1.8.2)
41
+ formatador (>= 0.2.4)
42
+ listen (>= 1.0.0)
43
+ lumberjack (>= 1.0.2)
44
+ pry (>= 0.9.10)
45
+ thor (>= 0.14.6)
46
+ guard-cucumber (1.4.0)
47
+ cucumber (>= 1.2.0)
48
+ guard (>= 1.1.0)
49
+ i18n (0.6.5)
50
+ json (1.8.0)
51
+ listen (1.2.3)
52
+ rb-fsevent (>= 0.9.3)
53
+ rb-inotify (>= 0.9)
54
+ rb-kqueue (>= 0.2)
55
+ lumberjack (1.0.4)
56
+ maruku (0.6.1)
57
+ syntax (>= 1.0.0)
58
+ method_source (0.8.2)
59
+ middleman-blog (3.2.0)
60
+ maruku (~> 0.6.0)
61
+ middleman-core (~> 3.0)
62
+ tzinfo (~> 0.3.0)
63
+ middleman-core (3.1.4)
64
+ activesupport (~> 3.2.6)
65
+ bundler (~> 1.1)
66
+ i18n (~> 0.6.1)
67
+ listen (~> 1.2.2)
68
+ rack (>= 1.4.5)
69
+ rack-test (~> 0.6.1)
70
+ thor (>= 0.15.2, < 2.0)
71
+ tilt (~> 1.3.6)
72
+ multi_json (1.7.9)
73
+ pry (0.9.12.2)
74
+ coderay (~> 1.0.5)
75
+ method_source (~> 0.8)
76
+ slop (~> 3.4)
77
+ rack (1.5.2)
78
+ rack-test (0.6.2)
79
+ rack (>= 1.0)
80
+ rake (0.9.6)
81
+ rb-fsevent (0.9.3)
82
+ rb-inotify (0.9.1)
83
+ ffi (>= 0.5.0)
84
+ rb-kqueue (0.2.0)
85
+ ffi (>= 0.5.0)
86
+ rdoc (3.12.2)
87
+ json (~> 1.4)
88
+ rspec (2.14.1)
89
+ rspec-core (~> 2.14.0)
90
+ rspec-expectations (~> 2.14.0)
91
+ rspec-mocks (~> 2.14.0)
92
+ rspec-core (2.14.5)
93
+ rspec-expectations (2.14.2)
94
+ diff-lcs (>= 1.1.3, < 2.0)
95
+ rspec-mocks (2.14.3)
96
+ sass (3.2.9)
97
+ slop (3.4.6)
98
+ syntax (1.0.0)
99
+ thor (0.18.1)
100
+ tilt (1.3.7)
101
+ tzinfo (0.3.37)
102
+ yard (0.8.7)
103
+
104
+ PLATFORMS
105
+ ruby
106
+
107
+ DEPENDENCIES
108
+ aruba (~> 0.4.11)
109
+ compass
110
+ cucumber (~> 1.2.0)
111
+ fivemat
112
+ guard-cucumber
113
+ middleman-blog-drafts!
114
+ rake (~> 0.9.2)
115
+ rdoc (~> 3.9)
116
+ rspec (~> 2.7)
117
+ sass
118
+ yard (~> 0.8.0)
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Fabio Rehm
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # middleman-blog-drafts
2
2
 
3
+ [![Build Status](https://travis-ci.org/fgrehm/middleman-blog-drafts.png?branch=master)](https://travis-ci.org/fgrehm/middleman-blog-drafts)
4
+
3
5
  middleman-blog-drafts is an addon for [middleman-blog](https://github.com/middleman/middleman-blog)
4
6
  that simplifies draft posts creation and publishing.
5
7
 
@@ -33,9 +35,9 @@ middleman publish source/drafts/my-awesome-new-blog-post.markdown
33
35
  ## Listing drafts on a page
34
36
 
35
37
  ```erb
36
- <% unless settings.build? %>
38
+ <% if settings[:environment] == :development %>
37
39
  <ul>
38
- <%= drafts.each do |draft| %>
40
+ <% drafts.each do |draft| %>
39
41
  <li><%= link_to draft.title, draft.path %></li>
40
42
  <% end %>
41
43
  </ul>
@@ -2,7 +2,7 @@
2
2
  title: "Drafts List"
3
3
  ---
4
4
 
5
- <% unless settings.build? %>
5
+ <% if settings[:environment] == :development %>
6
6
  <ul>
7
7
  <% drafts.each do |draft| %>
8
8
  <li><%= draft.title %></li>
@@ -11,7 +11,7 @@ module Middleman
11
11
  # A draft BlogArticle for the given path, or nil if one doesn't exist.
12
12
  # @return [Middleman::Sitemap::Resource]
13
13
  def draft(path)
14
- article = drafts.options.app.sitemap.find_resource_by_path(path.to_s)
14
+ article = @app.sitemap.find_resource_by_path(path.to_s)
15
15
  if article && article.is_a?(BlogArticle)
16
16
  article
17
17
  else
@@ -62,7 +62,7 @@ module Middleman
62
62
  resource.extend BlogArticle
63
63
  resource.extend DraftArticle
64
64
 
65
- next unless @app.environment == :development
65
+ next unless @app.environment == :development || @options.build
66
66
 
67
67
  # compute output path:
68
68
  resource.destination_path = options.permalink.
@@ -43,7 +43,7 @@ module Middleman
43
43
  sub(':title', @slug)
44
44
  article_path = File.join(shared_instance.source_dir, article_path + extension)
45
45
 
46
- data, content = shared_instance.frontmatter_manager.data(draft_path)
46
+ data, content = shared_instance.extensions[:frontmatter].data(draft_path)
47
47
  data = data.dup.tap { |d| d[:date] = Date.parse @date.strftime('%F') }
48
48
 
49
49
  create_file article_path, "#{YAML::dump(data).sub(/^--- !ruby.*$/, '---')}---\n#{content}"
@@ -2,7 +2,7 @@ module Middleman
2
2
  module Blog
3
3
  module Drafts
4
4
  class Options
5
- attr_accessor :sources, :layout, :permalink
5
+ attr_accessor :sources, :layout, :permalink, :build
6
6
 
7
7
  def initialize(options={})
8
8
  options.each do |k,v|
@@ -1,7 +1,7 @@
1
1
  module Middleman
2
2
  module Blog
3
3
  module Drafts
4
- VERSION = "0.0.2"
4
+ VERSION = "0.1.0"
5
5
  end
6
6
  end
7
7
  end
@@ -16,6 +16,6 @@ Gem::Specification.new do |s|
16
16
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
17
17
  s.require_paths = ["lib"]
18
18
 
19
- s.add_runtime_dependency("middleman-core", [">= 3.0.9"])
19
+ s.add_runtime_dependency("middleman-core", [">= 3.1.4"])
20
20
  s.add_runtime_dependency("middleman-blog")
21
21
  end
metadata CHANGED
@@ -1,48 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-blog-drafts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Fabio Rehm
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-01-19 00:00:00.000000000 Z
11
+ date: 2013-08-30 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- prerelease: false
16
14
  name: middleman-core
17
- version_requirements: !ruby/object:Gem::Requirement
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: 3.0.9
22
- none: false
23
15
  requirement: !ruby/object:Gem::Requirement
24
16
  requirements:
25
- - - ! '>='
17
+ - - '>='
26
18
  - !ruby/object:Gem::Version
27
- version: 3.0.9
28
- none: false
19
+ version: 3.1.4
29
20
  type: :runtime
30
- - !ruby/object:Gem::Dependency
31
21
  prerelease: false
32
- name: middleman-blog
33
22
  version_requirements: !ruby/object:Gem::Requirement
34
23
  requirements:
35
- - - ! '>='
24
+ - - '>='
36
25
  - !ruby/object:Gem::Version
37
- version: '0'
38
- none: false
26
+ version: 3.1.4
27
+ - !ruby/object:Gem::Dependency
28
+ name: middleman-blog
39
29
  requirement: !ruby/object:Gem::Requirement
40
30
  requirements:
41
- - - ! '>='
31
+ - - '>='
42
32
  - !ruby/object:Gem::Version
43
33
  version: '0'
44
- none: false
45
34
  type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
46
41
  description: middleman-blog extension for working with draft articles
47
42
  email:
48
43
  - fgrehm@gmail.com
@@ -51,8 +46,11 @@ extensions: []
51
46
  extra_rdoc_files: []
52
47
  files:
53
48
  - .gitignore
49
+ - .travis.yml
54
50
  - Gemfile
51
+ - Gemfile.lock
55
52
  - Guardfile
53
+ - LICENSE.txt
56
54
  - README.md
57
55
  - Rakefile
58
56
  - features/build.feature
@@ -79,33 +77,26 @@ files:
79
77
  - middleman-blog-drafts.gemspec
80
78
  homepage: https://github.com/fgrehm/middleman-draft-articles
81
79
  licenses: []
80
+ metadata: {}
82
81
  post_install_message:
83
82
  rdoc_options: []
84
83
  require_paths:
85
84
  - lib
86
85
  required_ruby_version: !ruby/object:Gem::Requirement
87
86
  requirements:
88
- - - ! '>='
87
+ - - '>='
89
88
  - !ruby/object:Gem::Version
90
89
  version: '0'
91
- segments:
92
- - 0
93
- hash: 1502395184488581113
94
- none: false
95
90
  required_rubygems_version: !ruby/object:Gem::Requirement
96
91
  requirements:
97
- - - ! '>='
92
+ - - '>='
98
93
  - !ruby/object:Gem::Version
99
94
  version: '0'
100
- segments:
101
- - 0
102
- hash: 1502395184488581113
103
- none: false
104
95
  requirements: []
105
96
  rubyforge_project:
106
- rubygems_version: 1.8.23
97
+ rubygems_version: 2.0.0
107
98
  signing_key:
108
- specification_version: 3
99
+ specification_version: 4
109
100
  summary: middleman-blog extension for working with draft articles
110
101
  test_files:
111
102
  - features/build.feature