mountain_view 0.11.0 → 0.12.0
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.
- checksums.yaml +4 -4
- data/README.md +22 -3
- data/app/controllers/mountain_view/extra_pages_controller.rb +11 -0
- data/app/helpers/mountain_view/application_helper.rb +4 -0
- data/app/helpers/mountain_view/styleguide_helper.rb +4 -0
- data/app/views/layouts/mountain_view.html.erb +10 -0
- data/config/routes.rb +7 -0
- data/lib/generators/mountain_view/component_generator.rb +4 -20
- data/lib/generators/mountain_view/extra_pages_generator.rb +20 -0
- data/lib/generators/mountain_view/mountain_view_generator_base.rb +31 -0
- data/lib/mountain_view/configuration.rb +2 -0
- data/lib/mountain_view/version.rb +1 -1
- data/test/dummy/app/views/layouts/application.html.erb +0 -2
- data/test/dummy/app/views/mountain_view/extra_pages/code_style.html.erb +0 -0
- data/test/dummy/app/views/mountain_view/extra_pages/grid.html.erb +1 -0
- data/test/dummy/config/initializers/mountain_view.rb +1 -0
- data/test/dummy/log/test.log +167 -0
- data/test/generators/extra_pages_generator_test.rb +23 -0
- data/test/test_helper.rb +1 -0
- metadata +11 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 15f33c63263b41389c39e9084c63007a8312307b
|
|
4
|
+
data.tar.gz: 16f99753bd173370de472a63f771e56a3cabaed4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b1215573a1bb3e96345b7267067a074992078bf2aab0d11fbc098b56bfa8abc55d6c88f7b80a18e861902e4d5d0ed02eba8b85b8cf218e03ab0d96d84c958ec1
|
|
7
|
+
data.tar.gz: 67b571c9369e9bd9d01e5ff87b05746e070c3f193843e5c62650d6d7842e31cbd4eb973a193f4c6d988a5ac63832eaf1b856ef8677ae644d246b763ecec2d3f0
|
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://travis-ci.org/devnacho/mountain_view)
|
|
5
5
|
[](https://codeclimate.com/github/devnacho/mountain_view)
|
|
6
6
|
|
|
7
|
-
With Mountain View you create reusable components for your Rails frontend, while generating a living style guide.
|
|
7
|
+
With Mountain View you create reusable components for your Rails frontend, while generating a living style guide.
|
|
8
8
|
|
|
9
9
|
**FAQ**
|
|
10
10
|
|
|
@@ -95,8 +95,8 @@ end
|
|
|
95
95
|
|
|
96
96
|
Including a component class is optional, but it helps avoid polluting your
|
|
97
97
|
views and helpers with presenter logic. Public methods in your component class
|
|
98
|
-
will be made available to the view, along with any properties you define.
|
|
99
|
-
You can also access all properties using the `properties` method in your
|
|
98
|
+
will be made available to the view, along with any properties you define.
|
|
99
|
+
You can also access all properties using the `properties` method in your
|
|
100
100
|
component class and views. You can even define property defaults.
|
|
101
101
|
|
|
102
102
|
### Using components on your views
|
|
@@ -160,6 +160,25 @@ For SASS mixins, variables, functions, etc (anything that doesn't generate
|
|
|
160
160
|
code), you'd need to explicitly do and `@import` in each component stylesheet.
|
|
161
161
|
As that doesn't generate extra CSS this won't cause any issues with the
|
|
162
162
|
generated CSS, you're only giving that stylesheet access to those definitions.
|
|
163
|
+
=======
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
### Adding extra pages to the styleguide
|
|
167
|
+
In case you want to add additional pages to the styleguide (e.g grid, code_style) to your living style guide, you can do it by generating them in an initializer
|
|
168
|
+
|
|
169
|
+
```ruby
|
|
170
|
+
MountainView.configure do |config|
|
|
171
|
+
config.extra_pages = [:grid, :code_style]
|
|
172
|
+
end
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
This will generate the routes and conventional links to the style guide.
|
|
176
|
+
|
|
177
|
+
To add the views to handle the request.
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
rails generate mountain_view:extra_pages
|
|
181
|
+
```
|
|
163
182
|
|
|
164
183
|
## Automatically generated Style Guide
|
|
165
184
|
A style guide will be automatically generated. This style guide never falls behind and it reflects your components in their latest version.
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
module MountainView
|
|
2
2
|
module StyleguideHelper
|
|
3
|
+
def prettify_word(word)
|
|
4
|
+
word.to_s.split("_").map(&:capitalize).join(" ")
|
|
5
|
+
end
|
|
6
|
+
|
|
3
7
|
def mv_components
|
|
4
8
|
component_dirs = MountainView.configuration.components_path.join("*")
|
|
5
9
|
Dir.glob(component_dirs).map do |component_dir|
|
|
@@ -13,6 +13,16 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
<div class="mv-flex-wrapper">
|
|
15
15
|
<div class="mv-sidebar">
|
|
16
|
+
<% if extra_pages.any? %>
|
|
17
|
+
<h3>EXTRA PAGES</h3>
|
|
18
|
+
<ul>
|
|
19
|
+
<%- extra_pages.each do |extra_page| %>
|
|
20
|
+
<li>
|
|
21
|
+
<%= link_to prettify_word(extra_page), extra_pages_path(extra_page) %>
|
|
22
|
+
</li>
|
|
23
|
+
<% end %>
|
|
24
|
+
</ul>
|
|
25
|
+
<% end %>
|
|
16
26
|
<h3>COMPONENTS</h3>
|
|
17
27
|
<ul>
|
|
18
28
|
<%- mv_components.each do |component| %>
|
data/config/routes.rb
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
MountainView::Engine.routes.draw do
|
|
2
2
|
root to: "styleguide#index"
|
|
3
3
|
|
|
4
|
+
def extra_routes
|
|
5
|
+
get "extra_pages/:page",
|
|
6
|
+
to: "extra_pages#show",
|
|
7
|
+
as: "extra_pages"
|
|
8
|
+
end
|
|
9
|
+
|
|
4
10
|
resources :styleguide, only: [:index, :show], path: MountainView.configuration.styleguide_path
|
|
11
|
+
extra_routes if MountainView.configuration.extra_pages.any?
|
|
5
12
|
end
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "./mountain_view_generator_base"
|
|
2
4
|
|
|
3
5
|
module MountainView
|
|
4
6
|
module Generators
|
|
5
|
-
class ComponentGenerator <
|
|
7
|
+
class ComponentGenerator < MountainViewGeneratorBase
|
|
6
8
|
desc "Generates all files needed for a component"
|
|
7
9
|
|
|
8
10
|
argument :component, required: true,
|
|
@@ -23,24 +25,6 @@ module MountainView
|
|
|
23
25
|
def create_stubs_file
|
|
24
26
|
create_file "app/components/#{component}/#{component}.yml"
|
|
25
27
|
end
|
|
26
|
-
|
|
27
|
-
private
|
|
28
|
-
|
|
29
|
-
def template_engine
|
|
30
|
-
app_generators[:template_engine] || "erb"
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def stylesheet_engine
|
|
34
|
-
app_generators[:stylesheet_engine] || "css"
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def javascript_engine
|
|
38
|
-
app_generators[:javascript_engine] || "js"
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def app_generators
|
|
42
|
-
Rails.application.config.generators.rails
|
|
43
|
-
end
|
|
44
28
|
end
|
|
45
29
|
end
|
|
46
30
|
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "./mountain_view_generator_base"
|
|
4
|
+
|
|
5
|
+
module MountainView
|
|
6
|
+
module Generators
|
|
7
|
+
class ExtraPagesGenerator < MountainViewGeneratorBase
|
|
8
|
+
desc "Generates extra pages and routes"
|
|
9
|
+
|
|
10
|
+
def create_extra_pages_views
|
|
11
|
+
views_folder = "app/views/mountain_view/extra_pages"
|
|
12
|
+
extra_pages.each do |page|
|
|
13
|
+
file_name = "#{views_folder}/#{page}.html.#{template_engine}"
|
|
14
|
+
next if File.exist?(file_name)
|
|
15
|
+
create_file file_name
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rails/generators/base"
|
|
4
|
+
|
|
5
|
+
module MountainView
|
|
6
|
+
module Generators
|
|
7
|
+
class MountainViewGeneratorBase < Rails::Generators::Base
|
|
8
|
+
private
|
|
9
|
+
|
|
10
|
+
def template_engine
|
|
11
|
+
app_generators[:template_engine] || "erb"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def stylesheet_engine
|
|
15
|
+
app_generators[:stylesheet_engine] || "css"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def javascript_engine
|
|
19
|
+
app_generators[:javascript_engine] || "js"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def app_generators
|
|
23
|
+
Rails.application.config.generators.rails
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def extra_pages
|
|
27
|
+
MountainView.configuration.extra_pages
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -2,10 +2,12 @@ module MountainView
|
|
|
2
2
|
class Configuration
|
|
3
3
|
attr_accessor :included_stylesheets
|
|
4
4
|
attr_accessor :styleguide_path
|
|
5
|
+
attr_accessor :extra_pages
|
|
5
6
|
attr_reader :components_path
|
|
6
7
|
|
|
7
8
|
def initialize
|
|
8
9
|
@included_stylesheets = []
|
|
10
|
+
@extra_pages = []
|
|
9
11
|
end
|
|
10
12
|
|
|
11
13
|
def components_path=(path)
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<h1>Hello</h1>
|
data/test/dummy/log/test.log
CHANGED
|
@@ -148,3 +148,170 @@ MountainView::PresenterTest: test_inherited_presenter_responds_to_#data
|
|
|
148
148
|
------------------------------------------------------------------
|
|
149
149
|
MountainView::PresenterTest: test_returns_the_correct_partial_path
|
|
150
150
|
------------------------------------------------------------------
|
|
151
|
+
------------------------------------------------------------------
|
|
152
|
+
ComponentGeneratorTest: test_Assert_all_files_are_properly_created
|
|
153
|
+
------------------------------------------------------------------
|
|
154
|
+
--------------------------------------------------------
|
|
155
|
+
ComponentGeneratorTest: test_Generates_different_engines
|
|
156
|
+
--------------------------------------------------------
|
|
157
|
+
-------------------------------------------------
|
|
158
|
+
MountainViewComponentTest: test_stubs_extra_info?
|
|
159
|
+
-------------------------------------------------
|
|
160
|
+
-----------------------------------------------------
|
|
161
|
+
MountainViewComponentTest: test_stubs_correct_format?
|
|
162
|
+
-----------------------------------------------------
|
|
163
|
+
------------------------------------------------
|
|
164
|
+
MountainViewComponentTest: test_stubs_extra_info
|
|
165
|
+
------------------------------------------------
|
|
166
|
+
------------------------------------------------
|
|
167
|
+
MountainViewComponentTest: test_component_stubs?
|
|
168
|
+
------------------------------------------------
|
|
169
|
+
------------------------------------------
|
|
170
|
+
MountainViewComponentTest: test_stubs_file
|
|
171
|
+
------------------------------------------
|
|
172
|
+
-----------------------------------------------
|
|
173
|
+
MountainViewComponentTest: test_component_stubs
|
|
174
|
+
-----------------------------------------------
|
|
175
|
+
------------------------------------
|
|
176
|
+
MountainViewComponentTest: test_name
|
|
177
|
+
------------------------------------
|
|
178
|
+
--------------------------------------
|
|
179
|
+
MountainViewComponentTest: test_stubs?
|
|
180
|
+
--------------------------------------
|
|
181
|
+
------------------------------------------------
|
|
182
|
+
MountainViewComponentTest: test_styleguide_stubs
|
|
183
|
+
------------------------------------------------
|
|
184
|
+
-----------------------------------------------
|
|
185
|
+
MountainViewComponentTest: test_humanized_title
|
|
186
|
+
-----------------------------------------------
|
|
187
|
+
-------------------------------------------------------------------
|
|
188
|
+
MountainViewConfigurationTest: test_set_custom_included_stylesheets
|
|
189
|
+
-------------------------------------------------------------------
|
|
190
|
+
--------------------------------------------------------------------------------------------
|
|
191
|
+
MountainViewConfigurationTest: test_default_value_for_included_stylesheets_is_an_empty_array
|
|
192
|
+
--------------------------------------------------------------------------------------------
|
|
193
|
+
----------------------------------------------------------------------------
|
|
194
|
+
MountainViewConfigurationTest: test_default_value_for_styleguide_path_is_nil
|
|
195
|
+
----------------------------------------------------------------------------
|
|
196
|
+
--------------------------------------------------------------
|
|
197
|
+
MountainViewConfigurationTest: test_set_custom_styleguide_path
|
|
198
|
+
--------------------------------------------------------------
|
|
199
|
+
---------------------------------------
|
|
200
|
+
MountainViewTest: test_engine_is_loaded
|
|
201
|
+
---------------------------------------
|
|
202
|
+
-------------------------------------------------------------
|
|
203
|
+
MountainViewTest: test_global_stylesheets_are_properly_served
|
|
204
|
+
-------------------------------------------------------------
|
|
205
|
+
Started GET "/assets/mountain_view.css" for 127.0.0.1 at 2017-05-09 18:04:16 +0200
|
|
206
|
+
MountainView: stylesheet not found for component 'paragraph'
|
|
207
|
+
-----------------------------------------------------------------------------------
|
|
208
|
+
MountainViewTest: test_shows_a_hint_message_if_the_component_stub_file_is_not_found
|
|
209
|
+
-----------------------------------------------------------------------------------
|
|
210
|
+
Started GET "/mountain_view/styleguide/something" for 127.0.0.1 at 2017-05-09 18:04:16 +0200
|
|
211
|
+
Processing by MountainView::StyleguideController#show as HTML
|
|
212
|
+
Parameters: {"id"=>"something"}
|
|
213
|
+
Rendered /Users/kito/dev/mountain_view/app/views/mountain_view/styleguide/_example.html.erb (0.5ms)
|
|
214
|
+
Rendered /Users/kito/dev/mountain_view/app/views/mountain_view/styleguide/show.html.erb within layouts/mountain_view (9.6ms)
|
|
215
|
+
MountainView: javascript not found for component 'paragraph'
|
|
216
|
+
Completed 200 OK in 92ms (Views: 91.2ms)
|
|
217
|
+
-----------------------------------------------------------------------------
|
|
218
|
+
MountainViewTest: test_shows_specific_component_that_uses_a_main_app_url_okay
|
|
219
|
+
-----------------------------------------------------------------------------
|
|
220
|
+
Started GET "/mountain_view/styleguide/header" for 127.0.0.1 at 2017-05-09 18:04:16 +0200
|
|
221
|
+
Processing by MountainView::StyleguideController#show as HTML
|
|
222
|
+
Parameters: {"id"=>"header"}
|
|
223
|
+
Rendered app/components/header/_header.html.erb (2.2ms)
|
|
224
|
+
Rendered app/components/header/_header.html.erb (0.2ms)
|
|
225
|
+
Rendered /Users/kito/dev/mountain_view/app/views/mountain_view/styleguide/show.html.erb within layouts/mountain_view (14.4ms)
|
|
226
|
+
Completed 200 OK in 18ms (Views: 17.7ms)
|
|
227
|
+
---------------------------------------
|
|
228
|
+
MountainViewTest: test_shows_styleguide
|
|
229
|
+
---------------------------------------
|
|
230
|
+
Started GET "/mountain_view" for 127.0.0.1 at 2017-05-09 18:04:16 +0200
|
|
231
|
+
Processing by MountainView::StyleguideController#index as HTML
|
|
232
|
+
Rendered /Users/kito/dev/mountain_view/app/views/mountain_view/styleguide/index.html.erb within layouts/mountain_view (0.6ms)
|
|
233
|
+
Completed 200 OK in 5ms (Views: 4.4ms)
|
|
234
|
+
------------------------------------------------------
|
|
235
|
+
MountainViewTest: test_stylesheets_are_properly_served
|
|
236
|
+
------------------------------------------------------
|
|
237
|
+
Started GET "/assets/mountain_view.css" for 127.0.0.1 at 2017-05-09 18:04:16 +0200
|
|
238
|
+
------------------------------------------------------
|
|
239
|
+
MountainViewTest: test_javascripts_are_properly_served
|
|
240
|
+
------------------------------------------------------
|
|
241
|
+
Started GET "/assets/mountain_view.js" for 127.0.0.1 at 2017-05-09 18:04:16 +0200
|
|
242
|
+
-----------------------------------------------
|
|
243
|
+
MountainViewTest: test_shows_specific_component
|
|
244
|
+
-----------------------------------------------
|
|
245
|
+
Started GET "/mountain_view/styleguide/header" for 127.0.0.1 at 2017-05-09 18:04:16 +0200
|
|
246
|
+
Processing by MountainView::StyleguideController#show as HTML
|
|
247
|
+
Parameters: {"id"=>"header"}
|
|
248
|
+
Rendered app/components/header/_header.html.erb (0.3ms)
|
|
249
|
+
Rendered app/components/header/_header.html.erb (0.2ms)
|
|
250
|
+
Rendered /Users/kito/dev/mountain_view/app/views/mountain_view/styleguide/show.html.erb within layouts/mountain_view (9.0ms)
|
|
251
|
+
Completed 200 OK in 11ms (Views: 11.2ms)
|
|
252
|
+
-------------------------------------------------------------------------------
|
|
253
|
+
MountainViewTest: test_shows_a_hint_message_if_the_component_stub_file_is_empty
|
|
254
|
+
-------------------------------------------------------------------------------
|
|
255
|
+
Started GET "/mountain_view/styleguide/breadcrumbs" for 127.0.0.1 at 2017-05-09 18:04:16 +0200
|
|
256
|
+
Processing by MountainView::StyleguideController#show as HTML
|
|
257
|
+
Parameters: {"id"=>"breadcrumbs"}
|
|
258
|
+
Rendered /Users/kito/dev/mountain_view/app/views/mountain_view/styleguide/_example.html.erb (0.1ms)
|
|
259
|
+
Rendered /Users/kito/dev/mountain_view/app/views/mountain_view/styleguide/show.html.erb within layouts/mountain_view (0.7ms)
|
|
260
|
+
Completed 200 OK in 3ms (Views: 2.9ms)
|
|
261
|
+
-------------------------------------------------------------------------------
|
|
262
|
+
MountainView::ComponentHelperTest: test_renders_a_component_within_a_compontent
|
|
263
|
+
-------------------------------------------------------------------------------
|
|
264
|
+
Rendered app/components/header/_header.html.erb (1.9ms)
|
|
265
|
+
Rendered app/components/yielder/_yielder.html.erb (0.5ms)
|
|
266
|
+
------------------------------------------------------------------------------------------
|
|
267
|
+
MountainView::ComponentHelperTest: test_Does_not_override_passed_yield_property_with_block
|
|
268
|
+
------------------------------------------------------------------------------------------
|
|
269
|
+
Rendered app/components/yielder/_yielder.html.erb (0.1ms)
|
|
270
|
+
--------------------------------------------------------------------
|
|
271
|
+
MountainView::ComponentHelperTest: test_renders_the_proper_component
|
|
272
|
+
--------------------------------------------------------------------
|
|
273
|
+
Rendered app/components/header/_header.html.erb (0.2ms)
|
|
274
|
+
-------------------------------------------------------------------
|
|
275
|
+
MountainView::ComponentHelperTest: test_renders_when_passed_a_block
|
|
276
|
+
-------------------------------------------------------------------
|
|
277
|
+
Rendered app/components/yielder/_yielder.html.erb (0.1ms)
|
|
278
|
+
-------------------------------------------------------------------------------------
|
|
279
|
+
MountainView::ComponentHelperTest: test_renders_when_has_a_yield,_but_no_block_passed
|
|
280
|
+
-------------------------------------------------------------------------------------
|
|
281
|
+
Rendered app/components/yielder/_yielder.html.erb (0.1ms)
|
|
282
|
+
-------------------------------------------------------------------------------
|
|
283
|
+
MountainView::PresenterTest: test_inherited_presenter_returns_the_correct_title
|
|
284
|
+
-------------------------------------------------------------------------------
|
|
285
|
+
-----------------------------------------------------------------------------------------
|
|
286
|
+
MountainView::PresenterTest: test_inherited_presenter_returns_the_default_value_for_#data
|
|
287
|
+
-----------------------------------------------------------------------------------------
|
|
288
|
+
-----------------------------------------------------------------------
|
|
289
|
+
MountainView::PresenterTest: test_inherited_presenter_responds_to_#data
|
|
290
|
+
-----------------------------------------------------------------------
|
|
291
|
+
------------------------------------------------------------------
|
|
292
|
+
MountainView::PresenterTest: test_returns_the_correct_partial_path
|
|
293
|
+
------------------------------------------------------------------
|
|
294
|
+
----------------------------------------------------------------
|
|
295
|
+
MountainView::PresenterTest: test_exposes_properties_as_provided
|
|
296
|
+
----------------------------------------------------------------
|
|
297
|
+
-------------------------------------------------------------------------
|
|
298
|
+
MountedEngineTest: test_Custom_path_can_be_applied_to_styleguide_resource
|
|
299
|
+
-------------------------------------------------------------------------
|
|
300
|
+
Started GET "/mountain_view/style-guide" for 127.0.0.1 at 2017-05-09 18:04:16 +0200
|
|
301
|
+
Processing by MountainView::StyleguideController#index as HTML
|
|
302
|
+
Rendered /Users/kito/dev/mountain_view/app/views/mountain_view/styleguide/index.html.erb within layouts/mountain_view (0.4ms)
|
|
303
|
+
Completed 200 OK in 3ms (Views: 3.3ms)
|
|
304
|
+
-----------------------------------------------------
|
|
305
|
+
MountedEngineTest: test_Has_been_mounted_successfully
|
|
306
|
+
-----------------------------------------------------
|
|
307
|
+
Started GET "/mountain_view" for 127.0.0.1 at 2017-05-09 18:04:16 +0200
|
|
308
|
+
Processing by MountainView::StyleguideController#index as HTML
|
|
309
|
+
Rendered /Users/kito/dev/mountain_view/app/views/mountain_view/styleguide/index.html.erb within layouts/mountain_view (0.3ms)
|
|
310
|
+
Completed 200 OK in 3ms (Views: 3.1ms)
|
|
311
|
+
------------------------------------------------
|
|
312
|
+
MountedEngineTest: test_Has_the_styleguide_route
|
|
313
|
+
------------------------------------------------
|
|
314
|
+
Started GET "/mountain_view/styleguide" for 127.0.0.1 at 2017-05-09 18:04:16 +0200
|
|
315
|
+
Processing by MountainView::StyleguideController#index as HTML
|
|
316
|
+
Rendered /Users/kito/dev/mountain_view/app/views/mountain_view/styleguide/index.html.erb within layouts/mountain_view (0.3ms)
|
|
317
|
+
Completed 200 OK in 3ms (Views: 2.6ms)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
|
|
5
|
+
class ExtraPagesGeneratorTest < Rails::Generators::TestCase
|
|
6
|
+
tests MountainView::Generators::ExtraPagesGenerator
|
|
7
|
+
|
|
8
|
+
destination File.expand_path("../../tmp", __FILE__)
|
|
9
|
+
setup :prepare_destination
|
|
10
|
+
|
|
11
|
+
test "Assert all views and controller are created" do
|
|
12
|
+
# reset templates
|
|
13
|
+
Rails.application.config.app_generators.template_engine nil
|
|
14
|
+
Rails.application.config.app_generators.stylesheet_engine nil
|
|
15
|
+
|
|
16
|
+
MountainView.configuration.extra_pages = %I(grid style_status)
|
|
17
|
+
run_generator
|
|
18
|
+
|
|
19
|
+
MountainView.configuration.extra_pages.each do |page|
|
|
20
|
+
assert_file "app/views/mountain_view/extra_pages/#{page}.html.erb"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mountain_view
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.12.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ignacio Gutierrez
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2017-
|
|
12
|
+
date: 2017-06-13 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|
|
@@ -57,6 +57,7 @@ files:
|
|
|
57
57
|
- app/assets/stylesheets/mountain_view.css.erb
|
|
58
58
|
- app/assets/stylesheets/mountain_view/prism.css
|
|
59
59
|
- app/assets/stylesheets/mountain_view/styleguide.css
|
|
60
|
+
- app/controllers/mountain_view/extra_pages_controller.rb
|
|
60
61
|
- app/controllers/mountain_view/styleguide_controller.rb
|
|
61
62
|
- app/helpers/mountain_view/application_helper.rb
|
|
62
63
|
- app/helpers/mountain_view/component_helper.rb
|
|
@@ -67,6 +68,8 @@ files:
|
|
|
67
68
|
- app/views/mountain_view/styleguide/show.html.erb
|
|
68
69
|
- config/routes.rb
|
|
69
70
|
- lib/generators/mountain_view/component_generator.rb
|
|
71
|
+
- lib/generators/mountain_view/extra_pages_generator.rb
|
|
72
|
+
- lib/generators/mountain_view/mountain_view_generator_base.rb
|
|
70
73
|
- lib/mountain_view.rb
|
|
71
74
|
- lib/mountain_view/component.rb
|
|
72
75
|
- lib/mountain_view/configuration.rb
|
|
@@ -102,6 +105,8 @@ files:
|
|
|
102
105
|
- test/dummy/app/helpers/application_helper.rb
|
|
103
106
|
- test/dummy/app/views/home/index.html.erb
|
|
104
107
|
- test/dummy/app/views/layouts/application.html.erb
|
|
108
|
+
- test/dummy/app/views/mountain_view/extra_pages/code_style.html.erb
|
|
109
|
+
- test/dummy/app/views/mountain_view/extra_pages/grid.html.erb
|
|
105
110
|
- test/dummy/bin/bundle
|
|
106
111
|
- test/dummy/bin/rails
|
|
107
112
|
- test/dummy/bin/rake
|
|
@@ -132,6 +137,7 @@ files:
|
|
|
132
137
|
- test/dummy/public/500.html
|
|
133
138
|
- test/dummy/public/favicon.ico
|
|
134
139
|
- test/generators/component_generator_test.rb
|
|
140
|
+
- test/generators/extra_pages_generator_test.rb
|
|
135
141
|
- test/helpers/mountain_view/component_helper_test.rb
|
|
136
142
|
- test/integration/mounted_engine_test.rb
|
|
137
143
|
- test/mountain_view/component_test.rb
|
|
@@ -194,6 +200,8 @@ test_files:
|
|
|
194
200
|
- test/dummy/app/helpers/application_helper.rb
|
|
195
201
|
- test/dummy/app/views/home/index.html.erb
|
|
196
202
|
- test/dummy/app/views/layouts/application.html.erb
|
|
203
|
+
- test/dummy/app/views/mountain_view/extra_pages/code_style.html.erb
|
|
204
|
+
- test/dummy/app/views/mountain_view/extra_pages/grid.html.erb
|
|
197
205
|
- test/dummy/bin/bundle
|
|
198
206
|
- test/dummy/bin/rails
|
|
199
207
|
- test/dummy/bin/rake
|
|
@@ -226,6 +234,7 @@ test_files:
|
|
|
226
234
|
- test/dummy/Rakefile
|
|
227
235
|
- test/dummy/README.rdoc
|
|
228
236
|
- test/generators/component_generator_test.rb
|
|
237
|
+
- test/generators/extra_pages_generator_test.rb
|
|
229
238
|
- test/helpers/mountain_view/component_helper_test.rb
|
|
230
239
|
- test/integration/mounted_engine_test.rb
|
|
231
240
|
- test/mountain_view/component_test.rb
|