styleguide_rails 0.2.0 → 0.2.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/README.md CHANGED
@@ -42,8 +42,12 @@ is an example widget already created:
42
42
  <img src="illustration/screenshot.png" alt="Screenshot" />
43
43
  </p>
44
44
 
45
- To add a new widget, create a partial in `app/views/styleguide/widgets`
46
- and it will appear in the style guide. These partials support templating
45
+ To add a new widget, run
46
+
47
+ $ rails generate styleguide:widget NAME
48
+
49
+ which will create a partial in `app/views/styleguide/widgets` and it
50
+ will appear in the style guide. These partials support templating
47
51
  languages like Haml if you have the gems installed.
48
52
 
49
53
  ## Credits
@@ -8,6 +8,7 @@
8
8
  font-family: Helvetica, sans-serif;
9
9
  font-size: 18px;
10
10
  line-height: 24px;
11
+ z-index: 1;
11
12
  position: fixed;
12
13
  top: 0;
13
14
  left: 0;
@@ -55,7 +56,6 @@
55
56
  padding: 0;
56
57
  position: absolute;
57
58
  top: 100%;
58
- z-index: 100;
59
59
  }
60
60
  #styleguide_rails > nav > ul ul > li {
61
61
  float: none;
@@ -86,7 +86,7 @@
86
86
  font-size: 120%;
87
87
  text-align: center;
88
88
  color: white;
89
- background: #000;
89
+ background: #666;
90
90
  }
91
91
  #styleguide_rails > dl > dd {
92
92
  margin: 0;
@@ -94,12 +94,16 @@
94
94
  #styleguide_rails > dl > dd.preview {
95
95
  margin: 0 auto;
96
96
  border: 1px solid white;
97
+ position: relative;
97
98
  }
98
99
  #styleguide_rails > dl > dd.preview:hover {
99
100
  border-bottom: 1px dashed #CCC;
100
101
  border-left: 1px dashed #CCC;
101
102
  border-right: 1px dashed #CCC;
102
103
  border-top: 1px dashed #FFF;
104
+ background-color: #FFF;
105
+ background-image: linear-gradient(90deg, transparent 50%, rgba(240,240,240,.5) 50%);
106
+ background-size: 20px 20px;
103
107
  }
104
108
  #styleguide_rails > dl > dd > div.location {
105
109
  font-style: italic;
@@ -0,0 +1 @@
1
+ <p>Your new widget</p>
@@ -0,0 +1,17 @@
1
+ require 'active_support/inflector'
2
+
3
+ module Styleguide
4
+ module Generators
5
+ class WidgetGenerator < Rails::Generators::Base
6
+ source_root File.expand_path('../templates', __FILE__)
7
+ argument :name
8
+
9
+ desc "Creates a widget in your styleguide"
10
+
11
+ def create_widget
12
+ destination_name = name.gsub(/-/, '_').parameterize(sep = '_')
13
+ copy_file 'widget.html.erb', "app/views/styleguide/widgets/_#{destination_name}.html.erb"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module StyleguideRails
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  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.2.0
4
+ version: 0.2.1
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-04-26 00:00:00.000000000 Z
13
+ date: 2013-05-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -42,16 +42,17 @@ files:
42
42
  - Rakefile
43
43
  - illustration/logo.png
44
44
  - illustration/screenshot.png
45
- - lib/generators/styleguide/USAGE
46
- - lib/generators/styleguide/install_generator.rb
47
- - lib/generators/styleguide/templates/_example_elements.html
48
- - lib/generators/styleguide/templates/_widget.html.erb
49
- - lib/generators/styleguide/templates/_widget_link.html.erb
50
- - lib/generators/styleguide/templates/index.html.erb
51
- - lib/generators/styleguide/templates/styleguide.css
52
- - lib/generators/styleguide/templates/styleguide.html.erb
53
- - lib/generators/styleguide/templates/styleguide.js
54
- - lib/generators/styleguide/templates/styleguide_controller.rb
45
+ - lib/generators/styleguide/install/install_generator.rb
46
+ - lib/generators/styleguide/install/templates/_example_elements.html
47
+ - lib/generators/styleguide/install/templates/_widget.html.erb
48
+ - lib/generators/styleguide/install/templates/_widget_link.html.erb
49
+ - lib/generators/styleguide/install/templates/index.html.erb
50
+ - lib/generators/styleguide/install/templates/styleguide.css
51
+ - lib/generators/styleguide/install/templates/styleguide.html.erb
52
+ - lib/generators/styleguide/install/templates/styleguide.js
53
+ - lib/generators/styleguide/install/templates/styleguide_controller.rb
54
+ - lib/generators/styleguide/widget/templates/widget.html.erb
55
+ - lib/generators/styleguide/widget/widget_generator.rb
55
56
  - lib/styleguide_rails.rb
56
57
  - lib/styleguide_rails/version.rb
57
58
  - styleguide_rails.gemspec
@@ -69,7 +70,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
69
70
  version: '0'
70
71
  segments:
71
72
  - 0
72
- hash: 1160601883018097668
73
+ hash: -3479684397812207252
73
74
  required_rubygems_version: !ruby/object:Gem::Requirement
74
75
  none: false
75
76
  requirements:
@@ -78,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
79
  version: '0'
79
80
  segments:
80
81
  - 0
81
- hash: 1160601883018097668
82
+ hash: -3479684397812207252
82
83
  requirements: []
83
84
  rubyforge_project:
84
85
  rubygems_version: 1.8.25
@@ -1,11 +0,0 @@
1
- Description:
2
- Add a /styleguide route to your app to preview CSS styles
3
-
4
- Example:
5
- rails generate styleguide:install
6
-
7
- This will create:
8
- app/controllers/styleguide_controller.rb
9
- app/views/styleguide/
10
- app/views/styleguide/widgets/
11
- appropriate routes