hashrocket-rails 0.0.2 → 0.0.3
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/LICENSE +2 -2
- data/README.md +82 -3
- data/app/assets/stylesheets/mixins.sass +76 -0
- data/lib/generators/hashrocket/generators.rb +5 -0
- data/lib/generators/hashrocket/install/install_generator.rb +1 -10
- data/lib/generators/hashrocket/layout/USAGE +14 -0
- data/lib/generators/hashrocket/layout/layout_generator.rb +21 -0
- data/lib/generators/hashrocket/layout/templates/application.css.sass +6 -0
- data/lib/generators/hashrocket/{install → layout}/templates/application.html.haml +0 -0
- data/lib/generators/hashrocket/ui/ui_generator.rb +2 -1
- data/lib/hashrocket-rails/version.rb +1 -1
- metadata +10 -7
- data/lib/generators/hashrocket/install/USAGE +0 -11
data/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2011 Hashrocket
|
1
|
+
Copyright (c) 2011 Hashrocket
|
2
2
|
|
3
3
|
MIT License
|
4
4
|
|
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
19
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
20
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
21
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
|
-
# Hashrocket
|
1
|
+
# Hashrocket on Rails
|
2
2
|
|
3
|
-
|
3
|
+
Automate setting up a new project with defaults used at Hashrocket.
|
4
|
+
|
5
|
+
This gem provides the following:
|
6
|
+
|
7
|
+
* Loose dependencies on gems we always use
|
8
|
+
* Common assets accessible via the asset pipeline
|
9
|
+
* A generator that sets up a base layout & sass structure
|
10
|
+
* An engine & generator that exposes UI comps
|
4
11
|
|
5
12
|
## Installation
|
6
13
|
|
@@ -18,10 +25,82 @@ Or install it yourself as:
|
|
18
25
|
|
19
26
|
## Usage
|
20
27
|
|
21
|
-
|
28
|
+
### Gem Dependencies
|
29
|
+
|
30
|
+
There are a few gems we use on every project. These have been added to the
|
31
|
+
gemspec without a version specified. It should be safe to exclude them from the
|
32
|
+
project Gemfile. If you need to lock a specific version of the gem, just add it
|
33
|
+
back to the project Gemfile.
|
34
|
+
|
35
|
+
Included gems are:
|
36
|
+
|
37
|
+
* haml-rails
|
38
|
+
* decent_exposure
|
39
|
+
|
40
|
+
### Generators
|
41
|
+
|
42
|
+
Run all included generators:
|
43
|
+
|
44
|
+
$ rails g hashrocket:install
|
45
|
+
|
46
|
+
This runs a meta generator which invokes the following:
|
47
|
+
|
48
|
+
$ rails g hashrocket:layout
|
49
|
+
$ rails g hashrocket:ui
|
50
|
+
|
51
|
+
### Layout
|
52
|
+
|
53
|
+
The generator adds a barebones haml layout and sets up the stylesheet structure for the app.
|
54
|
+
|
55
|
+
Layout includes:
|
56
|
+
|
57
|
+
* html5shiv
|
58
|
+
* flash rendering
|
59
|
+
* a yield for head content
|
60
|
+
|
61
|
+
Stylesheet structure:
|
62
|
+
|
63
|
+
* whitespace-reset is included
|
64
|
+
* requires all stylesheets in /vendor
|
65
|
+
* requires all stylesheets in /global
|
66
|
+
* does not automatically include root stylesheets
|
67
|
+
* imports mixins
|
68
|
+
|
69
|
+
All assets required are included with the engine. You can work in the
|
70
|
+
application stylesheet out of the box.
|
71
|
+
|
72
|
+
### UI Boilerplate
|
73
|
+
|
74
|
+
At Hashrocket we expose a `/ui` route where our front-end team implements
|
75
|
+
design before it is integrated to the main app. This code is included as an
|
76
|
+
engine. There is a generator which will hook your app into the engine.
|
77
|
+
|
78
|
+
$ rails g hashrocket:ui
|
79
|
+
|
80
|
+
This will add a route and controller `app/controllers/ui_controller.rb` which
|
81
|
+
subclasses the engine controller. This avoids the need to namespace UI files
|
82
|
+
and provides an extension point for customization.
|
83
|
+
|
84
|
+
You can now add UI comps to `app/views/ui` and they will appear at `/ui` in
|
85
|
+
your app.
|
86
|
+
|
87
|
+
You can explicitly exclude files from being shown in the UI index by adding the
|
88
|
+
following to `ui_controller.rb`.
|
89
|
+
|
90
|
+
class UiController < Hashrocket::UiController
|
91
|
+
exclude 'filename', 'other_filename', ->(w) { w.ends_with?('_old') }
|
92
|
+
end
|
93
|
+
|
94
|
+
By default the `index` view & any partials are excluded.
|
22
95
|
|
23
96
|
## Contributing
|
24
97
|
|
98
|
+
The intention of this gem is to be included & used on every Hashrocket project.
|
99
|
+
As such new features need to be something we might need on every project. Pull
|
100
|
+
requests adding features specific to your workflow will likely be declined.
|
101
|
+
|
102
|
+
However, if you think we are missing something feel free to make a case for it!
|
103
|
+
|
25
104
|
1. Fork it
|
26
105
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
106
|
3. Commit your changes (`git commit -am 'Added some feature'`)
|
@@ -0,0 +1,76 @@
|
|
1
|
+
= border-radius($radius)
|
2
|
+
-moz-border-radius: $radius
|
3
|
+
border-radius: $radius
|
4
|
+
|
5
|
+
= border-top-right-radius($radius)
|
6
|
+
-moz-border-radius-topright: $radius
|
7
|
+
border-top-right-radius: $radius
|
8
|
+
|
9
|
+
= border-top-left-radius($radius)
|
10
|
+
-moz-border-radius-topleft: $radius
|
11
|
+
border-top-left-radius: $radius
|
12
|
+
|
13
|
+
= border-bottom-right-radius($radius)
|
14
|
+
-moz-border-radius-bottomright: $radius
|
15
|
+
border-bottom-right-radius: $radius
|
16
|
+
|
17
|
+
= border-bottom-left-radius($radius)
|
18
|
+
-moz-border-radius-bottomleft: $radius
|
19
|
+
border-bottom-left-radius: $radius
|
20
|
+
|
21
|
+
= box-shadow($arguments)
|
22
|
+
-webkit-box-shadow: $arguments
|
23
|
+
-moz-box-shadow: $arguments
|
24
|
+
box-shadow: $arguments
|
25
|
+
|
26
|
+
= opacity($val)
|
27
|
+
opacity: $val
|
28
|
+
filter: alpha(opacity=$val*100)
|
29
|
+
|
30
|
+
= gradient-bg($color1, $color2)
|
31
|
+
background-color: $color1
|
32
|
+
background-image: -moz-linear-gradient(100% 100% 90deg, $color2, $color1)
|
33
|
+
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($color1), to($color2))
|
34
|
+
|
35
|
+
= image-replace($img, $type:png)
|
36
|
+
display: block
|
37
|
+
font-size: 1px
|
38
|
+
text-indent: -8685px
|
39
|
+
overflow: hidden
|
40
|
+
background: url(/assets/#{$img}.#{$type}) no-repeat
|
41
|
+
|
42
|
+
= underline-hover
|
43
|
+
text-decoration: none
|
44
|
+
&:hover
|
45
|
+
text-decoration: underline
|
46
|
+
|
47
|
+
= wrapper
|
48
|
+
position: relative
|
49
|
+
min-width: 900px
|
50
|
+
max-width: 1200px
|
51
|
+
padding: 0 30px
|
52
|
+
margin-left: auto
|
53
|
+
margin-right: auto
|
54
|
+
|
55
|
+
= button-skeleton($from, $to)
|
56
|
+
display: block
|
57
|
+
font-weight: bold
|
58
|
+
text-decoration: none
|
59
|
+
cursor: pointer
|
60
|
+
color: #fff
|
61
|
+
+gradient-bg($from, $to)
|
62
|
+
border: none
|
63
|
+
border: 1px solid $to + #202020
|
64
|
+
border-top: 1px solid $to + #444
|
65
|
+
text-shadow: 0 1px 1px desaturate($to - #333, 10%)
|
66
|
+
overflow: visible
|
67
|
+
outline: 1px solid $to
|
68
|
+
&:hover
|
69
|
+
+gradient_bg(saturate($from + #111111, 5%), $to)
|
70
|
+
&:active
|
71
|
+
+gradient-bg($from - #222, $to)
|
72
|
+
&[disabled], &.disabled
|
73
|
+
+opacity(.7)
|
74
|
+
cursor: default
|
75
|
+
&:hover
|
76
|
+
+gradient-bg($from, $to)
|
@@ -1,14 +1,5 @@
|
|
1
|
-
require 'generators/hashrocket/generators'
|
2
|
-
|
3
1
|
module Hashrocket
|
4
2
|
class InstallGenerator < ::Rails::Generators::Base
|
5
|
-
|
6
|
-
|
7
|
-
def convert_layout
|
8
|
-
template 'application.html.haml', 'app/views/layouts/application.html.haml'
|
9
|
-
remove_file 'app/views/layouts/application.html.erb'
|
10
|
-
commit 'Convert layout to haml'
|
11
|
-
end
|
12
|
-
|
3
|
+
invoke 'hashrocket:layout', 'hashrocket:ui'
|
13
4
|
end
|
14
5
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Description:
|
2
|
+
Base application layout & stylesheet setup
|
3
|
+
|
4
|
+
Example:
|
5
|
+
rails generate hashrocket:layout
|
6
|
+
|
7
|
+
Installs a base layout with:
|
8
|
+
* html5shiv
|
9
|
+
* shared flash partial
|
10
|
+
|
11
|
+
Install a base stylsheet with:
|
12
|
+
* a standard directory structure
|
13
|
+
* mixins imported
|
14
|
+
* whitespace-reset
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'generators/hashrocket/generators'
|
2
|
+
|
3
|
+
module Hashrocket
|
4
|
+
class LayoutGenerator < ::Rails::Generators::Base
|
5
|
+
include Generators
|
6
|
+
|
7
|
+
def setup_layout
|
8
|
+
template 'application.html.haml', 'app/views/layouts/application.html.haml'
|
9
|
+
remove_file 'app/views/layouts/application.html.erb'
|
10
|
+
commit 'Setup base layout'
|
11
|
+
end
|
12
|
+
|
13
|
+
def setup_stylesheets
|
14
|
+
remove_file 'app/assets/stylesheets/application.css'
|
15
|
+
gitkeep 'app/assets/stylesheets/vendor'
|
16
|
+
gitkeep 'app/assets/stylesheets/global'
|
17
|
+
template 'application.css.sass', 'app/assets/stylesheets/application.css.sass'
|
18
|
+
commit 'Setup base stylesheets'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hashrocket-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ date: 2011-12-17 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: haml-rails
|
17
|
-
requirement: &
|
17
|
+
requirement: &2151924760 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2151924760
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: decent_exposure
|
28
|
-
requirement: &
|
28
|
+
requirement: &2151924180 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2151924180
|
37
37
|
description: Rails engine & generators for bootstrapping a Hashrocket project
|
38
38
|
email:
|
39
39
|
- dev@hashrocket.com
|
@@ -49,6 +49,7 @@ files:
|
|
49
49
|
- README.md
|
50
50
|
- Rakefile
|
51
51
|
- app/assets/javascripts/html5.js
|
52
|
+
- app/assets/stylesheets/mixins.sass
|
52
53
|
- app/assets/stylesheets/whitespace-reset.sass
|
53
54
|
- app/controllers/hashrocket/ui_controller.rb
|
54
55
|
- app/models/hashrocket/wireframe.rb
|
@@ -56,9 +57,11 @@ files:
|
|
56
57
|
- app/views/hashrocket/ui/index.html.haml
|
57
58
|
- hashrocket-rails.gemspec
|
58
59
|
- lib/generators/hashrocket/generators.rb
|
59
|
-
- lib/generators/hashrocket/install/USAGE
|
60
60
|
- lib/generators/hashrocket/install/install_generator.rb
|
61
|
-
- lib/generators/hashrocket/
|
61
|
+
- lib/generators/hashrocket/layout/USAGE
|
62
|
+
- lib/generators/hashrocket/layout/layout_generator.rb
|
63
|
+
- lib/generators/hashrocket/layout/templates/application.css.sass
|
64
|
+
- lib/generators/hashrocket/layout/templates/application.html.haml
|
62
65
|
- lib/generators/hashrocket/ui/USAGE
|
63
66
|
- lib/generators/hashrocket/ui/templates/ui_controller.rb
|
64
67
|
- lib/generators/hashrocket/ui/ui_generator.rb
|