rails_build 1.2.0 → 2.4.3

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.
@@ -1,20 +0,0 @@
1
- <%
2
- @links = [
3
-
4
- rails_build.url_for(:action => :index, :only_path => true),
5
-
6
- rails_build.url_for(:action => :configuration, :only_path => true)
7
-
8
- ].map{|href| link_to(href, href)}
9
- %>
10
-
11
- <br>
12
- <hr>
13
-
14
- <ul>
15
- <% @links.each do |link| %>
16
- <li>
17
- <%= link %>
18
- </li>
19
- <% end %>
20
- </ul>
data/bin/rails DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails gems
3
- # installed from the root of your application.
4
-
5
- ENGINE_ROOT = File.expand_path('../..', __FILE__)
6
- ENGINE_PATH = File.expand_path('../../lib/rails_build/engine', __FILE__)
7
-
8
- # Set up gems listed in the Gemfile.
9
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
10
- require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
11
-
12
- require 'rails/all'
13
- require 'rails/engine/commands'
data/config/routes.rb DELETED
@@ -1,10 +0,0 @@
1
- RailsBuild::Engine.routes.draw do
2
- get '/' => 'application#index'
3
- get '/configuration' => 'application#configuration'
4
- end
5
-
6
- if RailsBuild.application
7
- RailsBuild.application.routes.draw do
8
- mount RailsBuild::Engine => '/rails_build'
9
- end
10
- end
@@ -1,50 +0,0 @@
1
- module RailsBuild
2
- class Engine < ::Rails::Engine
3
-
4
- isolate_namespace RailsBuild
5
-
6
- initializer "rails_build.routes" do |application|
7
- # see config/routes.rb
8
- #
9
- RailsBuild.application = application
10
-
11
- # load config/rails_build.rb iff present
12
- #
13
- RailsBuild.load_config!
14
-
15
- # enforce trailing slash on urls
16
- #
17
- if RailsBuild.config.trailing_slash?
18
- application.default_url_options[:trailing_slash] = true
19
-
20
- ActionController::Base.module_eval do
21
- before_action :enforce_trailing_slash
22
-
23
- def enforce_trailing_slash
24
- if request.get?
25
- format = request.fullpath.split('.', 2)[1]
26
-
27
- if format.nil? and %w[ */* text/html ].include?(request.format.to_s)
28
- url = request.original_url
29
- url, query_string = url.split('?')
30
-
31
- unless url.ends_with?('/')
32
- flash.keep
33
-
34
- url = url + '/'
35
-
36
- if query_string
37
- url = url + '?' + query_string
38
- end
39
-
40
- redirect_to(url, :status => 302)
41
- end
42
- end
43
- end
44
- end
45
- end
46
- end
47
- end
48
-
49
- end
50
- end
@@ -1,3 +0,0 @@
1
- module RailsBuild
2
- VERSION = '1.2.0'
3
- end
@@ -1,31 +0,0 @@
1
- desc "execute the rails_build program with options, `rails build help=true` for more..."
2
-
3
- task :rails_build do |task, options|
4
- engine_root = File.expand_path('../../..', __FILE__)
5
- engine_bin = File.join(engine_root, 'bin')
6
- bin = File.join(engine_bin, 'rails_build')
7
-
8
- args = ARGV.map{|arg| "#{ arg }"}
9
- task_name = args.shift
10
-
11
- argv = [bin]
12
-
13
- args.each do |arg|
14
- k, v = arg.split('=', 2).map{|s| s.strip}
15
-
16
- case v.downcase
17
- when 'true', ''
18
- argv << "--#{ k }"
19
- when 'false'
20
- nil
21
- else
22
- argv << "--#{ k }=#{ v }"
23
- end
24
- end
25
-
26
- command_line = argv.join(' ')
27
-
28
- exec(command_line)
29
- end
30
-
31
- task :build => :rails_build