styledown2-rails 2.0.0.pre5 → 2.0.0.pre6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/styledown/install_generator.rb +35 -0
- data/lib/generators/styledown/sources/README.md +5 -0
- data/lib/generators/styledown/sources/_head.erb +2 -0
- data/lib/generators/styledown/sources/_head.haml +2 -0
- data/lib/generators/styledown/sources/_head.slim +2 -0
- data/lib/generators/styledown/sources/buttons.md +11 -0
- data/lib/generators/styledown/sources/controller.rb +12 -0
- data/lib/generators/styledown/sources/forms.md +10 -0
- data/lib/generators/styledown/sources/index.md +3 -0
- data/lib/styledown/rails/version.rb +1 -1
- metadata +10 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3910a659cbe6a26ddc9b6162e97d8c569cd4f23
|
4
|
+
data.tar.gz: ce725230aa8215a8e091e1609baac3bea5942b8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c81702c080b69ea7fee4985feab39fd4bbaa9f419a9bd565705278e5135e5886cff78cae84414b4500c6602cc338e2ffbfddf6f88b7025ddad3265d335c2c76
|
7
|
+
data.tar.gz: 9bcb1e8a0d4c1b160885acbcdb7b3e902b1172deca6b412dc082a0c9cb4ad6d6ab0480a3bb2c036c16f62ada126af7390174546efdd1fdaa006e7e9f4e0a4bad
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'rails/generators/base'
|
2
|
+
|
3
|
+
class Styledown
|
4
|
+
module Generators
|
5
|
+
class InstallGenerator < ::Rails::Generators::Base
|
6
|
+
desc 'Adds Styledown configuration via styledown2-rails'
|
7
|
+
source_root File.expand_path('../sources', __FILE__)
|
8
|
+
|
9
|
+
class_option :template_engine
|
10
|
+
|
11
|
+
SUPPORTED_ENGINES = [:erb, :haml, :slim]
|
12
|
+
|
13
|
+
def install
|
14
|
+
engine = options[:template_engine]
|
15
|
+
engine = :erb unless SUPPORTED_ENGINES.include?(engine)
|
16
|
+
|
17
|
+
# Controllers
|
18
|
+
template 'controller.rb', 'app/controllers/styleguides_controller.rb'
|
19
|
+
|
20
|
+
# Routes
|
21
|
+
route "resource 'styleguides', only: [:show] do\n" +
|
22
|
+
" get '*page', action: :show, as: :page\n" +
|
23
|
+
' end'
|
24
|
+
|
25
|
+
# Views
|
26
|
+
template "_head.#{engine}", "app/views/styleguides/_head.#{engine}"
|
27
|
+
|
28
|
+
# Styleguides
|
29
|
+
template 'index.md', 'docs/styleguides/index.md'
|
30
|
+
template 'buttons.md', 'docs/styleguides/buttons.md'
|
31
|
+
template 'README.md', 'docs/styleguides/README.md'
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class StyleguidesController < ApplicationController
|
2
|
+
include Styledown::Rails::Controller
|
3
|
+
|
4
|
+
# Where your styleguides are stored
|
5
|
+
styledown.root = 'docs/styleguides'
|
6
|
+
|
7
|
+
# Partial to be added before </head>
|
8
|
+
styledown.append_template :head, 'styleguides/head'
|
9
|
+
|
10
|
+
# Languages in examples to be using Rails template engines
|
11
|
+
styledown.use_template_engine :<%= options[:template_engine] %>
|
12
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: styledown2-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.pre6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rico Sta. Cruz
|
@@ -79,6 +79,15 @@ files:
|
|
79
79
|
- Rakefile
|
80
80
|
- docs/api.md
|
81
81
|
- docs/manual_install.md
|
82
|
+
- lib/generators/styledown/install_generator.rb
|
83
|
+
- lib/generators/styledown/sources/README.md
|
84
|
+
- lib/generators/styledown/sources/_head.erb
|
85
|
+
- lib/generators/styledown/sources/_head.haml
|
86
|
+
- lib/generators/styledown/sources/_head.slim
|
87
|
+
- lib/generators/styledown/sources/buttons.md
|
88
|
+
- lib/generators/styledown/sources/controller.rb
|
89
|
+
- lib/generators/styledown/sources/forms.md
|
90
|
+
- lib/generators/styledown/sources/index.md
|
82
91
|
- lib/styledown/rails.rb
|
83
92
|
- lib/styledown/rails/controller.rb
|
84
93
|
- lib/styledown/rails/controller_integration.rb
|