mountain_view 0.12.1 → 0.12.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33fcfa394eae8f14bfd8152171a386dfb6d08a30
4
- data.tar.gz: 4b1b36f5342d042423454729f76adabbd0d8b13d
3
+ metadata.gz: 7b7aca00f1f26c7b7f5a616e3ec468ab0b443357
4
+ data.tar.gz: 4542ed852a96fddcaad467f5c533f565f769719a
5
5
  SHA512:
6
- metadata.gz: 2378227279bf01cd7d93e03832c733d8acb7ad46829c018d9fc868577d93e7f70f4be0dbf4488784754150f8dc35f8028b12f60bb539bff3cef08a4a48e1770c
7
- data.tar.gz: a9d657b18016e52c4b23ab8655950f0e647dd97fa043db9155bc227e5d110de6b11784dc8491e3f00f9e1acadb2f642fe0ea8e6fb3e3594a8ca7e32b9dbcc4bf
6
+ metadata.gz: 91af0bd4bda81680b236ced488f162a50722a0a1336c21c8b85b62bee145a3efd473dc247e9e72910ba19cedf71ec302ce5f582ae78e87c62eed8401d1024781
7
+ data.tar.gz: 50a833870f00e9b491082ed63b77b207967b6edbf5da677c90ce46cefe73b26453a776011b7e16be49094c039a5c5183e35c6f3cbf07270e4bf76882aaea12f4
data/README.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
 
4
4
  [![Build Status](https://travis-ci.org/devnacho/mountain_view.svg?branch=master)](https://travis-ci.org/devnacho/mountain_view)
5
- [![Code Climate](https://codeclimate.com/github/devnacho/mountain_view/badges/gpa.svg)](https://codeclimate.com/github/devnacho/mountain_view)
5
+ [![Code Climate](https://codeclimate.com/github/jgnatch/mountain_view/badges/gpa.svg)](https://codeclimate.com/github/jgnatch/mountain_view)
6
+
6
7
 
7
8
  With Mountain View you create reusable components for your Rails frontend, while generating a living style guide.
8
9
 
@@ -160,7 +161,6 @@ For SASS mixins, variables, functions, etc (anything that doesn't generate
160
161
  code), you'd need to explicitly do and `@import` in each component stylesheet.
161
162
  As that doesn't generate extra CSS this won't cause any issues with the
162
163
  generated CSS, you're only giving that stylesheet access to those definitions.
163
- =======
164
164
 
165
165
 
166
166
  ### Adding extra pages to the styleguide
@@ -2,6 +2,8 @@ module MountainView
2
2
  class StyleguideController < ::ApplicationController
3
3
  layout "mountain_view"
4
4
 
5
+ helper "mountain_view/styleguide"
6
+
5
7
  def show
6
8
  @component = MountainView::Component.new(params[:id])
7
9
  end
@@ -1,5 +1,29 @@
1
1
  module MountainView
2
2
  module StyleguideHelper
3
+ def method_missing(method, *args, &block)
4
+ if method.to_s.end_with?("_path") || method.to_s.end_with?("_url")
5
+ if main_app.respond_to?(method)
6
+ main_app.send(method, *args)
7
+ else
8
+ super
9
+ end
10
+ else
11
+ super
12
+ end
13
+ end
14
+
15
+ def respond_to?(method, include_all = false)
16
+ if method.to_s.end_with?("_path") || method.to_s.end_with?("_url")
17
+ if main_app.respond_to?(method, include_all)
18
+ true
19
+ else
20
+ super
21
+ end
22
+ else
23
+ super
24
+ end
25
+ end
26
+
3
27
  def prettify_word(word)
4
28
  word.to_s.split("_").map(&:capitalize).join(" ")
5
29
  end
@@ -10,5 +34,9 @@ module MountainView
10
34
  MountainView::Component.new File.basename(component_dir)
11
35
  end
12
36
  end
37
+
38
+ def extra_pages
39
+ MountainView.configuration.extra_pages
40
+ end
13
41
  end
14
42
  end
@@ -31,7 +31,6 @@ module MountainView
31
31
 
32
32
  initializer "mountain_view.add_helpers" do
33
33
  ActiveSupport.on_load :action_controller do
34
- ::ActionController::Base.helper MountainView::ApplicationHelper
35
34
  ::ActionController::Base.helper MountainView::ComponentHelper
36
35
  end
37
36
  end
@@ -1,3 +1,3 @@
1
1
  module MountainView
2
- VERSION = "0.12.1".freeze
2
+ VERSION = "0.12.2".freeze
3
3
  end
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.12.1
4
+ version: 0.12.2
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-07-01 00:00:00.000000000 Z
12
+ date: 2017-08-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -59,7 +59,6 @@ files:
59
59
  - app/assets/stylesheets/mountain_view/styleguide.css
60
60
  - app/controllers/mountain_view/extra_pages_controller.rb
61
61
  - app/controllers/mountain_view/styleguide_controller.rb
62
- - app/helpers/mountain_view/application_helper.rb
63
62
  - app/helpers/mountain_view/component_helper.rb
64
63
  - app/helpers/mountain_view/styleguide_helper.rb
65
64
  - app/views/layouts/mountain_view.html.erb
@@ -1,31 +0,0 @@
1
- module MountainView
2
- module ApplicationHelper
3
- def method_missing(method, *args, &block)
4
- if method.to_s.end_with?("_path") || method.to_s.end_with?("_url")
5
- if main_app.respond_to?(method)
6
- main_app.send(method, *args)
7
- else
8
- super
9
- end
10
- else
11
- super
12
- end
13
- end
14
-
15
- def respond_to?(method, include_all = false)
16
- if method.to_s.end_with?("_path") || method.to_s.end_with?("_url")
17
- if main_app.respond_to?(method, include_all)
18
- true
19
- else
20
- super
21
- end
22
- else
23
- super
24
- end
25
- end
26
-
27
- def extra_pages
28
- MountainView.configuration.extra_pages
29
- end
30
- end
31
- end