styleguide_rails 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -26,10 +26,13 @@ the markup and teach good habits.
|
|
26
26
|
|
27
27
|
## Usage
|
28
28
|
|
29
|
-
Add this gem to your Rails Gemfile
|
30
|
-
styleguide generator
|
29
|
+
Add this gem to your Rails Gemfile:
|
31
30
|
|
32
|
-
|
31
|
+
gem 'styleguide_rails'
|
32
|
+
|
33
|
+
Run `bundle`, and execute the styleguide generator:
|
34
|
+
|
35
|
+
$ rails generate styleguide:install
|
33
36
|
|
34
37
|
That's it, you're done, you have a styleguide available at
|
35
38
|
`http://yourapp.com/styleguide`. If you visit that path you'll see there
|
@@ -2,9 +2,10 @@ Description:
|
|
2
2
|
Add a /styleguide route to your app to preview CSS styles
|
3
3
|
|
4
4
|
Example:
|
5
|
-
rails generate styleguide
|
5
|
+
rails generate styleguide:install
|
6
6
|
|
7
7
|
This will create:
|
8
8
|
app/controllers/styleguide_controller.rb
|
9
9
|
app/views/styleguide/
|
10
|
+
app/views/styleguide/widgets/
|
10
11
|
appropriate routes
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Styleguide
|
2
|
+
module Generators
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
4
|
+
source_root File.expand_path('../templates', __FILE__)
|
5
|
+
|
6
|
+
desc "Adds a styleguide to your app"
|
7
|
+
|
8
|
+
def create_controller
|
9
|
+
copy_file 'styleguide_controller.rb', 'app/controllers/styleguide_controller.rb'
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_route
|
13
|
+
route "match 'styleguide' => 'styleguide#index' if Rails.env.development?"
|
14
|
+
end
|
15
|
+
|
16
|
+
def create_views
|
17
|
+
copy_file 'styleguide.html.erb', 'app/views/layouts/styleguide.html.erb'
|
18
|
+
|
19
|
+
empty_directory 'app/views/styleguide/widgets'
|
20
|
+
empty_directory 'app/assets/stylesheets/widgets'
|
21
|
+
copy_file 'index.html.erb', 'app/views/styleguide/index.html.erb'
|
22
|
+
copy_file '_widget.html.erb', 'app/views/styleguide/_widget.html.erb'
|
23
|
+
copy_file '_widget_link.html.erb', 'app/views/styleguide/_widget_link.html.erb'
|
24
|
+
end
|
25
|
+
|
26
|
+
def add_private_assets
|
27
|
+
empty_directory 'public/stylesheets'
|
28
|
+
copy_file 'styleguide.css', 'public/stylesheets/styleguide.css'
|
29
|
+
empty_directory 'public/javascripts'
|
30
|
+
copy_file 'styleguide.js', 'public/javascripts/styleguide.js'
|
31
|
+
end
|
32
|
+
|
33
|
+
def supply_basic_guide
|
34
|
+
copy_file '_example_elements.html', 'app/views/styleguide/widgets/_example_elements.html'
|
35
|
+
end
|
36
|
+
|
37
|
+
def show_readme
|
38
|
+
readme('../USAGE')
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: styleguide_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-01-
|
13
|
+
date: 2013-01-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -43,7 +43,7 @@ files:
|
|
43
43
|
- illustration/logo.png
|
44
44
|
- illustration/screenshot.png
|
45
45
|
- lib/generators/styleguide/USAGE
|
46
|
-
- lib/generators/styleguide/
|
46
|
+
- lib/generators/styleguide/install_generator.rb
|
47
47
|
- lib/generators/styleguide/templates/_example_elements.html
|
48
48
|
- lib/generators/styleguide/templates/_widget.html.erb
|
49
49
|
- lib/generators/styleguide/templates/_widget_link.html.erb
|
@@ -67,12 +67,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
67
67
|
- - ! '>='
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
|
+
segments:
|
71
|
+
- 0
|
72
|
+
hash: -2412295386765068664
|
70
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
74
|
none: false
|
72
75
|
requirements:
|
73
76
|
- - ! '>='
|
74
77
|
- !ruby/object:Gem::Version
|
75
78
|
version: '0'
|
79
|
+
segments:
|
80
|
+
- 0
|
81
|
+
hash: -2412295386765068664
|
76
82
|
requirements: []
|
77
83
|
rubyforge_project:
|
78
84
|
rubygems_version: 1.8.24
|
@@ -1,32 +0,0 @@
|
|
1
|
-
class StyleguideGenerator < Rails::Generators::Base
|
2
|
-
source_root File.expand_path('../templates', __FILE__)
|
3
|
-
|
4
|
-
def create_controller
|
5
|
-
copy_file 'styleguide_controller.rb', 'app/controllers/styleguide_controller.rb'
|
6
|
-
end
|
7
|
-
|
8
|
-
def create_route
|
9
|
-
route "match 'styleguide' => 'styleguide#index' if Rails.env.development?"
|
10
|
-
end
|
11
|
-
|
12
|
-
def create_views
|
13
|
-
copy_file 'styleguide.html.erb', 'app/views/layouts/styleguide.html.erb'
|
14
|
-
|
15
|
-
empty_directory 'app/views/styleguide/widgets'
|
16
|
-
empty_directory 'app/assets/stylesheets/widgets'
|
17
|
-
copy_file 'index.html.erb', 'app/views/styleguide/index.html.erb'
|
18
|
-
copy_file '_widget.html.erb', 'app/views/styleguide/_widget.html.erb'
|
19
|
-
copy_file '_widget_link.html.erb', 'app/views/styleguide/_widget_link.html.erb'
|
20
|
-
end
|
21
|
-
|
22
|
-
def add_private_assets
|
23
|
-
empty_directory 'public/stylesheets'
|
24
|
-
copy_file 'styleguide.css', 'public/stylesheets/styleguide.css'
|
25
|
-
empty_directory 'public/javascripts'
|
26
|
-
copy_file 'styleguide.js', 'public/javascripts/styleguide.js'
|
27
|
-
end
|
28
|
-
|
29
|
-
def supply_basic_guide
|
30
|
-
copy_file '_example_elements.html', 'app/views/styleguide/widgets/_example_elements.html'
|
31
|
-
end
|
32
|
-
end
|