mint 0.5.1 → 0.7.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.
- data/Gemfile +18 -0
- data/README.md +3 -3
- data/bin/mint +27 -27
- data/bin/mint-epub +6 -6
- data/config/syntax.yaml +12 -12
- data/{templates → config/templates}/base/style.sass +11 -4
- data/config/templates/default/css/style.css +158 -0
- data/config/templates/default/layout.haml +8 -0
- data/{templates → config/templates}/default/style.sass +0 -0
- data/{templates/default → config/templates/protocol}/layout.haml +0 -0
- data/config/templates/protocol/style.sass +20 -0
- data/config/templates/reset.css +92 -0
- data/config/templates/zen/css/style.css +145 -0
- data/{templates/pro → config/templates/zen}/layout.haml +0 -0
- data/config/templates/zen/style.sass +24 -0
- data/features/config.feature +21 -0
- data/features/publish.feature +3 -3
- data/features/support/env.rb +9 -27
- data/features/templates.feature +79 -0
- data/lib/mint.rb +11 -11
- data/lib/mint/{commandline.rb → command_line.rb} +96 -80
- data/lib/mint/css.rb +43 -34
- data/lib/mint/document.rb +99 -93
- data/lib/mint/helpers.rb +21 -17
- data/lib/mint/layout.rb +1 -1
- data/lib/mint/mint.rb +92 -36
- data/lib/mint/plugin.rb +5 -5
- data/lib/mint/plugins/epub.rb +51 -51
- data/lib/mint/resource.rb +2 -2
- data/lib/mint/style.rb +2 -2
- data/lib/mint/version.rb +1 -1
- data/spec/command_line_spec.rb +87 -0
- data/spec/css_spec.rb +46 -0
- data/spec/document_spec.rb +38 -40
- data/spec/helpers_spec.rb +101 -83
- data/spec/layout_spec.rb +1 -1
- data/spec/mint_spec.rb +184 -60
- data/spec/plugin_spec.rb +61 -67
- data/spec/plugins/epub_spec.rb +47 -47
- data/spec/resource_spec.rb +9 -9
- data/spec/spec_helper.rb +20 -93
- data/spec/style_spec.rb +6 -8
- data/spec/support/fixtures/content.md +16 -0
- data/spec/support/fixtures/dynamic.sass +3 -0
- data/spec/support/fixtures/layout.haml +3 -0
- data/spec/support/fixtures/static.css +3 -0
- data/spec/support/matchers.rb +15 -0
- metadata +160 -70
- data/spec/commandline_spec.rb +0 -91
- data/templates/pro/style.sass +0 -0
data/spec/commandline_spec.rb
DELETED
@@ -1,91 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Mint
|
4
|
-
describe CommandLine do
|
5
|
-
describe "#options" do
|
6
|
-
it "provides default options" do
|
7
|
-
CommandLine.options['template']['long'].should == 'template'
|
8
|
-
CommandLine.options['layout']['long'].should == 'layout'
|
9
|
-
CommandLine.options['style']['long'].should == 'style'
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "#parser" do
|
14
|
-
it "provides a default option parser" do
|
15
|
-
fake_argv = ['--layout', 'pro']
|
16
|
-
|
17
|
-
options = {}
|
18
|
-
CommandLine.parser {|k, p| options[k] = p }.parse!(fake_argv)
|
19
|
-
options[:layout].should == 'pro'
|
20
|
-
end
|
21
|
-
|
22
|
-
it "provides an option parser based on a formatted hash" do
|
23
|
-
fake_argv = ['--novel', 'novel']
|
24
|
-
formatted_options = {
|
25
|
-
# Option keys must be formatted as strings, so we
|
26
|
-
# use hash-bang syntax
|
27
|
-
novel: {
|
28
|
-
'short' => 'n',
|
29
|
-
'long' => 'novel',
|
30
|
-
'parameter' => true,
|
31
|
-
'description' => ''
|
32
|
-
}
|
33
|
-
}
|
34
|
-
|
35
|
-
options = {}
|
36
|
-
|
37
|
-
CommandLine.parser(formatted_options) do |k, p|
|
38
|
-
options[k] = p
|
39
|
-
end.parse!(fake_argv)
|
40
|
-
|
41
|
-
options[:novel].should == 'novel'
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
describe "#configuration" do
|
46
|
-
context "when no config syntax file is loaded" do
|
47
|
-
it "returns nil" do
|
48
|
-
CommandLine.configuration(nil).should be_nil
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
context "when a config syntax file is loaded but there is no .config file" do
|
53
|
-
it "returns a default set of options" do
|
54
|
-
expected_map = {
|
55
|
-
layout: 'default',
|
56
|
-
style: 'default',
|
57
|
-
destination: nil,
|
58
|
-
style_destination: nil
|
59
|
-
}
|
60
|
-
|
61
|
-
CommandLine.configuration.should == expected_map
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
context "when a config syntax file is loaded and there is a .config file" do
|
66
|
-
before do
|
67
|
-
FileUtils.mkdir_p '.mint/config'
|
68
|
-
File.open('.mint/config/config.yaml', 'w') do |file|
|
69
|
-
file << 'layout: pro'
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
after do
|
74
|
-
File.delete '.mint/config/config.yaml'
|
75
|
-
end
|
76
|
-
|
77
|
-
it "merges all specified options with precedence according to scope" do
|
78
|
-
CommandLine.configuration[:layout].should == 'pro'
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
it "displays the sum of all configuration files with other options added"
|
84
|
-
it "prints a help message"
|
85
|
-
it "installs a template file to the correct scope"
|
86
|
-
it "pulls up a named template file in the user's editor"
|
87
|
-
it "writes options to the correct file for the scope specified"
|
88
|
-
it "sets and stores a scoped configuration variable"
|
89
|
-
it "publishes a set of files"
|
90
|
-
end
|
91
|
-
end
|
data/templates/pro/style.sass
DELETED
File without changes
|