rails_build 1.2.0 → 2.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE +1 -0
- data/README.md +71 -127
- data/Rakefile +437 -22
- data/bin/rails_build +387 -365
- data/lib/rails_build/_lib.rb +87 -0
- data/lib/rails_build.rb +188 -17
- data/rails_build.gemspec +40 -0
- metadata +31 -110
- data/MIT-LICENSE +0 -20
- data/app/assets/config/rails_build_manifest.js +0 -2
- data/app/assets/javascripts/rails_build/application.js +0 -13
- data/app/assets/stylesheets/rails_build/application.css +0 -32
- data/app/controllers/rails_build/application_controller.rb +0 -12
- data/app/helpers/rails_build/application_helper.rb +0 -4
- data/app/jobs/rails_build/application_job.rb +0 -4
- data/app/mailers/rails_build/application_mailer.rb +0 -6
- data/app/models/rails_build/application_record.rb +0 -5
- data/app/views/layouts/rails_build/application.html.erb +0 -14
- data/app/views/rails_build/application/index.html.erb +0 -20
- data/bin/rails +0 -13
- data/config/routes.rb +0 -10
- data/lib/rails_build/engine.rb +0 -50
- data/lib/rails_build/version.rb +0 -3
- data/lib/tasks/rails_build_tasks.rake +0 -31
@@ -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
data/lib/rails_build/engine.rb
DELETED
@@ -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
|
data/lib/rails_build/version.rb
DELETED
@@ -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
|