flutie 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +2 -0
- data/.rubocop.yml +9 -0
- data/.travis.yml +10 -6
- data/Appraisals +3 -3
- data/CHANGELOG.md +34 -0
- data/CONTRIBUTING.md +24 -26
- data/Gemfile +1 -1
- data/Gemfile.lock +76 -62
- data/README.md +83 -41
- data/Rakefile +2 -2
- data/flutie.gemspec +38 -15
- data/lib/flutie.rb +1 -0
- data/lib/flutie/body_class.rb +43 -0
- data/lib/flutie/body_class_helper.rb +8 -8
- data/lib/flutie/page_title.rb +32 -0
- data/lib/flutie/page_title_helper.rb +8 -8
- data/lib/flutie/page_title_presenter.rb +32 -0
- data/lib/flutie/railtie.rb +8 -4
- data/lib/flutie/version.rb +1 -1
- metadata +53 -119
- data/gemfiles/rails_3.0.20.gemfile +0 -7
- data/gemfiles/rails_3.1.11.gemfile +0 -7
- data/gemfiles/rails_3.2.12.gemfile +0 -7
- data/spec/dummy/Rakefile +0 -7
- data/spec/dummy/app/controllers/application_controller.rb +0 -3
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/config/application.rb +0 -45
- data/spec/dummy/config/boot.rb +0 -10
- data/spec/dummy/config/database.yml +0 -11
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -26
- data/spec/dummy/config/environments/production.rb +0 -49
- data/spec/dummy/config/environments/test.rb +0 -35
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/inflections.rb +0 -10
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/config/initializers/secret_token.rb +0 -7
- data/spec/dummy/config/initializers/session_store.rb +0 -8
- data/spec/dummy/config/locales/en.yml +0 -5
- data/spec/dummy/config/routes.rb +0 -58
- data/spec/dummy/public/404.html +0 -26
- data/spec/dummy/public/422.html +0 -26
- data/spec/dummy/public/500.html +0 -26
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/javascripts/application.js +0 -2
- data/spec/dummy/public/javascripts/controls.js +0 -965
- data/spec/dummy/public/javascripts/dragdrop.js +0 -974
- data/spec/dummy/public/javascripts/effects.js +0 -1123
- data/spec/dummy/public/javascripts/prototype.js +0 -6001
- data/spec/dummy/public/javascripts/rails.js +0 -191
- data/spec/dummy/public/stylesheets/.gitkeep +0 -0
- data/spec/dummy/script/rails +0 -6
- data/spec/helpers/body_class_helper_spec.rb +0 -43
- data/spec/helpers/page_title_helper_spec.rb +0 -27
- data/spec/spec_helper.rb +0 -30
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 40b644b9e3d68ac23396f430560d921c5ca9a10c011918be5ec87cfa091757fc
|
4
|
+
data.tar.gz: 166e8e7c83edc2e5bf95edadcedd01e16614e32641735dc8b0d81de8d2e1abe7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cb914b168238ed393e27ae7cbbffa31f9ef612cba00e1af569725b9e31ba8514da16adbeb7e51a4f4460b8a0d7196e9a06dd849cea40c1d3ccc397d98884b1e4
|
7
|
+
data.tar.gz: 2ab8dddabc7741b6e796968c28e7119d08f3ea7abee5b1fda4b95f3ae92ddb36be230b715dfdfad80462df2603333a3bbe8e8f8b0dd64c41a6d5264ba1bdfb00
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.travis.yml
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
-
|
4
|
-
-
|
5
|
-
-
|
3
|
+
- 2.3.7
|
4
|
+
- 2.4.4
|
5
|
+
- 2.5.1
|
6
6
|
gemfile:
|
7
|
-
- gemfiles/
|
8
|
-
- gemfiles/
|
9
|
-
- gemfiles/
|
7
|
+
- gemfiles/rails_5.2.0.gemfile
|
8
|
+
- gemfiles/rails_5.1.0.gemfile
|
9
|
+
- gemfiles/rails_5.0.0.gemfile
|
10
|
+
- gemfiles/rails_4.2.0.gemfile
|
11
|
+
notifications:
|
12
|
+
email: false
|
13
|
+
sudo: false
|
data/Appraisals
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
['
|
2
|
-
appraise "
|
3
|
-
gem
|
1
|
+
['5.2.0', '5.1.0', '5.0.0', '4.2.0'].each do |rails_version|
|
2
|
+
appraise "rails_#{rails_version}" do
|
3
|
+
gem 'rails', "~> #{rails_version}"
|
4
4
|
end
|
5
5
|
end
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## [Unreleased]
|
4
|
+
|
5
|
+
## [2.1.0] - 2018-09-27
|
6
|
+
|
7
|
+
### Added
|
8
|
+
|
9
|
+
- Spec coverage for Ruby 2.0 and Rails 4.0
|
10
|
+
- Setup script for easier development
|
11
|
+
- Add `reverse` option for `page_title` which switches order of parts
|
12
|
+
|
13
|
+
### Removed
|
14
|
+
|
15
|
+
- Dropped support for Ruby prior to 2.3.0
|
16
|
+
- Dropped support for Rails prior to 4.2.0
|
17
|
+
|
18
|
+
### Changed
|
19
|
+
|
20
|
+
- Reduce gem file size by excluding unnecessary files from release
|
21
|
+
|
22
|
+
## [2.0.0] - 2013-02-12
|
23
|
+
|
24
|
+
### Removed
|
25
|
+
|
26
|
+
- All stylesheets were removed from the project
|
27
|
+
|
28
|
+
### Changed
|
29
|
+
|
30
|
+
- Convert from Rails Engine to Railtie
|
31
|
+
|
32
|
+
[Unreleased]: https://github.com/thoughtbot/flutie/compare/v2.1.0...HEAD
|
33
|
+
[2.1.0]: https://github.com/thoughtbot/flutie/compare/v2.0.0...v2.1.0
|
34
|
+
[2.0.0]: https://github.com/thoughtbot/flutie/compare/v1.3.4...v2.0.0
|
data/CONTRIBUTING.md
CHANGED
@@ -1,38 +1,36 @@
|
|
1
|
-
|
1
|
+
# Contributing
|
2
2
|
|
3
|
-
|
3
|
+
We love pull requests. Here's a quick guide.
|
4
4
|
|
5
|
-
|
6
|
-
to know that you have a clean slate: `bundle && rake`
|
5
|
+
Fork the repo:
|
7
6
|
|
8
|
-
|
9
|
-
require no new tests. If you are adding functionality or fixing a bug, we need
|
10
|
-
a test!
|
7
|
+
git clone git@github.com:thoughtbot/flutie.git
|
11
8
|
|
12
|
-
|
9
|
+
Set up your machine:
|
13
10
|
|
14
|
-
|
11
|
+
./bin/setup
|
15
12
|
|
13
|
+
Make sure the tests pass:
|
16
14
|
|
17
|
-
|
18
|
-
accept, pull requests within three business days (and, typically, one business
|
19
|
-
day). We may suggest some changes or improvements or alternatives.
|
15
|
+
rake
|
20
16
|
|
21
|
-
|
22
|
-
taken straight from the Ruby on Rails guide:
|
17
|
+
Make your change. Add tests for your change. Make the tests pass:
|
23
18
|
|
24
|
-
|
25
|
-
* Include tests that fail without your code, and pass with it
|
26
|
-
* Update the documentation, the surrounding one, examples elsewhere, guides,
|
27
|
-
whatever is affected by your contribution
|
19
|
+
rake
|
28
20
|
|
29
|
-
|
21
|
+
Push to your fork and [submit a pull request][pr].
|
30
22
|
|
31
|
-
|
32
|
-
* No trailing whitespace. Blank lines should not have any space.
|
33
|
-
* Prefer &&/|| over and/or.
|
34
|
-
* MyClass.my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
|
35
|
-
* a = b and not a=b.
|
36
|
-
* Follow the conventions you see used in the source already.
|
23
|
+
[pr]: https://github.com/thoughtbot/flutie/compare/
|
37
24
|
|
38
|
-
|
25
|
+
At this point you're waiting on us.
|
26
|
+
We try to at least comment on within one business day.
|
27
|
+
We may suggest some changes.
|
28
|
+
|
29
|
+
Some things that will increase the chance that your pull request is accepted:
|
30
|
+
|
31
|
+
* Write tests.
|
32
|
+
* Follow our [style guide][style].
|
33
|
+
* Write a [good commit message][commit].
|
34
|
+
|
35
|
+
[style]: https://github.com/thoughtbot/guides/tree/master/style
|
36
|
+
[commit]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,80 +1,94 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
flutie (2.
|
4
|
+
flutie (2.1.0)
|
5
5
|
|
6
6
|
GEM
|
7
|
-
remote:
|
7
|
+
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
actionpack (
|
10
|
-
|
11
|
-
activesupport (=
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
activesupport (
|
23
|
-
|
24
|
-
|
25
|
-
|
9
|
+
actionpack (5.2.1)
|
10
|
+
actionview (= 5.2.1)
|
11
|
+
activesupport (= 5.2.1)
|
12
|
+
rack (~> 2.0)
|
13
|
+
rack-test (>= 0.6.3)
|
14
|
+
rails-dom-testing (~> 2.0)
|
15
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
16
|
+
actionview (5.2.1)
|
17
|
+
activesupport (= 5.2.1)
|
18
|
+
builder (~> 3.1)
|
19
|
+
erubi (~> 1.4)
|
20
|
+
rails-dom-testing (~> 2.0)
|
21
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
22
|
+
activesupport (5.2.1)
|
23
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
24
|
+
i18n (>= 0.7, < 2)
|
25
|
+
minitest (~> 5.1)
|
26
|
+
tzinfo (~> 1.1)
|
27
|
+
appraisal (2.2.0)
|
26
28
|
bundler
|
27
29
|
rake
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
rack
|
30
|
+
thor (>= 0.14.0)
|
31
|
+
builder (3.2.3)
|
32
|
+
concurrent-ruby (1.0.5)
|
33
|
+
crass (1.0.4)
|
34
|
+
diff-lcs (1.3)
|
35
|
+
erubi (1.7.1)
|
36
|
+
i18n (1.1.0)
|
37
|
+
concurrent-ruby (~> 1.0)
|
38
|
+
loofah (2.2.2)
|
39
|
+
crass (~> 1.0.2)
|
40
|
+
nokogiri (>= 1.5.9)
|
41
|
+
method_source (0.9.0)
|
42
|
+
mini_portile2 (2.3.0)
|
43
|
+
minitest (5.11.3)
|
44
|
+
nokogiri (1.8.4)
|
45
|
+
mini_portile2 (~> 2.3.0)
|
46
|
+
rack (2.0.5)
|
47
|
+
rack-test (1.1.0)
|
48
|
+
rack (>= 1.0, < 3)
|
49
|
+
rails-dom-testing (2.0.3)
|
50
|
+
activesupport (>= 4.2.0)
|
51
|
+
nokogiri (>= 1.6)
|
52
|
+
rails-html-sanitizer (1.0.4)
|
53
|
+
loofah (~> 2.2, >= 2.2.2)
|
54
|
+
railties (5.2.1)
|
55
|
+
actionpack (= 5.2.1)
|
56
|
+
activesupport (= 5.2.1)
|
57
|
+
method_source
|
47
58
|
rake (>= 0.8.7)
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
59
|
+
thor (>= 0.19.0, < 2.0)
|
60
|
+
rake (12.3.1)
|
61
|
+
rspec-core (3.8.0)
|
62
|
+
rspec-support (~> 3.8.0)
|
63
|
+
rspec-expectations (3.8.1)
|
64
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
65
|
+
rspec-support (~> 3.8.0)
|
66
|
+
rspec-mocks (3.8.0)
|
67
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
68
|
+
rspec-support (~> 3.8.0)
|
69
|
+
rspec-rails (3.8.0)
|
58
70
|
actionpack (>= 3.0)
|
59
71
|
activesupport (>= 3.0)
|
60
72
|
railties (>= 3.0)
|
61
|
-
rspec-core (~>
|
62
|
-
rspec-expectations (~>
|
63
|
-
rspec-mocks (~>
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
tilt (1.3.3)
|
73
|
+
rspec-core (~> 3.8.0)
|
74
|
+
rspec-expectations (~> 3.8.0)
|
75
|
+
rspec-mocks (~> 3.8.0)
|
76
|
+
rspec-support (~> 3.8.0)
|
77
|
+
rspec-support (3.8.0)
|
78
|
+
sqlite3 (1.3.13)
|
79
|
+
thor (0.20.0)
|
80
|
+
thread_safe (0.3.6)
|
81
|
+
tzinfo (1.2.5)
|
82
|
+
thread_safe (~> 0.1)
|
72
83
|
|
73
84
|
PLATFORMS
|
74
85
|
ruby
|
75
86
|
|
76
87
|
DEPENDENCIES
|
77
|
-
appraisal
|
88
|
+
appraisal (~> 2.2)
|
78
89
|
flutie!
|
79
|
-
rspec-rails
|
80
|
-
sqlite3
|
90
|
+
rspec-rails (~> 3.7)
|
91
|
+
sqlite3 (~> 1.3)
|
92
|
+
|
93
|
+
BUNDLED WITH
|
94
|
+
1.16.5
|
data/README.md
CHANGED
@@ -1,79 +1,121 @@
|
|
1
|
-
Flutie
|
2
|
-
======
|
1
|
+
# Flutie
|
3
2
|
|
4
|
-
[![Build Status](https://
|
3
|
+
[![Build Status](https://travis-ci.org/thoughtbot/flutie.svg?branch=master)](https://travis-ci.org/thoughtbot/flutie)
|
5
4
|
|
6
|
-
Flutie provides
|
5
|
+
Flutie provides some utility view helpers for use with Rails applications.
|
7
6
|
|
8
|
-
|
7
|
+
There are helpers for setting a page title and for generating body classes.
|
9
8
|
|
10
|
-
Installation & Upgrading
|
11
|
-
------------------------
|
9
|
+
## Installation & Upgrading
|
12
10
|
|
13
|
-
Flutie is a Railtie
|
11
|
+
Flutie is a Railtie. We support the versions of Ruby and Rails listed in
|
12
|
+
[.travis.yml](.travis.yml).
|
14
13
|
|
15
|
-
|
14
|
+
It should be run as a gem and included in your `Gemfile`:
|
16
15
|
|
17
|
-
|
16
|
+
```ruby
|
17
|
+
gem "flutie"
|
18
|
+
```
|
18
19
|
|
19
|
-
Helpers
|
20
|
-
-------
|
20
|
+
## Helpers
|
21
21
|
|
22
|
-
Flutie provides
|
22
|
+
Flutie provides helper methods for use within Rails layouts and views.
|
23
23
|
|
24
|
-
|
24
|
+
### Page Title
|
25
25
|
|
26
26
|
The `page_title` method can be used like:
|
27
27
|
|
28
|
-
|
28
|
+
```erb
|
29
|
+
<title><%= page_title %></title>
|
30
|
+
```
|
29
31
|
|
30
32
|
By default, it will produce results like:
|
31
33
|
|
32
|
-
|
34
|
+
```html
|
35
|
+
<title>Appname : page title</title>
|
36
|
+
```
|
33
37
|
|
34
|
-
* "App name" comes from the module name of the rails application created by your
|
35
|
-
|
38
|
+
* "App name" comes from the module name of the rails application created by your
|
39
|
+
app, i.e. `Appname::Application` will produce "Appname"
|
40
|
+
* "page" comes from trying `content_for(:page_title)` and assumes you are using
|
41
|
+
`content_for` with `:page_title` symbol on your pages.
|
36
42
|
* The separator defaults to " : "
|
37
43
|
|
38
|
-
These can be overridden by passing an options hash including `:app_name`,
|
44
|
+
These can be overridden by passing an options hash including `:app_name`,
|
45
|
+
`:page_title_symbol` and `:separator` hash keys. For example:
|
39
46
|
|
40
|
-
|
41
|
-
|
42
|
-
|
47
|
+
```ruby
|
48
|
+
content_for(:site_page_title, 'My title of my page')
|
49
|
+
page_title(:app_name => 'My app name', :page_title_symbol => :site_page_title, :separator => " | ")
|
50
|
+
```
|
43
51
|
|
44
|
-
|
52
|
+
would produce:
|
45
53
|
|
46
|
-
|
54
|
+
```html
|
55
|
+
<title>My app name | My title of my page</title>
|
56
|
+
```
|
47
57
|
|
48
|
-
|
58
|
+
You can also reverse the position of the app name and the :site_page_title
|
59
|
+
using the :reverse option. For example:
|
49
60
|
|
50
|
-
|
61
|
+
```ruby
|
62
|
+
content_for(:site_page_title, 'My title of my page')
|
63
|
+
page_title(:app_name => 'My app name', :page_title_symbol => :site_page_title, reverse: true)
|
64
|
+
```
|
51
65
|
|
52
|
-
|
66
|
+
would produce:
|
53
67
|
|
54
|
-
|
68
|
+
```html
|
69
|
+
<title>My title of my page : My app name</title>
|
70
|
+
```
|
55
71
|
|
56
|
-
|
57
|
-
<body class="<%= body_class %>">
|
58
|
-
<body class="widgets widgets-show special-page">
|
72
|
+
### Body Class
|
59
73
|
|
60
|
-
|
61
|
-
-------------------------------
|
74
|
+
The `body_class` method can be used like this in a layout:
|
62
75
|
|
63
|
-
|
76
|
+
```erb
|
77
|
+
<body class="<%= body_class %>">
|
78
|
+
```
|
64
79
|
|
65
|
-
|
66
|
-
|
80
|
+
This will produce a string including the controller name and controller-action
|
81
|
+
name pair. For example, The `WidgetsController#show` action would produce:
|
82
|
+
|
83
|
+
```html
|
84
|
+
<body class="widgets widgets-show">
|
85
|
+
```
|
86
|
+
|
87
|
+
Anything which has been added via `content_for(:extra_body_classes)` will be
|
88
|
+
added to the end, for example views like:
|
89
|
+
|
90
|
+
```erb
|
91
|
+
content_for(:extra_body_classes, 'special-page')
|
92
|
+
<body class="<%= body_class %>">
|
93
|
+
```
|
94
|
+
|
95
|
+
would produce:
|
96
|
+
|
97
|
+
```html
|
98
|
+
<body class="widgets widgets-show special-page">
|
99
|
+
```
|
100
|
+
|
101
|
+
## How to contribute
|
102
|
+
|
103
|
+
Please see the [CONTRIBUTING](CONTRIBUTING.md) file for details.
|
104
|
+
|
105
|
+
## Credits
|
67
106
|
|
68
107
|
![thoughtbot](http://thoughtbot.com/images/tm/logo.png)
|
69
108
|
|
70
|
-
Flutie is maintained and funded by [thoughtbot, inc]
|
109
|
+
Flutie is maintained and funded by [thoughtbot, inc].
|
71
110
|
|
72
|
-
Thank you to all [the contributors]
|
111
|
+
Thank you to all [the contributors]!
|
73
112
|
|
74
113
|
The names and logos for thoughtbot are trademarks of thoughtbot, inc.
|
75
114
|
|
76
|
-
License
|
77
|
-
|
115
|
+
## License
|
116
|
+
|
117
|
+
Flutie is Copyright © 2010 thoughtbot, inc. It is free software, and may be
|
118
|
+
redistributed under the terms specified in the [LICENSE](LICENSE) file.
|
78
119
|
|
79
|
-
|
120
|
+
[thoughtbot, inc]: http://thoughtbot.com/community
|
121
|
+
[the contributors]: https://github.com/thoughtbot/flutie/contributors
|