install_theme 0.5.0 → 0.5.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/History.txt +8 -0
- data/README.rdoc +19 -3
- data/lib/install_theme.rb +1 -1
- data/lib/install_theme/cli.rb +9 -4
- data/spec/install_theme_cli_spec.rb +2 -2
- metadata +2 -2
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -22,12 +22,28 @@ Simple case:
|
|
22
22
|
Replace some DOM content with <%= yield :some_label %> with --inside_yields:
|
23
23
|
|
24
24
|
install_theme path/to/app path/to/rails_app content_box \
|
25
|
-
|
26
|
-
|
25
|
+
--inside_yield "header:#header h2" \
|
26
|
+
--inside_yield sidebar:#sidebar"
|
27
|
+
|
28
|
+
=== Haml Support:
|
29
|
+
|
30
|
+
If your application has Haml installed, the template/theme is automatically converted
|
31
|
+
to Haml, and the css files converted to Sass.
|
32
|
+
|
33
|
+
Alternately, you can pass the flag --haml to force it.
|
34
|
+
|
35
|
+
Or pass the flag --erb to force erb template generation.
|
27
36
|
|
28
37
|
== INSTALL:
|
29
38
|
|
30
|
-
|
39
|
+
install_theme is distributed as a RubyGem, which installs the command line app automatically:
|
40
|
+
|
41
|
+
sudo gem install install_theme
|
42
|
+
install_theme -h
|
43
|
+
|
44
|
+
== AUTHOR:
|
45
|
+
|
46
|
+
Dr Nic Williams (http://drnicwilliams.com) wrote install_theme because he wanted a very
|
31
47
|
|
32
48
|
== LICENSE:
|
33
49
|
|
data/lib/install_theme.rb
CHANGED
data/lib/install_theme/cli.rb
CHANGED
@@ -16,16 +16,21 @@ class InstallTheme
|
|
16
16
|
Options are:
|
17
17
|
BANNER
|
18
18
|
opts.separator ""
|
19
|
+
opts.on("--erb",
|
20
|
+
"Generate ERb templates.",
|
21
|
+
"Default: auto-detect") { |arg| options[:template_type] = 'erb' }
|
19
22
|
opts.on("--haml",
|
20
|
-
"Generate HAML templates."
|
21
|
-
|
23
|
+
"Generate HAML templates.",
|
24
|
+
"Default: auto-detect") { |arg| options[:template_type] = 'haml' }
|
25
|
+
opts.on("--index_path index.html", String,
|
22
26
|
"HTML page to use for application layout.",
|
23
27
|
"Default: index.html") { |arg| options[:index_path] = arg }
|
24
|
-
opts.on("--inside_yield
|
28
|
+
opts.on("--inside_yield KEY_AND_CSS_PATH", String,
|
25
29
|
"Replace the inner HTML of an element with <%= yield :key %>",
|
30
|
+
"Example: --inside_yield header:#header",
|
26
31
|
"Default: nil") do |arg|
|
27
32
|
options[:inside_yields] ||= {}
|
28
|
-
key, css_path = arg.split(/\s
|
33
|
+
key, css_path = arg.split(/\s*:\s*/)[0..1]
|
29
34
|
options[:inside_yields][key.strip.to_sym] = css_path.strip
|
30
35
|
end
|
31
36
|
opts.on("-h", "--help",
|
@@ -18,8 +18,8 @@ describe InstallTheme::CLI, "execute" do
|
|
18
18
|
InstallTheme::CLI.execute(stdout_io, %w[path/to/app path/to/rails_app content_box
|
19
19
|
--index_path=root.html
|
20
20
|
--haml
|
21
|
-
--inside_yield
|
22
|
-
--inside_yield
|
21
|
+
--inside_yield header:#header\ h2
|
22
|
+
--inside_yield sidebar:#sidebar
|
23
23
|
])
|
24
24
|
end
|
25
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: install_theme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dr Nic Williams
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-09-
|
12
|
+
date: 2009-09-28 00:00:00 +10:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|