shoestrap 0.4.1 → 1.0.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -18
- data/.rspec +1 -1
- data/.ruby-version +1 -0
- data/.travis.yml +4 -11
- data/CHANGELOG.md +15 -1
- data/CONTRIBUTING +1 -0
- data/Gemfile +1 -1
- data/Guardfile +7 -0
- data/LICENSE +17 -4
- data/README.md +32 -14
- data/Rakefile +11 -10
- data/bin/shoestrap +2 -10
- data/features/features_helper.rb +91 -0
- data/features/shoestrap/commands/new_command_feature.rb +191 -0
- data/features/shoestrap/generators/bdd_generator_feature.rb +43 -0
- data/features/shoestrap/generators/bootstrap_generator_feature.rb +11 -0
- data/features/shoestrap/generators/coffee_files_generator_feature.rb +32 -0
- data/features/shoestrap/generators/foundation_generator_feature.rb +34 -0
- data/features/shoestrap/generators/kuhsaft_generator_feature.rb +38 -0
- data/features/shoestrap/generators/smacss_files_generator_feature.rb +45 -0
- data/lib/generators/shoestrap/bdd_generator.rb +34 -0
- data/lib/generators/shoestrap/bootstrap_generator.rb +6 -0
- data/lib/generators/shoestrap/coffee_files_generator.rb +19 -0
- data/lib/generators/shoestrap/database_generator.rb +9 -0
- data/lib/generators/shoestrap/foundation_generator.rb +24 -0
- data/lib/generators/shoestrap/gem_install_generator.rb +12 -0
- data/lib/generators/shoestrap/kuhsaft_generator.rb +34 -0
- data/lib/generators/shoestrap/mailcatcher_generator.rb +14 -0
- data/lib/generators/shoestrap/smacss_file_generator.rb +33 -0
- data/lib/shoestrap.rb +2 -6
- data/lib/shoestrap/application_generator.rb +96 -0
- data/lib/shoestrap/cli.rb +35 -0
- data/lib/shoestrap/railtie.rb +7 -0
- data/lib/shoestrap/shell.rb +9 -0
- data/lib/shoestrap/version.rb +3 -0
- data/shoestrap.gemspec +28 -21
- data/spec/shoestrap/application_generator_spec.rb +170 -0
- data/spec/shoestrap/cli_spec.rb +28 -0
- data/spec/spec_helper.rb +34 -0
- data/templates/application_generator/application.html.haml +51 -0
- data/templates/application_generator/application_helper.rb +6 -0
- data/templates/application_generator/application_template.rb +72 -0
- data/templates/application_generator/favicons/favicon-sc-129x129.png +0 -0
- data/templates/application_generator/favicons/favicon-sc-16x16.ico +0 -0
- data/templates/application_generator/favicons/favicon-sc-32x32.png +0 -0
- data/templates/bdd_generator/active_record_spec_helper.rb +19 -0
- data/templates/bdd_generator/dotrspec +2 -0
- data/templates/bdd_generator/fast_spec_helper.rb +6 -0
- data/templates/bdd_generator/spec_helper.rb +12 -0
- data/templates/coffee_generator/application.js.coffee +3 -0
- data/templates/foundation_generator/_ie8_grid.css +85 -0
- data/templates/foundation_generator/_settings.css.sass +171 -0
- data/templates/kuhsaft_generator/kuhsaft.rb +5 -0
- data/templates/smacss_generator/application.css.sass +18 -0
- metadata +165 -74
- data/.rvmrc +0 -34
- data/lib/generators/shoestrap/app_generator.rb +0 -35
- data/lib/generators/shoestrap/cms_generator.rb +0 -57
- data/lib/generators/shoestrap/deployment_generator.rb +0 -62
- data/lib/generators/shoestrap/templates/cms/migration.rb +0 -15
- data/lib/generators/shoestrap/templates/cms/model.rb +0 -10
- data/lib/generators/shoestrap/templates/cms/model.yml.erb +0 -9
- data/lib/generators/shoestrap/templates/cms/view.yml.erb +0 -10
- data/lib/generators/shoestrap/templates/deployment/airbrake.rb +0 -10
- data/lib/generators/shoestrap/templates/deployment/database.yml.erb +0 -30
- data/lib/generators/shoestrap/templates/deployment/deployment.rake.erb +0 -23
- data/lib/generators/shoestrap/templates/deployment/unicorn.rb +0 -38
- data/lib/shoestrap/app_builder.rb +0 -132
- data/lib/shoestrap/tasks/middleman.rb +0 -21
- data/lib/shoestrap/tasks/radiant.rb +0 -41
- data/lib/shoestrap/tasks/rails.rb +0 -81
- data/templates/Gemfile.erb +0 -43
- data/templates/Guardfile +0 -33
- data/templates/README.md.erb +0 -30
- data/templates/_main_navigation.html.haml.erb +0 -5
- data/templates/application.html.haml +0 -24
- data/templates/bootstrap_and_overrides.css.sass +0 -7
- data/templates/cms_navigation.rb +0 -9
- data/templates/development_mail_interceptor.rb +0 -7
- data/templates/haml/scaffold/_form.html.haml +0 -10
- data/templates/haml/scaffold/edit.html.haml +0 -8
- data/templates/haml/scaffold/index.html.haml +0 -29
- data/templates/haml/scaffold/new.html.haml +0 -5
- data/templates/haml/scaffold/show.html.haml +0 -11
- data/templates/index.html.haml +0 -27
- data/templates/kuhsaft.css.sass +0 -2
- data/templates/rails/scaffold_controller/controller.rb +0 -89
- data/templates/setup_mail.rb +0 -1
- data/templates/shoestrap.yml +0 -41
@@ -0,0 +1,35 @@
|
|
1
|
+
require "thor"
|
2
|
+
|
3
|
+
require_relative 'application_generator'
|
4
|
+
|
5
|
+
module Shoestrap
|
6
|
+
class CLI < Thor
|
7
|
+
|
8
|
+
method_option :css,
|
9
|
+
:type => :string,
|
10
|
+
:default => 'bootstrap',
|
11
|
+
:banner => 'Specify which CSS Framework is used by the Application Generator'
|
12
|
+
|
13
|
+
method_option :database,
|
14
|
+
:type => :string,
|
15
|
+
:default => 'postgresql',
|
16
|
+
:banner => 'Specify which database is used when creating new Rails app'
|
17
|
+
|
18
|
+
method_option :kuhsaft,
|
19
|
+
:type => :boolean,
|
20
|
+
:default => true,
|
21
|
+
:banner => 'Specify wether kuhsaft should be installed'
|
22
|
+
|
23
|
+
desc 'new <application_name>', 'Generate a new rails app with shoestrap'
|
24
|
+
|
25
|
+
def new(application_name)
|
26
|
+
application_generator.start(application_name, options)
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def application_generator
|
32
|
+
@application_generator ||= ApplicationGenerator
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/shoestrap.gemspec
CHANGED
@@ -1,26 +1,33 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'shoestrap/version'
|
3
5
|
|
4
|
-
Gem::Specification.new do |
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "shoestrap"
|
8
|
+
spec.version = Shoestrap::VERSION
|
9
|
+
spec.authors = ["Felipe Kaufmann"]
|
10
|
+
spec.email = ["felipekaufmann@gmail.com"]
|
11
|
+
spec.description = %q{SC Bootstrapper and Generators}
|
12
|
+
spec.summary = %q{Rails App Bootstrapper and Generator used at Screen Concept}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
13
15
|
|
14
|
-
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
15
20
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "pry"
|
24
|
+
spec.add_development_dependency "rspec", '2.14.0.rc1'
|
25
|
+
spec.add_development_dependency "guard"
|
26
|
+
spec.add_development_dependency "guard-rspec"
|
27
|
+
spec.add_development_dependency "ruby_gntp"
|
20
28
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
s.add_dependency 'blazing', '0.4.0.beta3'
|
29
|
+
spec.add_dependency 'rails', '4.0.0'
|
30
|
+
spec.add_dependency 'airbrake'
|
31
|
+
spec.add_dependency 'thor'
|
32
|
+
spec.add_dependency 'blazing', '0.4.0.beta3'
|
26
33
|
end
|
@@ -0,0 +1,170 @@
|
|
1
|
+
require_relative '../../lib/shoestrap/application_generator'
|
2
|
+
require_relative '../spec_helper'
|
3
|
+
|
4
|
+
module Shoestrap
|
5
|
+
describe ApplicationGenerator do
|
6
|
+
|
7
|
+
let(:default_options) { { css: 'bootstrap', database: 'postgresql', kuhsaft: true } }
|
8
|
+
|
9
|
+
describe '#start' do
|
10
|
+
it 'says it is going to generate an app' do
|
11
|
+
ApplicationGenerator.stub(:shoestrap_generators).and_return(:true)
|
12
|
+
output = capture(:stdout, :stderr) do
|
13
|
+
ApplicationGenerator.start('test_app', default_options)
|
14
|
+
end
|
15
|
+
expect(output).to match(/\[shoestrap\] Generating new Rails Application test_app/)
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'calls rails new with the shoestrap template' do
|
19
|
+
ApplicationGenerator.stub(:shoestrap_generators).and_return(:true)
|
20
|
+
capture(:stdout, :stderr) do
|
21
|
+
expect(Shell).to receive(:exec).with("rails new test_app -m #{File.join(
|
22
|
+
File.dirname(__FILE__).gsub('spec','lib'),
|
23
|
+
'../../templates/application_generator/application_template.rb')} -d postgresql")
|
24
|
+
ApplicationGenerator.start('test_app', default_options)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'runs the shoestrap generators' do
|
29
|
+
capture(:stdout, :stderr) do
|
30
|
+
expect(ApplicationGenerator).to receive(:shoestrap_generators)
|
31
|
+
ApplicationGenerator.start('test_app', default_options)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe '#shoestrap_generators' do
|
37
|
+
|
38
|
+
before :each do
|
39
|
+
ApplicationGenerator.stub(:setup_bdd_environment)
|
40
|
+
ApplicationGenerator.stub(:setup_database)
|
41
|
+
ApplicationGenerator.stub(:setup_css_framework)
|
42
|
+
ApplicationGenerator.stub(:setup_smacss_files)
|
43
|
+
ApplicationGenerator.stub(:setup_coffee_files)
|
44
|
+
ApplicationGenerator.stub(:setup_kuhsaft)
|
45
|
+
ApplicationGenerator.stub(:install_gems)
|
46
|
+
ApplicationGenerator.stub(:apply_special_sauce)
|
47
|
+
ApplicationGenerator.stub(:setup_mailcatcher)
|
48
|
+
Dir.stub(:chdir).and_yield
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'installs requried gems' do
|
52
|
+
expect(ApplicationGenerator).to receive(:install_gems)
|
53
|
+
ApplicationGenerator.shoestrap_generators('test_app', default_options)
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'sets up the css framework' do
|
57
|
+
expect(ApplicationGenerator).to receive(:setup_css_framework)
|
58
|
+
ApplicationGenerator.shoestrap_generators('test_app', default_options)
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'sets up the smacss files' do
|
62
|
+
expect(ApplicationGenerator).to receive(:setup_smacss_files)
|
63
|
+
ApplicationGenerator.shoestrap_generators('test_app', default_options)
|
64
|
+
end
|
65
|
+
|
66
|
+
it 'sets up the coffee files' do
|
67
|
+
expect(ApplicationGenerator).to receive(:setup_coffee_files)
|
68
|
+
ApplicationGenerator.shoestrap_generators('test_app', default_options)
|
69
|
+
end
|
70
|
+
|
71
|
+
it 'sets up the bdd environment' do
|
72
|
+
expect(ApplicationGenerator).to receive(:setup_bdd_environment)
|
73
|
+
ApplicationGenerator.shoestrap_generators('test_app', default_options)
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'sets up kuhsaft' do
|
77
|
+
expect(ApplicationGenerator).to receive(:setup_kuhsaft)
|
78
|
+
ApplicationGenerator.shoestrap_generators('test_app', default_options)
|
79
|
+
end
|
80
|
+
|
81
|
+
it 'applies special sauce when the correct environment variable is set' do
|
82
|
+
original_value = ENV['GIVE_ME_SPECIAL_SAUCE']
|
83
|
+
ENV['GIVE_ME_SPECIAL_SAUCE'] = "true"
|
84
|
+
expect(ApplicationGenerator).to receive(:apply_special_sauce)
|
85
|
+
ApplicationGenerator.shoestrap_generators('test_app', default_options)
|
86
|
+
ENV['GIVE_ME_SPECIAL_SAUCE'] = original_value
|
87
|
+
end
|
88
|
+
|
89
|
+
it 'does not apply special sauce normally' do
|
90
|
+
original_value = ENV['GIVE_ME_SPECIAL_SAUCE']
|
91
|
+
ENV['GIVE_ME_SPECIAL_SAUCE'] = nil
|
92
|
+
expect(ApplicationGenerator).not_to receive(:apply_special_sauce)
|
93
|
+
ApplicationGenerator.shoestrap_generators('test_app', default_options)
|
94
|
+
ENV['GIVE_ME_SPECIAL_SAUCE'] = original_value
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
describe '#install_gems' do
|
99
|
+
it 'delegates to the Gem Install Generator' do
|
100
|
+
Shell.stub(:exec)
|
101
|
+
expect(GemInstallGenerator).to receive(:start)
|
102
|
+
ApplicationGenerator.install_gems([])
|
103
|
+
end
|
104
|
+
|
105
|
+
it 'delegates to the Gem Install Generator' do
|
106
|
+
GemInstallGenerator.stub(:start)
|
107
|
+
expect(Shell).to receive(:exec).with('bundle')
|
108
|
+
ApplicationGenerator.install_gems([])
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
describe '#setup_css_framework' do
|
113
|
+
it 'runs the generator it was called with' do
|
114
|
+
DummyGenerator = double
|
115
|
+
expect(DummyGenerator).to receive('start')
|
116
|
+
ApplicationGenerator.setup_css_framework('dummy')
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
describe '#setup_smacss_files' do
|
121
|
+
it 'runs the smacss files generator' do
|
122
|
+
expect(SmacssFilesGenerator).to receive('start')
|
123
|
+
ApplicationGenerator.setup_smacss_files
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
describe '#setup_coffee_files' do
|
128
|
+
it 'runs the coffee files generator' do
|
129
|
+
expect(CoffeeFilesGenerator).to receive('start')
|
130
|
+
ApplicationGenerator.setup_coffee_files
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
describe '#setup_bdd_environment' do
|
135
|
+
it 'runs the rspec generator' do
|
136
|
+
expect(BddGenerator).to receive('start')
|
137
|
+
ApplicationGenerator.setup_bdd_environment
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
describe '#setup_kuhsaft' do
|
142
|
+
it 'delegates to the Gem Install Generator' do
|
143
|
+
expect(KuhsaftGenerator).to receive(:start)
|
144
|
+
ApplicationGenerator.setup_kuhsaft
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
describe '#apply_special_sauce' do
|
149
|
+
it 'calls sauce apply on current directory' do
|
150
|
+
expect(Shell).to receive(:exec).with('sauce apply . --appname=foo')
|
151
|
+
ApplicationGenerator.apply_special_sauce('foo')
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
describe '#required_gems' do
|
156
|
+
it 'includes kuhsaft by default' do
|
157
|
+
pending "waiting for kuhsaft pre-release"
|
158
|
+
#expect(ApplicationGenerator.required_gems(default_options)).to include('kuhsaft')
|
159
|
+
end
|
160
|
+
|
161
|
+
it 'includes bootstrap-sass by default' do
|
162
|
+
expect(ApplicationGenerator.required_gems(default_options)).to include('bootstrap-sass')
|
163
|
+
end
|
164
|
+
|
165
|
+
it 'includes zurb-foundation when css option is set to foundation' do
|
166
|
+
expect(ApplicationGenerator.required_gems(default_options.merge( css: 'foundation' ))).to include('zurb-foundation')
|
167
|
+
end
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require_relative '../../lib/shoestrap/cli'
|
2
|
+
require_relative '../spec_helper'
|
3
|
+
|
4
|
+
module Shoestrap
|
5
|
+
describe CLI do
|
6
|
+
|
7
|
+
subject { CLI }
|
8
|
+
|
9
|
+
describe '#new' do
|
10
|
+
it 'delegates to ApplicationGenerator' do
|
11
|
+
expect(ApplicationGenerator).to receive(:start)
|
12
|
+
subject.start(['new', 'foo'])
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'does not delegate to ApplicationGenerator when no application name is provided' do
|
16
|
+
capture(:stdout, :stderr) do
|
17
|
+
expect(ApplicationGenerator).not_to receive(:start)
|
18
|
+
subject.start(['new'])
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'passes bootstrap & postgresql & kuhsaft as default to the ApplicationGenerator' do
|
23
|
+
expect(ApplicationGenerator).to receive(:start).with('test_app', { 'css' => 'bootstrap', 'database' => 'postgresql', 'kuhsaft' => true })
|
24
|
+
subject.start(['new', 'test_app'])
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
|
3
|
+
#
|
4
|
+
# Override Shoestrap::Shell.exec so no acutal shelling out
|
5
|
+
# happens when running tests.
|
6
|
+
#
|
7
|
+
# You can set expectations for system calls like so:
|
8
|
+
# Shell.expects(:exec).with('rails new test_app')
|
9
|
+
#
|
10
|
+
module Shoestrap
|
11
|
+
module Shell
|
12
|
+
extend self
|
13
|
+
|
14
|
+
def self.exec(command)
|
15
|
+
puts "#{command}"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
#
|
21
|
+
# Use capture to silece and capture stderr/stdout
|
22
|
+
# Useful to hide logged messages etc. in test run
|
23
|
+
#
|
24
|
+
def capture(*streams)
|
25
|
+
streams.map! { |stream| stream.to_s }
|
26
|
+
begin
|
27
|
+
result = StringIO.new
|
28
|
+
streams.each { |stream| eval "$#{stream} = result" }
|
29
|
+
yield
|
30
|
+
ensure
|
31
|
+
streams.each { |stream| eval("$#{stream} = #{stream.upcase}") }
|
32
|
+
end
|
33
|
+
result.string
|
34
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
!!! 5
|
2
|
+
/[if lt IE 7] <html class='no-js lt-ie9 lt-ie8 lt-ie7'>
|
3
|
+
/[if IE 7] <html class='no-js lt-ie9 lt-ie8'>
|
4
|
+
/[if IE 8] <html class='no-js lt-ie9'>
|
5
|
+
/[if gt IE 8]><!
|
6
|
+
%html.no-js{ lang: I18n.locale }
|
7
|
+
/ <![endif]
|
8
|
+
%head
|
9
|
+
%title= content_for?(:title) ? yield(:title) : 'Untitled'
|
10
|
+
|
11
|
+
%meta{ charset: 'utf-8' }
|
12
|
+
%meta{ 'http-equiv' => 'X-UA-Compatible', content: 'IE=edge,chrome=1' }
|
13
|
+
%meta{ name: 'keywords', content: '' }
|
14
|
+
%meta{ name: 'description', content: '' }
|
15
|
+
%meta{ name: 'viewport', content: 'width=device-width, initial-scale=1.0' }
|
16
|
+
|
17
|
+
-# Favicons
|
18
|
+
= favicon_link_tag('favicons/favicon-sc-129x129.png', rel: 'apple-touch-icon', type: 'image/png')
|
19
|
+
= favicon_link_tag('favicons/favicon-sc-32x32.png', rel: 'icon', type: 'image/png')
|
20
|
+
<!--[if IE]>
|
21
|
+
= favicon_link_tag('favicons/favicon-sc-16x16.ico')
|
22
|
+
<![endif]-->
|
23
|
+
|
24
|
+
-# Typekit
|
25
|
+
= javascript_include_tag '//use.typekit.net/XXXX.js', :media => 'all'
|
26
|
+
:javascript
|
27
|
+
try{Typekit.load();}catch(e){}
|
28
|
+
|
29
|
+
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
|
30
|
+
= javascript_include_tag 'modernizr', 'data-turbolinks-track' => true
|
31
|
+
= csrf_meta_tags
|
32
|
+
|
33
|
+
%body{ class: body_class }
|
34
|
+
= render_navigation
|
35
|
+
|
36
|
+
= yield
|
37
|
+
|
38
|
+
-# Application JavaScripts
|
39
|
+
= javascript_include_tag 'application', 'data-turbolinks-track' => true
|
40
|
+
|
41
|
+
-# Selectivizr
|
42
|
+
<!--[if lte IE 8]>
|
43
|
+
= javascript_include_tag 'selectivizr'
|
44
|
+
<![endif]-->
|
45
|
+
|
46
|
+
-# Google Analytics
|
47
|
+
:javascript
|
48
|
+
var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview'],['_trackPageLoadTime']];
|
49
|
+
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
|
50
|
+
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
|
51
|
+
s.parentNode.insertBefore(g,s)}(document,'script'));
|
@@ -0,0 +1,72 @@
|
|
1
|
+
#
|
2
|
+
# SC Rails Application Template
|
3
|
+
#
|
4
|
+
def source_paths
|
5
|
+
[File.expand_path(File.dirname(__FILE__))]
|
6
|
+
end
|
7
|
+
|
8
|
+
#
|
9
|
+
# Locale and Timezone
|
10
|
+
#
|
11
|
+
application "config.time_zone = 'Bern'"
|
12
|
+
application "config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s]"
|
13
|
+
application "config.i18n.available_locales = [:de]"
|
14
|
+
application "config.i18n.default_locale = :de"
|
15
|
+
|
16
|
+
inject_into_file 'config/application.rb', :after => "Application < Rails::Application" do
|
17
|
+
<<-eos
|
18
|
+
# Customize generators
|
19
|
+
config.generators do |g|
|
20
|
+
g.stylesheets false
|
21
|
+
g.form_builder :simple_form
|
22
|
+
g.template_engine :haml
|
23
|
+
g.test_framework :rspec
|
24
|
+
g.javascripts false
|
25
|
+
g.assets false
|
26
|
+
g.helper false
|
27
|
+
end
|
28
|
+
eos
|
29
|
+
end
|
30
|
+
|
31
|
+
#
|
32
|
+
# Default Gems (others are added to gemfile by individual generators called after app generation)
|
33
|
+
#
|
34
|
+
gem 'simple_form', '3.0.0.rc'
|
35
|
+
gem 'haml'
|
36
|
+
gem 'haml-rails'
|
37
|
+
gem 'simple-navigation'
|
38
|
+
gem 'mail'
|
39
|
+
gem 'fabrication'
|
40
|
+
gem 'shoestrap'
|
41
|
+
gem 'kuhsaft'
|
42
|
+
gem 'selectivizr-rails'
|
43
|
+
gem 'modernizr-rails'
|
44
|
+
gem 'bourbon'
|
45
|
+
|
46
|
+
gem_group :development, :test do
|
47
|
+
gem 'pry'
|
48
|
+
gem 'ruby_gntp'
|
49
|
+
gem 'rspec-rails'
|
50
|
+
gem 'guard-rspec'
|
51
|
+
gem 'guard-spring'
|
52
|
+
end
|
53
|
+
|
54
|
+
gem_group :test do
|
55
|
+
gem 'database_cleaner'
|
56
|
+
end
|
57
|
+
|
58
|
+
#
|
59
|
+
# Application layout
|
60
|
+
#
|
61
|
+
remove_file "app/views/layouts/application.html.erb"
|
62
|
+
copy_file "application.html.haml", "app/views/layouts/application.html.haml"
|
63
|
+
|
64
|
+
#
|
65
|
+
# Application helper
|
66
|
+
#
|
67
|
+
copy_file "application_helper.rb", "app/helpers/application_helper.rb", force: true
|
68
|
+
|
69
|
+
#
|
70
|
+
# Favicons
|
71
|
+
#
|
72
|
+
directory "favicons", "app/assets/images/favicons/"
|