styledown2-rails 2.0.0.pre7 → 2.0.0.pre9

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: 4343bab33f25e029e454b9ddbdda7057ee1068af
4
- data.tar.gz: b8a611efae64dead80908ba6fa15c1ebb8d1863f
3
+ metadata.gz: 06ba67444ac0ab006d97483b272b4dce0d293483
4
+ data.tar.gz: 4377e0ad6da9afb78bee6e0a1bd15260c5c454d6
5
5
  SHA512:
6
- metadata.gz: 1ccb77f2ce623ff92b6887050dd30e5054b55afb85ed2312a98c8573b43d79749679a2d49f2dfd2d5b4b035b2f0a4f0d534616e132b5dbc38ac92bf46532e2b4
7
- data.tar.gz: 416fe56b23177a4e6fdfca35ad4248fede36ab8f8e58b530b409864a5e9b4ab50b2133b63e3f4cb95495e8dbf077afb9781e7d07b4feb3014611034196e1b1e1
6
+ metadata.gz: 3a628cbba5ccc21aeea4e01c53336eafd31575cd9497af9fa3519ad853ae0b9953d3aaa137788937aa2538647ae2378252cc81d684b81a469458827c21cd8391
7
+ data.tar.gz: 37d67135b5d1541d8e054ce0be2f1e84fb4560cbeee69b15b7ed72bbad6b26764436b79bc4f8d4a5fa43a054efa9a68859b8290449a6ad18f07c5fe73fe63703
@@ -28,6 +28,7 @@ class Styledown
28
28
  # Styleguides
29
29
  template 'index.md', 'docs/styleguides/index.md'
30
30
  template 'buttons.md', 'docs/styleguides/buttons.md'
31
+ template 'forms.md', 'docs/styleguides/forms.md'
31
32
  template 'README.md', 'docs/styleguides/README.md'
32
33
  end
33
34
  end
@@ -1,3 +1,4 @@
1
+ require 'styledown'
1
2
  require 'styledown/rails/controller'
2
3
  require 'styledown/rails/controller_integration'
3
4
  require 'styledown/rails/version'
@@ -56,7 +56,10 @@ class Styledown
56
56
  reload
57
57
  file = instance.output[page]
58
58
 
59
- raise ActiveRecord::RecordNotFound unless file
59
+ unless file
60
+ raise ActionController::RoutingError,
61
+ "No file '#{page}' in styleguides"
62
+ end
60
63
  controller.render body: file['contents'], content_type: file['type']
61
64
  end
62
65
 
@@ -114,9 +117,12 @@ class Styledown
114
117
  # Don't use request.path, because that will always be missing a trailing slash.
115
118
  path = controller.request.env['REQUEST_PATH']
116
119
 
120
+ # Rack::Test doesn't seem to set REQUEST_PATH
121
+ path ||= controller.request.env['REQUEST_URI']
122
+
117
123
  # Check if there's no page and no trailing slash (eg, /styleguides and not
118
124
  # /styleguides/ or /styleguides/foo)
119
- if !controller.params[:page] && path[-1] != '/'
125
+ if !controller.params[:page] && path && path[-1] != '/'
120
126
  controller.redirect_to "#{path}/"
121
127
  true
122
128
  end
@@ -1,5 +1,5 @@
1
1
  class Styledown
2
2
  module Rails
3
- VERSION = '2.0.0.pre7'
3
+ VERSION = '2.0.0.pre9'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: styledown2-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre7
4
+ version: 2.0.0.pre9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rico Sta. Cruz