middleman-vcard 0.9.4 → 0.9.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/ChangeLog.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/Rakefile +3 -0
- data/lib/middleman-vcard/extension.rb +7 -0
- data/lib/middleman-vcard/generator.rb +17 -0
- data/lib/middleman-vcard/version.rb +15 -1
- data/lib/middleman-vcard.rb +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 016ad9675883061008940aaa133aabf3f67daf3e
|
4
|
+
data.tar.gz: 1e468b390d3f02a810360eee0f50b54ca829902e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cbdb63e07c186b29f6a3df992401b0247d10632584e75fd5b3cb91e5111cdf65ffd8ad562343cfa3a4bbaeeec89da8aba65027699ab45449b47d1d239d31d26
|
7
|
+
data.tar.gz: f6dc531c0cc9dd29280616dcc18bed5e41ce60c78d5b9cbec7ad79a0f30211fb1d15e2787ffd86085027aa970f93787a5f0d084dc2235f0eeeb487b0adda7cee
|
data/ChangeLog.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -7,8 +7,8 @@
|
|
7
7
|
|
8
8
|
## Project informations
|
9
9
|
|
10
|
-
* [Homepage](https://rubygems.org/gems/middleman-vcard)
|
11
10
|
* [Documentation](http://rubydoc.info/gems/middleman-vcard/frames)
|
11
|
+
* [RubyGems Homepage](https://rubygems.org/gems/middleman-vcard)
|
12
12
|
* [Email](mailto:molari.alessandro@gmail.com)
|
13
13
|
|
14
14
|
## Description
|
data/Rakefile
CHANGED
@@ -15,8 +15,10 @@ require "yard"
|
|
15
15
|
require "middleman-vcard"
|
16
16
|
|
17
17
|
|
18
|
+
# Include RSpec tasks.
|
18
19
|
RSpec::Core::RakeTask.new
|
19
20
|
|
21
|
+
# Include YARD tasks.
|
20
22
|
YARD::Rake::YardocTask.new
|
21
23
|
|
22
24
|
desc "Open a console preloaded with middleman-vcard."
|
@@ -24,4 +26,5 @@ task :console do
|
|
24
26
|
sh "pry --gem", verbose: false
|
25
27
|
end
|
26
28
|
|
29
|
+
# The default task.
|
27
30
|
task default: [:spec]
|
@@ -17,6 +17,9 @@ module Middleman
|
|
17
17
|
|
18
18
|
option :dst_path, nil, "The destination path for the generated VCard"
|
19
19
|
|
20
|
+
##
|
21
|
+
# Create the VCardExtension.
|
22
|
+
#
|
20
23
|
def initialize(app, options_hash={}, &block)
|
21
24
|
super
|
22
25
|
|
@@ -54,6 +57,10 @@ module Middleman
|
|
54
57
|
app.config.define_setting :vcard_dir_path, @vcard_dir_path.to_s
|
55
58
|
end
|
56
59
|
|
60
|
+
##
|
61
|
+
# After Middleman has been configured (i.e. build, console, server, etc..)
|
62
|
+
# generate the VCard.
|
63
|
+
#
|
57
64
|
def after_configuration
|
58
65
|
@vcard_generator.generate(@vcard_dir_path.join(@vcard_file_name))
|
59
66
|
end
|
@@ -116,15 +116,32 @@ module Middleman
|
|
116
116
|
|
117
117
|
protected
|
118
118
|
|
119
|
+
##
|
120
|
+
# Log the provided error message and raise an error.
|
121
|
+
#
|
122
|
+
# @param msg [String] The error message.
|
123
|
+
#
|
119
124
|
def error(msg)
|
120
125
|
@logger.error(format_msg(msg))
|
121
126
|
fail("Middleman VCard generator failed")
|
122
127
|
end
|
123
128
|
|
129
|
+
##
|
130
|
+
# Log the provided informative message.
|
131
|
+
#
|
132
|
+
# @param msg [String] The informative message.
|
133
|
+
#
|
124
134
|
def info(msg)
|
125
135
|
@logger.info(format_msg(msg))
|
126
136
|
end
|
127
137
|
|
138
|
+
##
|
139
|
+
# Format the provided message.
|
140
|
+
#
|
141
|
+
# @param msg [String] The message to be formatted.
|
142
|
+
#
|
143
|
+
# @return The formatted message.
|
144
|
+
#
|
128
145
|
def format_msg(msg)
|
129
146
|
"[VCard] #{msg}"
|
130
147
|
end
|
@@ -1,10 +1,24 @@
|
|
1
1
|
module Middleman
|
2
2
|
module VCard
|
3
3
|
|
4
|
+
##
|
5
|
+
# The current major version.
|
6
|
+
#
|
4
7
|
VERSION_MAJOR = 0
|
8
|
+
|
9
|
+
##
|
10
|
+
# The current minor version.
|
11
|
+
#
|
5
12
|
VERSION_MINOR = 9
|
6
|
-
VERSION_PATCH = 4
|
7
13
|
|
14
|
+
##
|
15
|
+
# The current patch version.
|
16
|
+
#
|
17
|
+
VERSION_PATCH = 5
|
18
|
+
|
19
|
+
##
|
20
|
+
# The version string, following the semvers conventions.
|
21
|
+
#
|
8
22
|
VERSION = "#{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_PATCH}"
|
9
23
|
|
10
24
|
end
|
data/lib/middleman-vcard.rb
CHANGED
@@ -20,6 +20,8 @@ require "middleman-core"
|
|
20
20
|
require "middleman-vcard/version"
|
21
21
|
require "middleman-vcard/generator"
|
22
22
|
|
23
|
+
# Register the extension with name: `:vcard` and lazily require the related
|
24
|
+
# module (the module containing the Middleman extension).
|
23
25
|
Middleman::Extensions.register(:vcard) do
|
24
26
|
require "middleman-vcard/extension"
|
25
27
|
Middleman::VCard::VCardExtension
|