flutie 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +2 -0
  3. data/.rubocop.yml +9 -0
  4. data/.travis.yml +10 -6
  5. data/Appraisals +3 -3
  6. data/CHANGELOG.md +34 -0
  7. data/CONTRIBUTING.md +24 -26
  8. data/Gemfile +1 -1
  9. data/Gemfile.lock +76 -62
  10. data/README.md +83 -41
  11. data/Rakefile +2 -2
  12. data/flutie.gemspec +38 -15
  13. data/lib/flutie.rb +1 -0
  14. data/lib/flutie/body_class.rb +43 -0
  15. data/lib/flutie/body_class_helper.rb +8 -8
  16. data/lib/flutie/page_title.rb +32 -0
  17. data/lib/flutie/page_title_helper.rb +8 -8
  18. data/lib/flutie/page_title_presenter.rb +32 -0
  19. data/lib/flutie/railtie.rb +8 -4
  20. data/lib/flutie/version.rb +1 -1
  21. metadata +53 -119
  22. data/gemfiles/rails_3.0.20.gemfile +0 -7
  23. data/gemfiles/rails_3.1.11.gemfile +0 -7
  24. data/gemfiles/rails_3.2.12.gemfile +0 -7
  25. data/spec/dummy/Rakefile +0 -7
  26. data/spec/dummy/app/controllers/application_controller.rb +0 -3
  27. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  28. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  29. data/spec/dummy/config.ru +0 -4
  30. data/spec/dummy/config/application.rb +0 -45
  31. data/spec/dummy/config/boot.rb +0 -10
  32. data/spec/dummy/config/database.yml +0 -11
  33. data/spec/dummy/config/environment.rb +0 -5
  34. data/spec/dummy/config/environments/development.rb +0 -26
  35. data/spec/dummy/config/environments/production.rb +0 -49
  36. data/spec/dummy/config/environments/test.rb +0 -35
  37. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  38. data/spec/dummy/config/initializers/inflections.rb +0 -10
  39. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  40. data/spec/dummy/config/initializers/secret_token.rb +0 -7
  41. data/spec/dummy/config/initializers/session_store.rb +0 -8
  42. data/spec/dummy/config/locales/en.yml +0 -5
  43. data/spec/dummy/config/routes.rb +0 -58
  44. data/spec/dummy/public/404.html +0 -26
  45. data/spec/dummy/public/422.html +0 -26
  46. data/spec/dummy/public/500.html +0 -26
  47. data/spec/dummy/public/favicon.ico +0 -0
  48. data/spec/dummy/public/javascripts/application.js +0 -2
  49. data/spec/dummy/public/javascripts/controls.js +0 -965
  50. data/spec/dummy/public/javascripts/dragdrop.js +0 -974
  51. data/spec/dummy/public/javascripts/effects.js +0 -1123
  52. data/spec/dummy/public/javascripts/prototype.js +0 -6001
  53. data/spec/dummy/public/javascripts/rails.js +0 -191
  54. data/spec/dummy/public/stylesheets/.gitkeep +0 -0
  55. data/spec/dummy/script/rails +0 -6
  56. data/spec/helpers/body_class_helper_spec.rb +0 -43
  57. data/spec/helpers/page_title_helper_spec.rb +0 -27
  58. data/spec/spec_helper.rb +0 -30
@@ -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
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
@@ -0,0 +1,9 @@
1
+ AllCops:
2
+ Exclude:
3
+ - 'bin/{bundle,setup}'
4
+ - 'gemfiles/*'
5
+
6
+ Metrics/BlockLength:
7
+ ExcludedMethods: ['describe', 'context']
8
+ Exclude:
9
+ - "flutie.gemspec"
@@ -1,9 +1,13 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.8.7
4
- - 1.9.2
5
- - 1.9.3
3
+ - 2.3.7
4
+ - 2.4.4
5
+ - 2.5.1
6
6
  gemfile:
7
- - gemfiles/rails_3.0.20.gemfile
8
- - gemfiles/rails_3.1.11.gemfile
9
- - gemfiles/rails_3.2.12.gemfile
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
- ['3.2.12', '3.1.11', '3.0.20'].each do |rails_version|
2
- appraise "rails-#{rails_version}" do
3
- gem "rails", rails_version
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
@@ -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
@@ -1,38 +1,36 @@
1
- We love pull requests. Here's a quick guide:
1
+ # Contributing
2
2
 
3
- 1. Fork the repo.
3
+ We love pull requests. Here's a quick guide.
4
4
 
5
- 2. Run the tests. We only take pull requests with passing tests, and it's great
6
- to know that you have a clean slate: `bundle && rake`
5
+ Fork the repo:
7
6
 
8
- 3. Add a test for your change. Only refactoring and documentation changes
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
- 4. Make the test pass.
9
+ Set up your machine:
13
10
 
14
- 5. Push to your fork and submit a pull request.
11
+ ./bin/setup
15
12
 
13
+ Make sure the tests pass:
16
14
 
17
- At this point you're waiting on us. We like to at least comment on, if not
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
- Some things that will increase the chance that your pull request is accepted,
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
- * Use Rails idioms and helpers
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
- Syntax:
21
+ Push to your fork and [submit a pull request][pr].
30
22
 
31
- * Two spaces, no tabs.
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
- And in case we didn't emphasize it enough: we love tests!
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
@@ -1,3 +1,3 @@
1
- source "http://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
@@ -1,80 +1,94 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- flutie (2.0.0)
4
+ flutie (2.1.0)
5
5
 
6
6
  GEM
7
- remote: http://rubygems.org/
7
+ remote: https://rubygems.org/
8
8
  specs:
9
- actionpack (3.2.12)
10
- activemodel (= 3.2.12)
11
- activesupport (= 3.2.12)
12
- builder (~> 3.0.0)
13
- erubis (~> 2.7.0)
14
- journey (~> 1.0.4)
15
- rack (~> 1.4.5)
16
- rack-cache (~> 1.2)
17
- rack-test (~> 0.6.1)
18
- sprockets (~> 2.2.1)
19
- activemodel (3.2.12)
20
- activesupport (= 3.2.12)
21
- builder (~> 3.0.0)
22
- activesupport (3.2.12)
23
- i18n (~> 0.6)
24
- multi_json (~> 1.0)
25
- appraisal (0.5.1)
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
- builder (3.0.4)
29
- diff-lcs (1.1.3)
30
- erubis (2.7.0)
31
- hike (1.2.1)
32
- i18n (0.6.1)
33
- journey (1.0.4)
34
- json (1.7.7)
35
- multi_json (1.5.1)
36
- rack (1.4.5)
37
- rack-cache (1.2)
38
- rack (>= 0.4)
39
- rack-ssl (1.3.3)
40
- rack
41
- rack-test (0.6.2)
42
- rack (>= 1.0)
43
- railties (3.2.12)
44
- actionpack (= 3.2.12)
45
- activesupport (= 3.2.12)
46
- rack-ssl (~> 1.3.2)
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
- rdoc (~> 3.4)
49
- thor (>= 0.14.6, < 2.0)
50
- rake (10.0.3)
51
- rdoc (3.12.1)
52
- json (~> 1.4)
53
- rspec-core (2.12.2)
54
- rspec-expectations (2.12.1)
55
- diff-lcs (~> 1.1.3)
56
- rspec-mocks (2.12.2)
57
- rspec-rails (2.12.2)
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 (~> 2.12.0)
62
- rspec-expectations (~> 2.12.0)
63
- rspec-mocks (~> 2.12.0)
64
- sprockets (2.2.2)
65
- hike (~> 1.2)
66
- multi_json (~> 1.0)
67
- rack (~> 1.0)
68
- tilt (~> 1.1, != 1.3.0)
69
- sqlite3 (1.3.7)
70
- thor (0.17.0)
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://secure.travis-ci.org/thoughtbot/flutie.png)](http://travis-ci.org/thoughtbot/flutie)
3
+ [![Build Status](https://travis-ci.org/thoughtbot/flutie.svg?branch=master)](https://travis-ci.org/thoughtbot/flutie)
5
4
 
6
- Flutie provides extra ActionView view helpers for use with Rails applications. Previous versions created default application styles.
5
+ Flutie provides some utility view helpers for use with Rails applications.
7
6
 
8
- Please look to [Bourbon](https://github.com/thoughtbot/bourbon) and [Neat](https://github.com/thoughtbot/neat) gems for style defaults now.
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 meant for use with Rails. It works with versions of Rails greater than 3.0.
11
+ Flutie is a Railtie. We support the versions of Ruby and Rails listed in
12
+ [.travis.yml](.travis.yml).
14
13
 
15
- Flutie is recommended to be run as a gem and included in your Gemfile:
14
+ It should be run as a gem and included in your `Gemfile`:
16
15
 
17
- gem 'flutie'
16
+ ```ruby
17
+ gem "flutie"
18
+ ```
18
19
 
19
- Helpers
20
- -------
20
+ ## Helpers
21
21
 
22
- Flutie provides several helper methods for layouts as well.
22
+ Flutie provides helper methods for use within Rails layouts and views.
23
23
 
24
- #### page_title
24
+ ### Page Title
25
25
 
26
26
  The `page_title` method can be used like:
27
27
 
28
- <title><%= page_title %></title>
28
+ ```erb
29
+ <title><%= page_title %></title>
30
+ ```
29
31
 
30
32
  By default, it will produce results like:
31
33
 
32
- <title>Appname : page title</title>
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 app, i.e. `Appname::Application` will produce "Appname"
35
- * "page" comes from trying `content_for(:page_title)` and assumes you are using `content_for` with `:page_title` symbol on your pages.
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`, `:page_title_symbol` and `:separator` hash keys, ie:
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
- content_for(:site_page_title, 'My title of my page')
41
- page_title(:app_name => 'My app name', :page_title_symbol => :site_page_title, :separator => " | ")
42
- => "My app name | My title of my page"
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
- #### body_class
52
+ would produce:
45
53
 
46
- The `body_class` method can be used like:
54
+ ```html
55
+ <title>My app name | My title of my page</title>
56
+ ```
47
57
 
48
- <body class="<%= body_class %>">
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
- This will produce a string including the controller name and controller-action name. For example, The WidgetsController#show action would produce:
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
- <body class="widgets widgets-show">
66
+ would produce:
53
67
 
54
- Anything which has been added via `content_for(:extra_body_classes)` will be added to the end, for example:
68
+ ```html
69
+ <title>My title of my page : My app name</title>
70
+ ```
55
71
 
56
- content_for(:extra_body_classes, 'special-page')
57
- <body class="<%= body_class %>">
58
- <body class="widgets widgets-show special-page">
72
+ ### Body Class
59
73
 
60
- Suggestions, Bugs, Refactoring?
61
- -------------------------------
74
+ The `body_class` method can be used like this in a layout:
62
75
 
63
- Please see CONTRIBUTING.md for details.
76
+ ```erb
77
+ <body class="<%= body_class %>">
78
+ ```
64
79
 
65
- Credits
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](http://thoughtbot.com/community)
109
+ Flutie is maintained and funded by [thoughtbot, inc].
71
110
 
72
- Thank you to all [the contributors](https://github.com/thoughtbot/flutie/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
- Flutie is Copyright © 2010-2013 thoughtbot. It is free software, and may be redistributed under the terms specified in the LICENSE file.
120
+ [thoughtbot, inc]: http://thoughtbot.com/community
121
+ [the contributors]: https://github.com/thoughtbot/flutie/contributors