skinny_rails 0.0.1
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.
- checksums.yaml +7 -0
- data/lib/generators/skinny_rails_generator.rb +53 -0
- metadata +59 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 10594bf8c59cb9bd227a62b88ca0bd825d631116
|
4
|
+
data.tar.gz: df49eef831ac600b2da2b094da6a6764c530e160
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: efffa56822826fbddc936721c1772cfbd7bb267fba7033f03562deab8e9014944add5489ab41d2f9a725ba48ff2de378133acb84bcd96dea957604fedfc6e9b7
|
7
|
+
data.tar.gz: aa588a44af446ad944a7319f7512334084709cd0c25fb7bfcd2137a9aaf4c787ea46bac11e3af570908a3ce4cfbaa07f43f495561b17f01b55a0b98fab7833f4
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
class SkinnyRailsGenerator < Rails::Generators::Base
|
4
|
+
desc 'This generator puts your Rails app on a diet.'
|
5
|
+
|
6
|
+
def add_new_railties
|
7
|
+
insert_into_file 'config/application.rb', after: "require 'rails/all'" do
|
8
|
+
%q(
|
9
|
+
%w( action_controller rails/test_unit sprockets ).each do |framework|
|
10
|
+
begin
|
11
|
+
require "#{framework}/railtie"
|
12
|
+
rescue LoadError
|
13
|
+
end
|
14
|
+
end )
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def comment_out_all_railties
|
19
|
+
comment_lines 'config/application.rb', /require 'rails\/all'/
|
20
|
+
end
|
21
|
+
|
22
|
+
def remove_unnecessary_files
|
23
|
+
%w(
|
24
|
+
config/database.yml
|
25
|
+
db/schema.rb
|
26
|
+
db/seeds.rb
|
27
|
+
app/mailers
|
28
|
+
test/mailers
|
29
|
+
).each do |file|
|
30
|
+
remove_file file
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def comment_out_database_gems
|
35
|
+
comment_lines 'Gemfile', /(gem 'pg'|mysql|sqlite)/
|
36
|
+
end
|
37
|
+
|
38
|
+
def comment_out_configurations
|
39
|
+
comment_lines 'config/environments/development.rb', /(action_mailer|active_record)/i
|
40
|
+
comment_lines 'config/environments/test.rb', /(action_mailer|active_record)/i
|
41
|
+
comment_lines 'test/test_helper.rb', /(fixtures|ActiveRecord)/i
|
42
|
+
end
|
43
|
+
|
44
|
+
def delete_cookie_middleware
|
45
|
+
application do
|
46
|
+
%q(
|
47
|
+
config.middleware.delete "ActionDispatch::Cookies"
|
48
|
+
config.middleware.delete "ActionDispatch::Session::CookieStore"
|
49
|
+
config.middleware.delete "ActionDispatch::Flash"
|
50
|
+
)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
metadata
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: skinny_rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Adam Jacox
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-12-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.0.0
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.0.0
|
27
|
+
description: Remove unnecessary Rails dependencies for simple "static" sites.
|
28
|
+
email:
|
29
|
+
- yellowjacox@gmail.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- lib/generators/skinny_rails_generator.rb
|
35
|
+
homepage: https://github.com/yellowaj/skinny_rails
|
36
|
+
licenses:
|
37
|
+
- MIT
|
38
|
+
metadata: {}
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options: []
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - '>='
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
requirements: []
|
54
|
+
rubyforge_project:
|
55
|
+
rubygems_version: 2.1.11
|
56
|
+
signing_key:
|
57
|
+
specification_version: 4
|
58
|
+
summary: Put your Rails app on a diet.
|
59
|
+
test_files: []
|