bootstrap-sass-extras 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +7 -0
  3. data/CHANGELOG.md +13 -0
  4. data/Gemfile +1 -1
  5. data/Gemfile.lock +115 -97
  6. data/README.md +39 -0
  7. data/Rakefile +11 -1
  8. data/app/helpers/nav_helper.rb +33 -0
  9. data/app/helpers/twitter_breadcrumbs_helper.rb +2 -2
  10. data/app/helpers/url_helper.rb +25 -0
  11. data/lib/bootstrap-sass-extras/engine.rb +2 -0
  12. data/lib/bootstrap-sass-extras/version.rb +1 -1
  13. data/lib/generators/bootstrap/layout/templates/layout.html.erb +6 -6
  14. data/lib/generators/bootstrap/layout/templates/layout.html.haml +6 -6
  15. data/lib/generators/bootstrap/layout/templates/layout.html.slim +6 -6
  16. data/lib/generators/bootstrap/partial/templates/_login.html.erb +6 -6
  17. data/lib/generators/bootstrap/themed/templates/_form.html.erb +6 -6
  18. data/lib/generators/bootstrap/themed/templates/_form.html.haml +5 -5
  19. data/lib/generators/bootstrap/themed/templates/_form.html.slim +5 -5
  20. data/lib/generators/bootstrap/themed/templates/edit.html.erb +2 -2
  21. data/lib/generators/bootstrap/themed/templates/edit.html.haml +2 -2
  22. data/lib/generators/bootstrap/themed/templates/edit.html.slim +2 -2
  23. data/lib/generators/bootstrap/themed/templates/index.html.erb +7 -7
  24. data/lib/generators/bootstrap/themed/templates/index.html.haml +6 -6
  25. data/lib/generators/bootstrap/themed/templates/index.html.slim +6 -6
  26. data/lib/generators/bootstrap/themed/templates/new.html.erb +2 -2
  27. data/lib/generators/bootstrap/themed/templates/new.html.haml +2 -2
  28. data/lib/generators/bootstrap/themed/templates/new.html.slim +2 -2
  29. data/lib/generators/bootstrap/themed/templates/show.html.erb +9 -9
  30. data/lib/generators/bootstrap/themed/templates/show.html.haml +9 -10
  31. data/lib/generators/bootstrap/themed/templates/show.html.slim +4 -4
  32. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.erb +5 -5
  33. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.haml +4 -4
  34. data/lib/generators/bootstrap/themed/templates/simple_form/_form.html.slim +4 -4
  35. data/spec/dummy/README.rdoc +15 -248
  36. data/spec/dummy/Rakefile +1 -2
  37. data/spec/dummy/app/{mailers/.gitkeep → assets/images/.keep} +0 -0
  38. data/spec/dummy/app/assets/javascripts/application.js +4 -6
  39. data/spec/dummy/app/assets/stylesheets/application.css +6 -4
  40. data/spec/dummy/app/controllers/application_controller.rb +3 -1
  41. data/spec/dummy/app/{models/.gitkeep → controllers/concerns/.keep} +0 -0
  42. data/spec/dummy/{lib/assets/.gitkeep → app/mailers/.keep} +0 -0
  43. data/spec/dummy/{log/.gitkeep → app/models/.keep} +0 -0
  44. data/spec/dummy/app/models/concerns/.keep +0 -0
  45. data/spec/dummy/app/views/application/_custom_breadcrumbs.html.erb +1 -0
  46. data/spec/dummy/app/views/layouts/application.html.erb +2 -2
  47. data/spec/dummy/bin/bundle +3 -0
  48. data/spec/dummy/bin/rails +4 -0
  49. data/spec/dummy/bin/rake +4 -0
  50. data/spec/dummy/bin/setup +29 -0
  51. data/spec/dummy/config.ru +2 -2
  52. data/spec/dummy/config/application.rb +3 -36
  53. data/spec/dummy/config/boot.rb +4 -9
  54. data/spec/dummy/config/database.yml +8 -8
  55. data/spec/dummy/config/environment.rb +3 -3
  56. data/spec/dummy/config/environments/development.rb +22 -18
  57. data/spec/dummy/config/environments/production.rb +46 -34
  58. data/spec/dummy/config/environments/test.rb +19 -14
  59. data/spec/dummy/config/initializers/assets.rb +11 -0
  60. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  61. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  62. data/spec/dummy/config/initializers/inflections.rb +6 -5
  63. data/spec/dummy/config/initializers/mime_types.rb +0 -1
  64. data/spec/dummy/config/initializers/session_store.rb +1 -6
  65. data/spec/dummy/config/initializers/wrap_parameters.rb +6 -6
  66. data/spec/dummy/config/locales/en.yml +20 -2
  67. data/spec/dummy/config/routes.rb +23 -25
  68. data/spec/dummy/config/secrets.yml +22 -0
  69. data/spec/dummy/lib/assets/.keep +0 -0
  70. data/spec/dummy/log/.keep +0 -0
  71. data/spec/dummy/public/404.html +54 -13
  72. data/spec/dummy/public/422.html +54 -13
  73. data/spec/dummy/public/500.html +53 -12
  74. data/spec/helpers/badge_helper_spec.rb +1 -1
  75. data/spec/helpers/bootstrap_flash_helper_spec.rb +5 -5
  76. data/spec/helpers/bootstrap_viewport_meta_helper_spec.rb +4 -4
  77. data/spec/helpers/button_to_helper_spec.rb +19 -0
  78. data/spec/helpers/glyph_helper_spec.rb +1 -1
  79. data/spec/helpers/nav_helper_spec.rb +56 -0
  80. data/spec/helpers/twitter_breadcrumbs_helper_spec.rb +18 -10
  81. data/spec/spec_helper.rb +1 -1
  82. metadata +52 -27
  83. data/spec/dummy/config/initializers/secret_token.rb +0 -7
  84. data/spec/dummy/db/schema.rb +0 -16
  85. data/spec/dummy/script/rails +0 -6
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: 1f96354bc7d211a7bd76f7958567bb5ae4fcaf38f3105110992420894be80520e0692cee0a0f935ff70549daa1de86db1005987109bc16ce695525498fd9b76d
15
+
16
+ test:
17
+ secret_key_base: fc4fdf113a91c7fc74a58c9d2f1b5b4328a8be5e95a57d45a019735f2882663eee098b1d59752e72843759a8e8adcf4b502196a479cd2ef1edfa0b8d6661e0fa
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
File without changes
File without changes
@@ -2,25 +2,66 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>The page you were looking for doesn't exist (404)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
16
54
  </style>
17
55
  </head>
18
56
 
19
57
  <body>
20
58
  <!-- This file lives in public/404.html -->
21
59
  <div class="dialog">
22
- <h1>The page you were looking for doesn't exist.</h1>
23
- <p>You may have mistyped the address or the page may have moved.</p>
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
24
65
  </div>
25
66
  </body>
26
67
  </html>
@@ -2,25 +2,66 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>The change you wanted was rejected (422)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
16
54
  </style>
17
55
  </head>
18
56
 
19
57
  <body>
20
58
  <!-- This file lives in public/422.html -->
21
59
  <div class="dialog">
22
- <h1>The change you wanted was rejected.</h1>
23
- <p>Maybe you tried to change something you didn't have access to.</p>
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
24
65
  </div>
25
66
  </body>
26
67
  </html>
@@ -2,24 +2,65 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>We're sorry, but something went wrong (500)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
16
54
  </style>
17
55
  </head>
18
56
 
19
57
  <body>
20
58
  <!-- This file lives in public/500.html -->
21
59
  <div class="dialog">
22
- <h1>We're sorry, but something went wrong.</h1>
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
23
64
  </div>
24
65
  </body>
25
66
  </html>
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe BadgeHelper do
3
+ describe BadgeHelper, :type => :helper do
4
4
  describe "#badge" do
5
5
  let(:html) { %(<span class="badge">%i</span>) }
6
6
 
@@ -1,11 +1,11 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe BootstrapFlashHelper do
3
+ describe BootstrapFlashHelper, :type => :helper do
4
4
  describe "#bootstrap_flash" do
5
- let(:html) { %(<div class="alert alert-%s alert-dismissable"><button class="close" data-dismiss="alert" type="button">&times;</button>%s</div>) }
5
+ let(:html) { %(<div class="alert alert-%s alert-dismissable"><button name="button" type="button" class="close" data-dismiss="alert">&times;</button>%s</div>) }
6
6
 
7
7
  def flash_test(input, output)
8
- stub!(:flash).and_return(input)
8
+ allow(self).to receive(:flash).and_return(input)
9
9
  bootstrap_flash.should == html % output.to_a.flatten
10
10
  end
11
11
 
@@ -45,12 +45,12 @@ describe BootstrapFlashHelper do
45
45
  end
46
46
 
47
47
  it "returns nil when sent a blank message" do
48
- stub!(:flash).and_return(notice: "")
48
+ allow(self).to receive(:flash).and_return(notice: "")
49
49
  bootstrap_flash.should be_nil
50
50
  end
51
51
 
52
52
  it "returns nil when message doesn't have an implicit conversion to String" do
53
- stub!(:flash).and_return(notice: true)
53
+ allow(self).to receive(:flash).and_return(notice: true)
54
54
  bootstrap_flash.should be_nil
55
55
  end
56
56
  end
@@ -1,16 +1,16 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe BootstrapViewportMetaHelper do
4
- describe :viewport_meta_tag do
3
+ describe BootstrapViewportMetaHelper, :type => :helper do
4
+ describe :bootstrap_viewport_meta do
5
5
  context "no arguments" do
6
6
  it "should return the default viewport meta tag" do
7
- viewport_meta_tag.should =="<meta content=\"width=device-width,initial-scale=1.0\" name=\"viewport\" />"
7
+ viewport_meta_tag.should =="<meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\" />"
8
8
  end
9
9
  end
10
10
 
11
11
  context "with arguments" do
12
12
  it "should return the viewport meta tag with the specified options" do
13
- viewport_meta_tag(initial_scale: "2.0").should =="<meta content=\"width=device-width,initial-scale=2.0\" name=\"viewport\" />"
13
+ viewport_meta_tag(initial_scale: "2.0").should =="<meta name=\"viewport\" content=\"width=device-width,initial-scale=2.0\" />"
14
14
  end
15
15
  end
16
16
  end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe UrlHelper, :type => :helper do
4
+ describe "#button_to" do
5
+ def pattern(label, class_)
6
+ Regexp.new(Regexp.escape(html % [class_, label]))
7
+ end
8
+
9
+ let(:html) { %(<input class="btn %s" type="submit" value="%s" />) }
10
+
11
+ it "emits proper classes to style buttons" do
12
+ button_to("Test", "/test").should =~ pattern("Test", "btn-default")
13
+ end
14
+
15
+ it "does not emit a default if a button type is specified" do
16
+ button_to("Test", "/test", class: 'btn-danger').should =~ pattern("Test", "btn-danger")
17
+ end
18
+ end
19
+ end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe GlyphHelper do
3
+ describe GlyphHelper, :type => :helper do
4
4
  describe "#glyph" do
5
5
  let(:html) { %(<span class="glyphicon glyphicon-%s"></span>) }
6
6
 
@@ -0,0 +1,56 @@
1
+ require 'spec_helper'
2
+
3
+ describe NavHelper, :type => :helper do
4
+ describe "#tabs" do
5
+ before do
6
+ def self.current_page?(path)
7
+ path == '/'
8
+ end
9
+ end
10
+
11
+ let(:html) {
12
+ <<-TABS.strip_heredoc
13
+ <ul class="nav nav-tabs">
14
+ <li role="presentation" class="active"><a href="/">Name</a></li>
15
+ <li role="presentation"><a href="/profile">Profile</a></li>
16
+ </ul>
17
+ TABS
18
+ }
19
+
20
+ it "generates the correct link" do
21
+ (nav do
22
+ concat "\n "
23
+ concat (nav_to 'Name', '/')
24
+ concat "\n "
25
+ concat (nav_to '/profile' do
26
+ 'Profile'
27
+ end)
28
+ concat "\n"
29
+ end + "\n").should == html
30
+ end
31
+
32
+ context "when a type of navigation is specified" do
33
+ let(:html) { '<ul class="nav nav-pills"></ul>' }
34
+
35
+ it "generates the correct link" do
36
+ (nav class: 'nav-pills').should == html
37
+ end
38
+ end
39
+
40
+ context "when the navigation type helper is used" do
41
+ let(:html) { '<ul class="nav nav-tabs"></ul>' }
42
+
43
+ it "generates the correct link" do
44
+ (tabs).should == html
45
+ end
46
+ end
47
+
48
+ context "when a stacked nav is used" do
49
+ let(:html) { '<ul class="nav nav-stacked nav-pills"></ul>' }
50
+
51
+ it "generates the correct link" do
52
+ (pills class: 'nav-stacked').should == html
53
+ end
54
+ end
55
+ end
56
+ end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe TwitterBreadcrumbsHelper do
3
+ describe TwitterBreadcrumbsHelper, :type => :helper do
4
4
  describe "given one breadcrumb" do
5
5
  before do
6
6
  controller.send(:add_breadcrumb, "Name", "URL")
@@ -30,7 +30,7 @@ describe TwitterBreadcrumbsHelper do
30
30
 
31
31
  describe "#breadcrumbs?" do
32
32
  it "returns true" do
33
- helper.breadcrumbs?.should be_true
33
+ helper.breadcrumbs?.should be_truthy
34
34
  end
35
35
  end
36
36
 
@@ -50,9 +50,9 @@ describe TwitterBreadcrumbsHelper do
50
50
 
51
51
  describe "#clear_breadcrumbs" do
52
52
  it "empties all existing breadcrumbs" do
53
- helper.breadcrumbs?.should be_true
53
+ helper.breadcrumbs?.should be_truthy
54
54
  controller.send(:clear_breadcrumbs)
55
- helper.breadcrumbs?.should be_false
55
+ helper.breadcrumbs?.should be_falsey
56
56
  end
57
57
  end
58
58
  end
@@ -84,12 +84,20 @@ describe TwitterBreadcrumbsHelper do
84
84
  end.should == "<div>#{html}</div>"
85
85
  end
86
86
  end
87
+
88
+ describe "custom breadcrumbs view" do
89
+ let(:html) { "Custom Breadcrumbs Loaded\n" }
90
+
91
+ it "returns the custom breadcrumbs view content" do
92
+ helper.render_breadcrumbs(partial: 'application/custom_breadcrumbs').should == html
93
+ end
94
+ end
87
95
  end
88
96
 
89
97
  describe "#breadcrumbs?" do
90
98
  it "returns true" do
91
- helper.breadcrumbs?.should be_true
92
- controller.send(:breadcrumbs?).should be_true
99
+ helper.breadcrumbs?.should be_truthy
100
+ controller.send(:breadcrumbs?).should be_truthy
93
101
  end
94
102
  end
95
103
 
@@ -109,9 +117,9 @@ describe TwitterBreadcrumbsHelper do
109
117
 
110
118
  describe "#clear_breadcrumbs" do
111
119
  it "empties all existing breadcrumbs" do
112
- helper.breadcrumbs?.should be_true
120
+ helper.breadcrumbs?.should be_truthy
113
121
  controller.send(:clear_breadcrumbs)
114
- helper.breadcrumbs?.should be_false
122
+ helper.breadcrumbs?.should be_falsey
115
123
  end
116
124
  end
117
125
  end
@@ -131,8 +139,8 @@ describe TwitterBreadcrumbsHelper do
131
139
 
132
140
  describe "#breadcrumbs?" do
133
141
  it "returns false" do
134
- helper.breadcrumbs?.should be_false
135
- controller.send(:breadcrumbs?).should be_false
142
+ helper.breadcrumbs?.should be_falsey
143
+ controller.send(:breadcrumbs?).should be_falsey
136
144
  end
137
145
  end
138
146