carpentry 2.0.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -9,7 +9,7 @@ Installation
9
9
 
10
10
  Add Carpentry to Gemfile:
11
11
 
12
- gem "carpentry"
12
+ gem "carpentry", "~> 2.1.1"
13
13
 
14
14
  Run the generator to create the prototypes folder (and inject the Carpentry route):
15
15
 
@@ -39,7 +39,7 @@ to `app/views/layouts/carpentry/prototypes.html.[format]`.
39
39
  You can customize the prototype URI prefix (`/p`) by editing the engine mount in your `roures.rb` file, for example:
40
40
 
41
41
  ```
42
- mount Carpentry::Engine => "/prototype"
42
+ mount_carpentry_at "/prototype"
43
43
  ```
44
44
 
45
45
  Hooks
@@ -1,8 +1,9 @@
1
1
  # require "carpentry/no_robots_middleware"
2
2
  require "carpentry/engine"
3
+ require "carpentry/rails/routes"
4
+ require "carpentry/no_robots_middleware"
3
5
 
4
6
  module Carpentry
5
7
  class Engine < ::Rails::Engine
6
- # config.app_middleware.use NoRobotsMiddleware
7
8
  end
8
9
  end
@@ -1,9 +1,5 @@
1
- require File.expand_path("../no_robots_middleware", __FILE__)
2
-
3
1
  module Carpentry
4
2
  class Engine < ::Rails::Engine
5
- isolate_namespace Carpentry
6
-
7
3
  initializer "carpentry.add_middleware" do |app|
8
4
  app.middleware.use Carpentry::NoRobotsMiddleware
9
5
  end
@@ -0,0 +1,10 @@
1
+ module ActionDispatch::Routing
2
+ class Mapper
3
+ def mount_carpentry_at(mount_location)
4
+ scope mount_location do
5
+ root to: "carpentry/prototypes#serve", file_path: "index", as: "carpentry_root"
6
+ match "/*file_path" => "carpentry/prototypes#serve", via: :get
7
+ end
8
+ end
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module Carpentry
2
- VERSION = "2.0.0"
2
+ VERSION = "2.1.1"
3
3
  end
@@ -7,7 +7,7 @@ module Carpentry
7
7
  end
8
8
 
9
9
  def add_carpentry_routes
10
- route 'mount Carpentry::Engine => "/p"'
10
+ route 'mount_carpentry_at "/p"'
11
11
  end
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carpentry
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-10-25 00:00:00.000000000 Z
15
+ date: 2013-11-04 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: railties
@@ -126,11 +126,11 @@ files:
126
126
  - app/controllers/carpentry/prototypes_controller.rb
127
127
  - lib/carpentry/engine.rb
128
128
  - lib/carpentry/no_robots_middleware.rb
129
+ - lib/carpentry/rails/routes.rb
129
130
  - lib/carpentry/version.rb
130
131
  - lib/carpentry.rb
131
132
  - lib/generators/carpentry/install/install_generator.rb
132
133
  - lib/tasks/carpentry_tasks.rake
133
- - config/routes.rb
134
134
  - Rakefile
135
135
  - Gemfile
136
136
  - README.md
@@ -155,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
155
  version: '0'
156
156
  segments:
157
157
  - 0
158
- hash: -507400125341853681
158
+ hash: -2787984229922370110
159
159
  requirements: []
160
160
  rubyforge_project:
161
161
  rubygems_version: 1.8.25
@@ -1,4 +0,0 @@
1
- Carpentry::Engine.routes.draw do
2
- root to: "prototypes#serve", file_path: "index"
3
- match "/*file_path" => "prototypes#serve", via: :get
4
- end