high_voltage 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NWVlZTI0NjBiNWVhZTlhNzhkOWNiMzdiYTg3ZDBiYmFkM2M0NGJlZQ==
5
+ data.tar.gz: !binary |-
6
+ Y2YwZGEzMmI5ZGRkOGQ1MjYyMGU2ZDE0ZjFjYTJmNTM0ODllNGYwMw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ MWFlZGU0YzFmOWE5Yzk0NDFhZmU4ZjhiODNlMjAxN2M5MzNjNTU2MWEyMDhi
10
+ ZThiNDlkNGFlYzBiMGYwMzU1MzNjYmQ4OTNkODBjYjg0OTI5YjQyZTQ4OTQz
11
+ Y2E5MGIwZDFhMjhhYWQyNTBiMzZhODIyZDlmZmY3MTFmYzNiMWE=
12
+ data.tar.gz: !binary |-
13
+ YjExZjI0Mzc2NTI5ZTJmNjc4OTdhZWZmZmY2Y2EwZTgxOTBkMDQyZDBmNTky
14
+ YmQ2NzA0NmJhM2Q3OTJhNDA1YTdjMjllYjQ1MTA5YjhhYjdjOGY5NTM4YjFk
15
+ MzEzYjIzMzdiOTcyYmMzZWFjNTRmYTRkZDk3ODA1ZWYyNjc0MzQ=
@@ -4,6 +4,10 @@ rvm:
4
4
  - 1.9.2
5
5
  - 1.9.3
6
6
  gemfile:
7
- - gemfiles/rails_3.0.18.gemfile
8
- - gemfiles/rails_3.1.9.gemfile
9
- - gemfiles/rails_3.2.10.gemfile
7
+ - gemfiles/rails_3.0.20.gemfile
8
+ - gemfiles/rails_3.1.12.gemfile
9
+ - gemfiles/rails_3.2.13.gemfile
10
+ - gemfiles/rails_4.0.0.rc1.gemfile
11
+ matrix:
12
+ allow_failures:
13
+ - gemfile: gemfiles/rails_4.0.0.rc1.gemfile
data/Appraisals CHANGED
@@ -1,4 +1,4 @@
1
- ['3.2.10', '3.1.9', '3.0.18'].each do |rails_version|
1
+ ['4.0.0.rc1', '3.2.13', '3.1.12', '3.0.20'].each do |rails_version|
2
2
  appraise "rails_#{rails_version}" do
3
3
  gem "rails", rails_version
4
4
  end
@@ -26,24 +26,23 @@ GEM
26
26
  bundler
27
27
  rake
28
28
  builder (2.1.2)
29
- capybara (1.1.0)
29
+ capybara (2.0.3)
30
30
  mime-types (>= 1.16)
31
31
  nokogiri (>= 1.3.3)
32
32
  rack (>= 1.0.0)
33
33
  rack-test (>= 0.5.4)
34
34
  selenium-webdriver (~> 2.0)
35
- xpath (~> 0.1.4)
36
- childprocess (0.2.2)
37
- ffi (~> 1.0.6)
35
+ xpath (~> 1.0.0)
36
+ childprocess (0.3.9)
37
+ ffi (~> 1.0, >= 1.0.11)
38
38
  diff-lcs (1.1.3)
39
39
  erubis (2.6.6)
40
40
  abstract (>= 1.0.0)
41
- ffi (1.0.9)
41
+ ffi (1.8.1)
42
42
  i18n (0.5.0)
43
- json_pure (1.5.4)
44
- spruz (~> 0.2.8)
45
- mime-types (1.16)
46
- nokogiri (1.5.0)
43
+ mime-types (1.23)
44
+ multi_json (1.7.3)
45
+ nokogiri (1.5.9)
47
46
  rack (1.2.3)
48
47
  rack-mount (0.6.14)
49
48
  rack (>= 1.0.0)
@@ -70,17 +69,17 @@ GEM
70
69
  activesupport (~> 3.0)
71
70
  railties (~> 3.0)
72
71
  rspec (~> 2.6.0)
73
- rubyzip (0.9.4)
74
- selenium-webdriver (2.5.0)
75
- childprocess (>= 0.2.1)
76
- ffi (>= 1.0.7)
77
- json_pure
72
+ rubyzip (0.9.9)
73
+ selenium-webdriver (2.32.1)
74
+ childprocess (>= 0.2.5)
75
+ multi_json (~> 1.0)
78
76
  rubyzip
79
- spruz (0.2.13)
77
+ websocket (~> 1.0.4)
80
78
  sqlite3 (1.3.4)
81
79
  thor (0.14.6)
82
80
  tzinfo (0.3.29)
83
- xpath (0.1.4)
81
+ websocket (1.0.7)
82
+ xpath (1.0.0)
84
83
  nokogiri (~> 1.3)
85
84
 
86
85
  PLATFORMS
@@ -88,7 +87,7 @@ PLATFORMS
88
87
 
89
88
  DEPENDENCIES
90
89
  appraisal
91
- capybara (>= 0.4.0)
90
+ capybara (= 2.0.3)
92
91
  high_voltage!
93
92
  rspec-rails
94
93
  sqlite3
data/NEWS.md CHANGED
@@ -1,6 +1,12 @@
1
+ New for 1.2.3:
2
+ + Updates for Rails 4 compatibility.
3
+ + Fix for Rails 4 circular dependency error.
4
+ + Add ability to load HighVolage outside of rails. Require `attribute_accessors`
5
+
1
6
  New for 1.2.2:
2
7
  + Bug fix for RootRoute constraint. Support haml, slim, etc.
3
8
  + README updated for root routes.
9
+
4
10
  New for 1.2.1:
5
11
  + Ability to disable HighVoltage routes.
6
12
  + New RootRoute constraint.
data/README.md CHANGED
@@ -51,7 +51,7 @@ By default, the static page routes will be like /pages/:id (where :id is the vie
51
51
 
52
52
  If you want to route to a static page in another location (for example, a homepage), do this:
53
53
 
54
- match 'pages/home' => 'high_voltage/pages#show', :id => 'home'
54
+ get 'pages/home' => 'high_voltage/pages#show', :id => 'home'
55
55
 
56
56
  In that case, you'd need an app/views/pages/home.html.erb file.
57
57
 
@@ -65,7 +65,7 @@ route generated by High Voltage itself.
65
65
  For example, this will work for top-level routes (we will
66
66
  get a named route called `static_path` which does not conflict with the generated `page_path` method):
67
67
 
68
- match '/:id' => 'high_voltage/pages#show', :as => :static, :via => :get
68
+ get '/:id' => 'high_voltage/pages#show', :as => :static, :via => :get
69
69
 
70
70
  #### Specifying a root path
71
71
 
@@ -77,7 +77,7 @@ Which will render a homepage from app/views/pages/home.html.erb
77
77
 
78
78
  #### Enabling root domain routes
79
79
 
80
- You can remove the directory `pages` from the URL path and serve up routes from
80
+ You can remove the directory `pages` from the URL path and serve up routes from
81
81
  the root of the domain path:
82
82
 
83
83
  http://www.example.com/about
@@ -93,7 +93,7 @@ This is accomplished by changing the `HighVoltage.route_drawer` to `HighVoltage:
93
93
  # config/initializers/high_voltage.rb
94
94
  HighVoltage.route_drawer = HighVoltage::RouteDrawers::Root
95
95
 
96
- Note: This is not a catchall route. It will check the `HighVoltage.content_path`
96
+ Note: This is not a catchall route. It will check the `HighVoltage.content_path`
97
97
  (by default this is `app/views/pages`) and validate the view exists.
98
98
 
99
99
  #### Disabling routes
@@ -129,7 +129,7 @@ Create a PagesController of your own:
129
129
  Override the default route:
130
130
 
131
131
  # in config/routes.rb
132
- match "/pages/*id" => 'pages#show', :as => :page, :format => false
132
+ get "/pages/*id" => 'pages#show', :as => :page, :format => false
133
133
 
134
134
  # if routing the root path, update for your controller
135
135
  root :to => 'pages#show', :id => 'home'
@@ -184,7 +184,7 @@ system, A/B test, and so on.
184
184
  Testing
185
185
  -------
186
186
 
187
- You can test your static pages using [RSpec](https://github.com/rspec/rspec-rails)
187
+ You can test your static pages using [RSpec](https://github.com/rspec/rspec-rails)
188
188
  and [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers):
189
189
 
190
190
  # spec/controllers/pages_controller_spec.rb
@@ -1,5 +1,4 @@
1
1
  class HighVoltage::PagesController < ApplicationController
2
- unloadable
3
2
  layout Proc.new { |_| HighVoltage.layout }
4
3
 
5
4
  rescue_from ActionView::MissingTemplate do |exception|
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "http://rubygems.org"
4
4
 
5
- gem "rails", "3.0.18"
5
+ gem "rails", "3.0.20"
6
6
 
7
7
  gemspec :path=>"../"
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "http://rubygems.org"
4
4
 
5
- gem "rails", "3.1.9"
5
+ gem "rails", "3.1.12"
6
6
 
7
7
  gemspec :path=>"../"
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "http://rubygems.org"
4
4
 
5
- gem "rails", "3.2.10"
5
+ gem "rails", "3.2.13"
6
6
 
7
7
  gemspec :path=>"../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "rails", "4.0.0.rc1"
6
+
7
+ gemspec :path=>"../"
@@ -17,6 +17,6 @@ Gem::Specification.new do |s|
17
17
 
18
18
  s.add_development_dependency("appraisal")
19
19
  s.add_development_dependency("rspec-rails")
20
- s.add_development_dependency("capybara", ">= 0.4.0")
20
+ s.add_development_dependency("capybara", "= 2.0.3")
21
21
  s.add_development_dependency("sqlite3")
22
22
  end
@@ -3,6 +3,7 @@ require 'high_voltage/constraints/root_route'
3
3
  require 'high_voltage/page_finder'
4
4
  require 'high_voltage/route_drawers/default'
5
5
  require 'high_voltage/route_drawers/root'
6
+ require 'active_support/core_ext/module/attribute_accessors'
6
7
 
7
8
  module HighVoltage
8
9
  mattr_accessor :layout
@@ -1,3 +1,3 @@
1
1
  module HighVoltage
2
- VERSION = '1.2.2'.freeze
2
+ VERSION = '1.2.3'.freeze
3
3
  end
@@ -98,21 +98,21 @@ describe HighVoltage::PagesController do
98
98
  end
99
99
 
100
100
  it 'should raise a routing error for an invalid page' do
101
- lambda {
102
- get :show,
103
- :id => 'also_invalid'
101
+ lambda {
102
+ get :show,
103
+ :id => 'also_invalid'
104
104
  }.should raise_error(ActionController::RoutingError)
105
105
  end
106
106
 
107
107
  it 'should raise a routing error for a page in another directory' do
108
108
  lambda {
109
109
  get :show,
110
- :id => '../other/wrong'
110
+ :id => '../other/wrong'
111
111
  }.should raise_error(ActionController::RoutingError)
112
112
  end
113
113
 
114
114
  it 'should raise a routing error for a page in another directory when using a Unicode exploit' do
115
- lambda {
115
+ lambda {
116
116
  get :show,
117
117
  :id => '/\\../other/wrong'
118
118
  }.should raise_error(ActionController::RoutingError)
@@ -7,8 +7,7 @@ Dummy::Application.configure do
7
7
  # and recreated between test runs. Don't rely on the data there!
8
8
  config.cache_classes = true
9
9
 
10
- # Log error messages when you accidentally call methods on nil.
11
- config.whiny_nils = true
10
+ config.eager_load = false
12
11
 
13
12
  # Show full error reports and disable caching
14
13
  config.consider_all_requests_local = true
@@ -1,4 +1,4 @@
1
1
  Dummy::Application.routes.draw do
2
- match "/subclassed_pages/*id" => 'subclassed_pages#show', :format => false
3
- match "/alternative_finder/*id" => 'alternative_finder#show', :format => false
2
+ get "/subclassed_pages/*id" => 'subclassed_pages#show', :format => false
3
+ get "/alternative_finder/*id" => 'alternative_finder#show', :format => false
4
4
  end
@@ -1,7 +1,11 @@
1
- require 'spec_helper'
1
+ require 'minimal_spec_helper'
2
2
 
3
3
  describe HighVoltage do
4
4
  it 'should be valid' do
5
5
  HighVoltage.should be_a(Module)
6
6
  end
7
+
8
+ it 'should be loadable without preloading rails' do
9
+ expect { require 'high_voltage' }.not_to raise_error
10
+ end
7
11
  end
@@ -0,0 +1,5 @@
1
+ RSpec.configure do |config|
2
+ require 'rspec/expectations'
3
+ config.include RSpec::Matchers
4
+ config.mock_with :rspec
5
+ end
@@ -9,8 +9,6 @@ Rails.backtrace_cleaner.remove_silencers!
9
9
  Capybara.default_driver = :rack_test
10
10
  Capybara.default_selector = :css
11
11
 
12
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
13
-
14
12
  RSpec.configure do |config|
15
13
  require 'rspec/expectations'
16
14
  config.include RSpec::Matchers
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: high_voltage
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
5
- prerelease:
4
+ version: 1.2.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Matt Jankowski
@@ -17,12 +16,11 @@ authors:
17
16
  autorequire:
18
17
  bindir: bin
19
18
  cert_chain: []
20
- date: 2013-02-17 00:00:00.000000000 Z
19
+ date: 2013-06-15 00:00:00.000000000 Z
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency
23
22
  name: appraisal
24
23
  requirement: !ruby/object:Gem::Requirement
25
- none: false
26
24
  requirements:
27
25
  - - ! '>='
28
26
  - !ruby/object:Gem::Version
@@ -30,7 +28,6 @@ dependencies:
30
28
  type: :development
31
29
  prerelease: false
32
30
  version_requirements: !ruby/object:Gem::Requirement
33
- none: false
34
31
  requirements:
35
32
  - - ! '>='
36
33
  - !ruby/object:Gem::Version
@@ -38,7 +35,6 @@ dependencies:
38
35
  - !ruby/object:Gem::Dependency
39
36
  name: rspec-rails
40
37
  requirement: !ruby/object:Gem::Requirement
41
- none: false
42
38
  requirements:
43
39
  - - ! '>='
44
40
  - !ruby/object:Gem::Version
@@ -46,7 +42,6 @@ dependencies:
46
42
  type: :development
47
43
  prerelease: false
48
44
  version_requirements: !ruby/object:Gem::Requirement
49
- none: false
50
45
  requirements:
51
46
  - - ! '>='
52
47
  - !ruby/object:Gem::Version
@@ -54,23 +49,20 @@ dependencies:
54
49
  - !ruby/object:Gem::Dependency
55
50
  name: capybara
56
51
  requirement: !ruby/object:Gem::Requirement
57
- none: false
58
52
  requirements:
59
- - - ! '>='
53
+ - - '='
60
54
  - !ruby/object:Gem::Version
61
- version: 0.4.0
55
+ version: 2.0.3
62
56
  type: :development
63
57
  prerelease: false
64
58
  version_requirements: !ruby/object:Gem::Requirement
65
- none: false
66
59
  requirements:
67
- - - ! '>='
60
+ - - '='
68
61
  - !ruby/object:Gem::Version
69
- version: 0.4.0
62
+ version: 2.0.3
70
63
  - !ruby/object:Gem::Dependency
71
64
  name: sqlite3
72
65
  requirement: !ruby/object:Gem::Requirement
73
- none: false
74
66
  requirements:
75
67
  - - ! '>='
76
68
  - !ruby/object:Gem::Version
@@ -78,7 +70,6 @@ dependencies:
78
70
  type: :development
79
71
  prerelease: false
80
72
  version_requirements: !ruby/object:Gem::Requirement
81
- none: false
82
73
  requirements:
83
74
  - - ! '>='
84
75
  - !ruby/object:Gem::Version
@@ -102,9 +93,10 @@ files:
102
93
  - Rakefile
103
94
  - app/controllers/high_voltage/pages_controller.rb
104
95
  - config/routes.rb
105
- - gemfiles/rails_3.0.18.gemfile
106
- - gemfiles/rails_3.1.9.gemfile
107
- - gemfiles/rails_3.2.10.gemfile
96
+ - gemfiles/rails_3.0.20.gemfile
97
+ - gemfiles/rails_3.1.12.gemfile
98
+ - gemfiles/rails_3.2.13.gemfile
99
+ - gemfiles/rails_4.0.0.rc1.gemfile
108
100
  - high_voltage.gemspec
109
101
  - lib/high_voltage.rb
110
102
  - lib/high_voltage/constraints/root_route.rb
@@ -164,31 +156,31 @@ files:
164
156
  - spec/high_voltage/page_finder_spec.rb
165
157
  - spec/high_voltage_spec.rb
166
158
  - spec/integration/navigation_spec.rb
159
+ - spec/minimal_spec_helper.rb
167
160
  - spec/routing/routes_spec.rb
168
161
  - spec/spec_helper.rb
169
162
  homepage: http://github.com/thoughtbot/high_voltage
170
163
  licenses: []
164
+ metadata: {}
171
165
  post_install_message:
172
166
  rdoc_options: []
173
167
  require_paths:
174
168
  - lib
175
169
  required_ruby_version: !ruby/object:Gem::Requirement
176
- none: false
177
170
  requirements:
178
171
  - - ! '>='
179
172
  - !ruby/object:Gem::Version
180
173
  version: '0'
181
174
  required_rubygems_version: !ruby/object:Gem::Requirement
182
- none: false
183
175
  requirements:
184
176
  - - ! '>='
185
177
  - !ruby/object:Gem::Version
186
178
  version: '0'
187
179
  requirements: []
188
180
  rubyforge_project:
189
- rubygems_version: 1.8.24
181
+ rubygems_version: 2.0.3
190
182
  signing_key:
191
- specification_version: 3
183
+ specification_version: 4
192
184
  summary: Simple static page rendering controller
193
185
  test_files:
194
186
  - spec/constraints/root_route_spec.rb
@@ -242,6 +234,6 @@ test_files:
242
234
  - spec/high_voltage/page_finder_spec.rb
243
235
  - spec/high_voltage_spec.rb
244
236
  - spec/integration/navigation_spec.rb
237
+ - spec/minimal_spec_helper.rb
245
238
  - spec/routing/routes_spec.rb
246
239
  - spec/spec_helper.rb
247
- has_rdoc: