role_block_haml 0.1.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.
Files changed (46) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/Rakefile +18 -0
  3. data/lib/role_block_haml/engine.rb +74 -0
  4. data/lib/role_block_haml/version.rb +3 -0
  5. data/lib/role_block_haml.rb +2 -0
  6. data/lib/tasks/role_block_haml_tasks.rake +4 -0
  7. data/spec/dummy/README.rdoc +28 -0
  8. data/spec/dummy/Rakefile +6 -0
  9. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  10. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  11. data/spec/dummy/app/controllers/application_controller.rb +6 -0
  12. data/spec/dummy/app/controllers/welcome_controller.rb +6 -0
  13. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  14. data/spec/dummy/app/views/layouts/application.html.haml +9 -0
  15. data/spec/dummy/app/views/welcome/index.html.haml +14 -0
  16. data/spec/dummy/bin/bundle +3 -0
  17. data/spec/dummy/bin/rails +4 -0
  18. data/spec/dummy/bin/rake +4 -0
  19. data/spec/dummy/config/application.rb +28 -0
  20. data/spec/dummy/config/boot.rb +5 -0
  21. data/spec/dummy/config/database.yml +25 -0
  22. data/spec/dummy/config/environment.rb +5 -0
  23. data/spec/dummy/config/environments/development.rb +29 -0
  24. data/spec/dummy/config/environments/production.rb +80 -0
  25. data/spec/dummy/config/environments/test.rb +36 -0
  26. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  27. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  28. data/spec/dummy/config/initializers/inflections.rb +16 -0
  29. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  30. data/spec/dummy/config/initializers/secret_token.rb +13 -0
  31. data/spec/dummy/config/initializers/session_store.rb +3 -0
  32. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  33. data/spec/dummy/config/locales/en.yml +23 -0
  34. data/spec/dummy/config/routes.rb +3 -0
  35. data/spec/dummy/config.ru +4 -0
  36. data/spec/dummy/db/schema.rb +16 -0
  37. data/spec/dummy/db/test.sqlite3 +0 -0
  38. data/spec/dummy/log/development.log +23 -0
  39. data/spec/dummy/log/test.log +3063 -0
  40. data/spec/dummy/public/404.html +58 -0
  41. data/spec/dummy/public/422.html +58 -0
  42. data/spec/dummy/public/500.html +57 -0
  43. data/spec/dummy/public/favicon.ico +0 -0
  44. data/spec/features/haml_role_block_spec.rb +87 -0
  45. data/spec/spec_helper.rb +13 -0
  46. metadata +225 -0
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/404.html -->
52
+ <div class="dialog">
53
+ <h1>The page you were looking for doesn't exist.</h1>
54
+ <p>You may have mistyped the address or the page may have moved.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/422.html -->
52
+ <div class="dialog">
53
+ <h1>The change you wanted was rejected.</h1>
54
+ <p>Maybe you tried to change something you didn't have access to.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/500.html -->
52
+ <div class="dialog">
53
+ <h1>We're sorry, but something went wrong.</h1>
54
+ </div>
55
+ <p>If you are the application owner check the logs for more information.</p>
56
+ </body>
57
+ </html>
File without changes
@@ -0,0 +1,87 @@
1
+ require 'spec_helper'
2
+
3
+ feature 'haml blocks and roles' do
4
+ before {visit '/'}
5
+
6
+ context 'data role without shortcuts' do
7
+ scenario 'has role' do
8
+ expect(page).to have_xpath '//*[contains(@data-role, "foo")]'
9
+ end
10
+
11
+ scenario 'has double roles' do
12
+ expect(page).to have_xpath '//*[contains(@data-role, "bar")]'
13
+ end
14
+
15
+ scenario 'has second in double roles' do
16
+ expect(page).to have_xpath '//*[contains(@data-role, "baz")]'
17
+ end
18
+
19
+ end
20
+
21
+ context 'data block without shortcuts' do
22
+ scenario 'has block' do
23
+ expect(page).to have_xpath '//*[contains(@data-block, "saz")]'
24
+ end
25
+ scenario 'has double blocks' do
26
+ expect(page).to have_xpath '//*[contains(@data-block, "gaz")]'
27
+ end
28
+ scenario 'has second in double blocks' do
29
+ expect(page).to have_xpath '//*[contains(@data-block, "haz")]'
30
+ end
31
+ end
32
+
33
+ context 'role shortcut' do
34
+ scenario 'has explicit role' do
35
+ expect(page).to have_xpath '//*[contains(@data-role, "single_role")]'
36
+ end
37
+
38
+ scenario 'has explicit double roles' do
39
+ expect(page).to have_xpath '//*[contains(@data-role, "second_role")]'
40
+ end
41
+
42
+ scenario 'has implicit role' do
43
+ expect(page).to have_xpath '//*[contains(@data-role, "single_i_role")]'
44
+ end
45
+
46
+ scenario 'has explicit double roles' do
47
+ expect(page).to have_xpath '//*[contains(@data-role, "second_i_role")]'
48
+ end
49
+ end
50
+
51
+ context 'block shortcut' do
52
+ scenario 'has explicit block' do
53
+ expect(page).to have_xpath '//*[contains(@data-block, "single_block")]'
54
+ end
55
+
56
+ scenario 'has explicit double blocks' do
57
+ expect(page).to have_xpath '//*[contains(@data-block, "dblock")]'
58
+ end
59
+
60
+ scenario 'has implicit block' do
61
+ expect(page).to have_xpath '//*[contains(@data-block, "iblock")]'
62
+ end
63
+
64
+ scenario 'has implicit double blocks' do
65
+ expect(page).to have_xpath '//*[contains(@data-block, "second_impl_block")]'
66
+ end
67
+ end
68
+
69
+ context 'with mixed order' do
70
+ scenario 'and first_role block is visible' do
71
+ expect(page).to have_xpath '//*[contains(@data-block, "second_block")]'
72
+ end
73
+
74
+ scenario 'and first_role role is visible' do
75
+ expect(page).to have_xpath '//*[contains(@data-role, "first_role")]'
76
+ end
77
+
78
+ scenario 'and first_block block is visible' do
79
+ expect(page).to have_xpath '//*[contains(@data-block, "first_block")]'
80
+ end
81
+
82
+ scenario 'and first_block role is visible' do
83
+ expect(page).to have_xpath '//*[contains(@data-role, "second_role")]'
84
+ end
85
+ end
86
+
87
+ end
@@ -0,0 +1,13 @@
1
+ ENV['RAILS_ENV'] ||= 'test'
2
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
3
+ require 'rspec/rails'
4
+ require 'rspec/autorun'
5
+ Rails.backtrace_cleaner.remove_silencers!
6
+ # Load support files
7
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
8
+ RSpec.configure do |config|
9
+ config.mock_with :rspec
10
+ config.use_transactional_fixtures = true
11
+ config.infer_base_class_for_anonymous_controllers = false
12
+ config.order = "random"
13
+ end
metadata ADDED
@@ -0,0 +1,225 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: role_block_haml
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Vladislav Bogomolov
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-03-14 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ prerelease: false
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.2.16
22
+ none: false
23
+ type: :runtime
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ version: 3.2.16
29
+ none: false
30
+ - !ruby/object:Gem::Dependency
31
+ name: haml
32
+ prerelease: false
33
+ requirement: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '3.1'
38
+ none: false
39
+ type: :runtime
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ version: '3.1'
45
+ none: false
46
+ - !ruby/object:Gem::Dependency
47
+ name: sqlite3
48
+ prerelease: false
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ none: false
55
+ type: :development
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ none: false
62
+ - !ruby/object:Gem::Dependency
63
+ name: haml-rails
64
+ prerelease: false
65
+ requirement: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ none: false
71
+ type: :development
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ none: false
78
+ - !ruby/object:Gem::Dependency
79
+ name: rspec-rails
80
+ prerelease: false
81
+ requirement: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ none: false
87
+ type: :development
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ! '>='
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ none: false
94
+ - !ruby/object:Gem::Dependency
95
+ name: capybara
96
+ prerelease: false
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ none: false
103
+ type: :development
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ! '>='
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ none: false
110
+ description: Shortcuts for data-role and data-block (to use with evil-bloks-rails)
111
+ email:
112
+ - vladson4ik@gmail.com
113
+ executables: []
114
+ extensions: []
115
+ extra_rdoc_files: []
116
+ files:
117
+ - lib/role_block_haml/engine.rb
118
+ - lib/role_block_haml/version.rb
119
+ - lib/role_block_haml.rb
120
+ - lib/tasks/role_block_haml_tasks.rake
121
+ - MIT-LICENSE
122
+ - Rakefile
123
+ - spec/dummy/app/assets/javascripts/application.js
124
+ - spec/dummy/app/assets/stylesheets/application.css
125
+ - spec/dummy/app/controllers/application_controller.rb
126
+ - spec/dummy/app/controllers/welcome_controller.rb
127
+ - spec/dummy/app/helpers/application_helper.rb
128
+ - spec/dummy/app/views/layouts/application.html.haml
129
+ - spec/dummy/app/views/welcome/index.html.haml
130
+ - spec/dummy/bin/bundle
131
+ - spec/dummy/bin/rails
132
+ - spec/dummy/bin/rake
133
+ - spec/dummy/config/application.rb
134
+ - spec/dummy/config/boot.rb
135
+ - spec/dummy/config/database.yml
136
+ - spec/dummy/config/environment.rb
137
+ - spec/dummy/config/environments/development.rb
138
+ - spec/dummy/config/environments/production.rb
139
+ - spec/dummy/config/environments/test.rb
140
+ - spec/dummy/config/initializers/backtrace_silencers.rb
141
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
142
+ - spec/dummy/config/initializers/inflections.rb
143
+ - spec/dummy/config/initializers/mime_types.rb
144
+ - spec/dummy/config/initializers/secret_token.rb
145
+ - spec/dummy/config/initializers/session_store.rb
146
+ - spec/dummy/config/initializers/wrap_parameters.rb
147
+ - spec/dummy/config/locales/en.yml
148
+ - spec/dummy/config/routes.rb
149
+ - spec/dummy/config.ru
150
+ - spec/dummy/db/schema.rb
151
+ - spec/dummy/db/test.sqlite3
152
+ - spec/dummy/log/development.log
153
+ - spec/dummy/log/test.log
154
+ - spec/dummy/public/404.html
155
+ - spec/dummy/public/422.html
156
+ - spec/dummy/public/500.html
157
+ - spec/dummy/public/favicon.ico
158
+ - spec/dummy/Rakefile
159
+ - spec/dummy/README.rdoc
160
+ - spec/features/haml_role_block_spec.rb
161
+ - spec/spec_helper.rb
162
+ homepage: https://github.com/vladson/role_block_haml
163
+ licenses: []
164
+ post_install_message:
165
+ rdoc_options: []
166
+ require_paths:
167
+ - lib
168
+ required_ruby_version: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ! '>='
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
173
+ none: false
174
+ required_rubygems_version: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - ! '>='
177
+ - !ruby/object:Gem::Version
178
+ version: '0'
179
+ none: false
180
+ requirements: []
181
+ rubyforge_project:
182
+ rubygems_version: 1.8.24
183
+ signing_key:
184
+ specification_version: 3
185
+ summary: Easy shortcuts for haml
186
+ test_files:
187
+ - spec/dummy/app/assets/javascripts/application.js
188
+ - spec/dummy/app/assets/stylesheets/application.css
189
+ - spec/dummy/app/controllers/application_controller.rb
190
+ - spec/dummy/app/controllers/welcome_controller.rb
191
+ - spec/dummy/app/helpers/application_helper.rb
192
+ - spec/dummy/app/views/layouts/application.html.haml
193
+ - spec/dummy/app/views/welcome/index.html.haml
194
+ - spec/dummy/bin/bundle
195
+ - spec/dummy/bin/rails
196
+ - spec/dummy/bin/rake
197
+ - spec/dummy/config/application.rb
198
+ - spec/dummy/config/boot.rb
199
+ - spec/dummy/config/database.yml
200
+ - spec/dummy/config/environment.rb
201
+ - spec/dummy/config/environments/development.rb
202
+ - spec/dummy/config/environments/production.rb
203
+ - spec/dummy/config/environments/test.rb
204
+ - spec/dummy/config/initializers/backtrace_silencers.rb
205
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
206
+ - spec/dummy/config/initializers/inflections.rb
207
+ - spec/dummy/config/initializers/mime_types.rb
208
+ - spec/dummy/config/initializers/secret_token.rb
209
+ - spec/dummy/config/initializers/session_store.rb
210
+ - spec/dummy/config/initializers/wrap_parameters.rb
211
+ - spec/dummy/config/locales/en.yml
212
+ - spec/dummy/config/routes.rb
213
+ - spec/dummy/config.ru
214
+ - spec/dummy/db/schema.rb
215
+ - spec/dummy/db/test.sqlite3
216
+ - spec/dummy/log/development.log
217
+ - spec/dummy/log/test.log
218
+ - spec/dummy/public/404.html
219
+ - spec/dummy/public/422.html
220
+ - spec/dummy/public/500.html
221
+ - spec/dummy/public/favicon.ico
222
+ - spec/dummy/Rakefile
223
+ - spec/dummy/README.rdoc
224
+ - spec/features/haml_role_block_spec.rb
225
+ - spec/spec_helper.rb