arkenstone 0.1.0 → 0.2.0
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 +4 -4
- data/.gitignore +1 -0
- data/.hound.yml +2 -0
- data/.ruby-style.yml +245 -0
- data/.ruby-version +1 -1
- data/Gemfile +3 -1
- data/README.md +31 -21
- data/arkenstone.gemspec +8 -11
- data/bin/arkenstone +2 -10
- data/circle.yml +9 -0
- data/lib/arkenstone.rb +1 -2
- data/lib/arkenstone/forge.rb +41 -0
- data/lib/arkenstone/templates/Vagrantfile.erb +13 -0
- data/lib/arkenstone/templates/ansible/roles/base/tasks/main.yml +26 -0
- data/lib/arkenstone/templates/ansible/roles/postgresql/tasks/main.yml +14 -0
- data/lib/arkenstone/templates/ansible/roles/rails/defaults/main.yml +3 -0
- data/lib/arkenstone/templates/ansible/roles/rails/tasks/main.yml +31 -0
- data/lib/arkenstone/templates/ansible/roles/ruby/defaults/main.yml +5 -0
- data/lib/arkenstone/templates/ansible/roles/ruby/tasks/main.yml +26 -0
- data/lib/arkenstone/templates/ansible/site.yml +9 -0
- data/lib/arkenstone/version.rb +1 -3
- data/ruby.yml +243 -0
- data/spec/features/new_project_spec.rb +11 -120
- data/spec/features/new_project_with_ansible_spec.rb +20 -0
- data/spec/features/new_project_with_ubuntu_trusty_spec.rb +14 -0
- data/spec/features/new_project_with_virtualbox_spec.rb +14 -0
- data/spec/spec_helper.rb +7 -0
- data/spec/support/features/new_project.rb +7 -23
- metadata +41 -60
- data/.codeclimate.yml +0 -19
- data/.rubocop.yml +0 -1148
- data/.travis.yml +0 -5
- data/lib/arkenstone/app_builder.rb +0 -118
- data/lib/arkenstone/generators/app_generator.rb +0 -56
- data/lib/arkenstone/templates/.travis.yml.erb +0 -3
- data/lib/arkenstone/templates/Gemfile.erb +0 -52
- data/lib/arkenstone/templates/README.md.erb +0 -1
- data/lib/arkenstone/templates/_flashes.html.erb +0 -3
- data/lib/arkenstone/templates/_form.html.erb +0 -13
- data/lib/arkenstone/templates/application.html.erb +0 -16
- data/lib/arkenstone/templates/application.scss +0 -7
- data/lib/arkenstone/templates/database.yml.erb +0 -12
- data/lib/arkenstone/templates/database_cleaner.rb +0 -21
- data/lib/arkenstone/templates/en.yml.erb +0 -3
- data/lib/arkenstone/templates/factories.rb +0 -2
- data/lib/arkenstone/templates/high_voltage.rb +0 -4
- data/lib/arkenstone/templates/home.html.erb +0 -2
- data/lib/arkenstone/templates/rails +0 -9
- data/lib/arkenstone/templates/rails_helper.rb +0 -16
- data/lib/arkenstone/templates/rake +0 -9
- data/lib/arkenstone/templates/simple_form.en.yml +0 -31
- data/lib/arkenstone/templates/simple_form.rb +0 -165
- data/lib/arkenstone/templates/spring +0 -15
- data/lib/arkenstone/templates/user.rb +0 -3
- data/spec/features/new_project_with_authentication_spec.rb +0 -24
@@ -0,0 +1,13 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
|
3
|
+
Vagrant.configure(2) do |config|
|
4
|
+
config.vm.box = "<%= options[:box] %>"
|
5
|
+
config.vm.provider "<%= options[:provider] %>"
|
6
|
+
config.vm.network "forwarded_port", guest: 3000, host: <%= options[:port] %>
|
7
|
+
|
8
|
+
<% if options[:provisioner] == "ansible" %>
|
9
|
+
config.vm.provision "ansible" do |ansible|
|
10
|
+
ansible.playbook = "provisioners/ansible/site.yml"
|
11
|
+
end
|
12
|
+
<% end %>
|
13
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
- name: Update Apt cache
|
3
|
+
become: yes
|
4
|
+
apt:
|
5
|
+
update_cache: yes
|
6
|
+
|
7
|
+
- name: Install system dependencies
|
8
|
+
become: yes
|
9
|
+
apt: name={{ item }} state=present
|
10
|
+
with_items:
|
11
|
+
- autoconf
|
12
|
+
- build-essential
|
13
|
+
- git
|
14
|
+
- gstreamer1.0-plugins-base
|
15
|
+
- gstreamer1.0-tools
|
16
|
+
- gstreamer1.0-x
|
17
|
+
- libpq-dev
|
18
|
+
- libpq5
|
19
|
+
- libqtwebkit-dev
|
20
|
+
- libreadline-dev
|
21
|
+
- libssl-dev
|
22
|
+
- nodejs
|
23
|
+
- python-dev
|
24
|
+
- python-pip
|
25
|
+
- ssl-cert
|
26
|
+
- zlib1g-dev
|
@@ -0,0 +1,14 @@
|
|
1
|
+
---
|
2
|
+
- name: Install PostgreSQL
|
3
|
+
become: yes
|
4
|
+
apt: name=postgresql state=present
|
5
|
+
|
6
|
+
- name: Install psycopg2 module
|
7
|
+
become: yes
|
8
|
+
pip: name=psycopg2 state=present
|
9
|
+
|
10
|
+
- name: Create PostgreSQL user
|
11
|
+
become: yes
|
12
|
+
become_method: sudo
|
13
|
+
become_user: postgres
|
14
|
+
postgresql_user: name=vagrant role_attr_flags=CREATEDB,CREATEROLE,SUPERUSER
|
@@ -0,0 +1,31 @@
|
|
1
|
+
---
|
2
|
+
- name: Install Suspenders
|
3
|
+
gem: name=suspenders state=present
|
4
|
+
|
5
|
+
- name: Install Bundler
|
6
|
+
gem: name=bundler state=present
|
7
|
+
|
8
|
+
- name: Generate application
|
9
|
+
command: env PATH={{ gem_bin_path }}:$PATH suspenders .
|
10
|
+
args:
|
11
|
+
chdir: "{{ app_path }}"
|
12
|
+
creates: "{{ app_path }}/Gemfile"
|
13
|
+
|
14
|
+
- name: Install application gems
|
15
|
+
command: env PATH={{ gem_bin_path }}:$PATH bundle install
|
16
|
+
args:
|
17
|
+
chdir: "{{ app_path }}"
|
18
|
+
|
19
|
+
- name: Configure Simple Form
|
20
|
+
command: env PATH={{ gem_bin_path }}:$PATH rails g simple_form:install
|
21
|
+
args:
|
22
|
+
chdir: "{{ app_path }}"
|
23
|
+
|
24
|
+
- name: Create application database
|
25
|
+
command: env PATH={{ gem_bin_path }}:$PATH rake db:create chdir={{ app_path }}
|
26
|
+
|
27
|
+
- name: Migrate application database
|
28
|
+
command: env PATH={{ gem_bin_path }}:$PATH rake db:migrate chdir={{ app_path }}
|
29
|
+
|
30
|
+
- name: Set up application
|
31
|
+
command: env PATH={{ gem_bin_path }}:$PATH bin/setup chdir={{ app_path }}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
- name: Download Ruby {{ ruby_version }} source
|
3
|
+
get_url: url={{ ruby_src_url }} dest={{ ansible_env.HOME }}
|
4
|
+
|
5
|
+
- name: Extract Ruby source
|
6
|
+
unarchive: src={{ ruby_src_file }}
|
7
|
+
args:
|
8
|
+
dest: "{{ ansible_env.HOME }}"
|
9
|
+
creates: "{{ ruby_src_dir }}"
|
10
|
+
copy: no
|
11
|
+
|
12
|
+
- name: Configure Ruby
|
13
|
+
command: ./configure chdir={{ ruby_src_dir }}
|
14
|
+
args:
|
15
|
+
creates: "{{ ruby_src_dir}}/Makefile"
|
16
|
+
|
17
|
+
- name: Build Ruby
|
18
|
+
command: make chdir={{ ruby_src_dir }}
|
19
|
+
args:
|
20
|
+
creates: "{{ ruby_src_dir}}/ruby"
|
21
|
+
|
22
|
+
- name: Install Ruby
|
23
|
+
become: yes
|
24
|
+
command: make install chdir={{ ruby_src_dir }}
|
25
|
+
args:
|
26
|
+
creates: /usr/local/bin/ruby
|
data/lib/arkenstone/version.rb
CHANGED
data/ruby.yml
ADDED
@@ -0,0 +1,243 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- "vendor/**/*"
|
4
|
+
- "db/schema.rb"
|
5
|
+
UseCache: false
|
6
|
+
Style/CollectionMethods:
|
7
|
+
Description: Preferred collection methods.
|
8
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
|
9
|
+
Enabled: true
|
10
|
+
PreferredMethods:
|
11
|
+
collect: map
|
12
|
+
collect!: map!
|
13
|
+
find: detect
|
14
|
+
find_all: select
|
15
|
+
reduce: inject
|
16
|
+
Style/DotPosition:
|
17
|
+
Description: Checks the position of the dot in multi-line method calls.
|
18
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
|
19
|
+
Enabled: true
|
20
|
+
EnforcedStyle: trailing
|
21
|
+
SupportedStyles:
|
22
|
+
- leading
|
23
|
+
- trailing
|
24
|
+
Style/FileName:
|
25
|
+
Description: Use snake_case for source file names.
|
26
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
|
27
|
+
Enabled: false
|
28
|
+
Exclude: []
|
29
|
+
Style/GuardClause:
|
30
|
+
Description: Check for conditionals that can be replaced with guard clauses
|
31
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
|
32
|
+
Enabled: false
|
33
|
+
MinBodyLength: 1
|
34
|
+
Style/IfUnlessModifier:
|
35
|
+
Description: Favor modifier if/unless usage when you have a single-line body.
|
36
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
|
37
|
+
Enabled: false
|
38
|
+
MaxLineLength: 80
|
39
|
+
Style/OptionHash:
|
40
|
+
Description: Don't use option hashes when you can use keyword arguments.
|
41
|
+
Enabled: false
|
42
|
+
Style/PercentLiteralDelimiters:
|
43
|
+
Description: Use `%`-literal delimiters consistently
|
44
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
|
45
|
+
Enabled: false
|
46
|
+
PreferredDelimiters:
|
47
|
+
"%": "()"
|
48
|
+
"%i": "()"
|
49
|
+
"%q": "()"
|
50
|
+
"%Q": "()"
|
51
|
+
"%r": "{}"
|
52
|
+
"%s": "()"
|
53
|
+
"%w": "()"
|
54
|
+
"%W": "()"
|
55
|
+
"%x": "()"
|
56
|
+
Style/PredicateName:
|
57
|
+
Description: Check the names of predicate methods.
|
58
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
|
59
|
+
Enabled: true
|
60
|
+
NamePrefix:
|
61
|
+
- is_
|
62
|
+
- has_
|
63
|
+
- have_
|
64
|
+
NamePrefixBlacklist:
|
65
|
+
- is_
|
66
|
+
Exclude:
|
67
|
+
- spec/**/*
|
68
|
+
Style/RaiseArgs:
|
69
|
+
Description: Checks the arguments passed to raise/fail.
|
70
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
|
71
|
+
Enabled: false
|
72
|
+
EnforcedStyle: exploded
|
73
|
+
SupportedStyles:
|
74
|
+
- compact
|
75
|
+
- exploded
|
76
|
+
Style/SignalException:
|
77
|
+
Description: Checks for proper usage of fail and raise.
|
78
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
|
79
|
+
Enabled: false
|
80
|
+
EnforcedStyle: semantic
|
81
|
+
SupportedStyles:
|
82
|
+
- only_raise
|
83
|
+
- only_fail
|
84
|
+
- semantic
|
85
|
+
Style/SingleLineBlockParams:
|
86
|
+
Description: Enforces the names of some block params.
|
87
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
|
88
|
+
Enabled: false
|
89
|
+
Methods:
|
90
|
+
- reduce:
|
91
|
+
- a
|
92
|
+
- e
|
93
|
+
- inject:
|
94
|
+
- a
|
95
|
+
- e
|
96
|
+
Style/SingleLineMethods:
|
97
|
+
Description: Avoid single-line methods.
|
98
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
|
99
|
+
Enabled: false
|
100
|
+
AllowIfMethodIsEmpty: true
|
101
|
+
Style/StringLiterals:
|
102
|
+
Description: Checks if uses of quotes match the configured preference.
|
103
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
|
104
|
+
Enabled: true
|
105
|
+
EnforcedStyle: double_quotes
|
106
|
+
SupportedStyles:
|
107
|
+
- single_quotes
|
108
|
+
- double_quotes
|
109
|
+
Style/StringLiteralsInInterpolation:
|
110
|
+
Description: Checks if uses of quotes inside expressions in interpolated strings
|
111
|
+
match the configured preference.
|
112
|
+
Enabled: true
|
113
|
+
EnforcedStyle: single_quotes
|
114
|
+
SupportedStyles:
|
115
|
+
- single_quotes
|
116
|
+
- double_quotes
|
117
|
+
Style/TrailingCommaInArguments:
|
118
|
+
Description: 'Checks for trailing comma in argument lists.'
|
119
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
120
|
+
Enabled: false
|
121
|
+
EnforcedStyleForMultiline: no_comma
|
122
|
+
SupportedStyles:
|
123
|
+
- comma
|
124
|
+
- consistent_comma
|
125
|
+
- no_comma
|
126
|
+
Style/TrailingCommaInLiteral:
|
127
|
+
Description: 'Checks for trailing comma in array and hash literals.'
|
128
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
129
|
+
Enabled: false
|
130
|
+
EnforcedStyleForMultiline: no_comma
|
131
|
+
SupportedStyles:
|
132
|
+
- comma
|
133
|
+
- consistent_comma
|
134
|
+
- no_comma
|
135
|
+
Metrics/AbcSize:
|
136
|
+
Description: A calculated magnitude based on number of assignments, branches, and
|
137
|
+
conditions.
|
138
|
+
Enabled: false
|
139
|
+
Max: 15
|
140
|
+
Metrics/ClassLength:
|
141
|
+
Description: Avoid classes longer than 100 lines of code.
|
142
|
+
Enabled: false
|
143
|
+
CountComments: false
|
144
|
+
Max: 100
|
145
|
+
Metrics/ModuleLength:
|
146
|
+
CountComments: false
|
147
|
+
Max: 100
|
148
|
+
Description: Avoid modules longer than 100 lines of code.
|
149
|
+
Enabled: false
|
150
|
+
Metrics/CyclomaticComplexity:
|
151
|
+
Description: A complexity metric that is strongly correlated to the number of test
|
152
|
+
cases needed to validate a method.
|
153
|
+
Enabled: false
|
154
|
+
Max: 6
|
155
|
+
Metrics/MethodLength:
|
156
|
+
Description: Avoid methods longer than 10 lines of code.
|
157
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
|
158
|
+
Enabled: false
|
159
|
+
CountComments: false
|
160
|
+
Max: 10
|
161
|
+
Metrics/ParameterLists:
|
162
|
+
Description: Avoid parameter lists longer than three or four parameters.
|
163
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
|
164
|
+
Enabled: false
|
165
|
+
Max: 5
|
166
|
+
CountKeywordArgs: true
|
167
|
+
Metrics/PerceivedComplexity:
|
168
|
+
Description: A complexity metric geared towards measuring complexity for a human
|
169
|
+
reader.
|
170
|
+
Enabled: false
|
171
|
+
Max: 7
|
172
|
+
Lint/AssignmentInCondition:
|
173
|
+
Description: Don't use assignment in conditions.
|
174
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
|
175
|
+
Enabled: false
|
176
|
+
AllowSafeAssignment: true
|
177
|
+
Style/InlineComment:
|
178
|
+
Description: Avoid inline comments.
|
179
|
+
Enabled: false
|
180
|
+
Style/AccessorMethodName:
|
181
|
+
Description: Check the naming of accessor methods for get_/set_.
|
182
|
+
Enabled: false
|
183
|
+
Style/Alias:
|
184
|
+
Description: Use alias_method instead of alias.
|
185
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
|
186
|
+
Enabled: false
|
187
|
+
Style/Documentation:
|
188
|
+
Description: Document classes and non-namespace modules.
|
189
|
+
Enabled: false
|
190
|
+
Style/DoubleNegation:
|
191
|
+
Description: Checks for uses of double negation (!!).
|
192
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
|
193
|
+
Enabled: false
|
194
|
+
Style/EachWithObject:
|
195
|
+
Description: Prefer `each_with_object` over `inject` or `reduce`.
|
196
|
+
Enabled: false
|
197
|
+
Style/EmptyLiteral:
|
198
|
+
Description: Prefer literals to Array.new/Hash.new/String.new.
|
199
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
|
200
|
+
Enabled: false
|
201
|
+
Style/ModuleFunction:
|
202
|
+
Description: Checks for usage of `extend self` in modules.
|
203
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
|
204
|
+
Enabled: false
|
205
|
+
Style/OneLineConditional:
|
206
|
+
Description: Favor the ternary operator(?:) over if/then/else/end constructs.
|
207
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
|
208
|
+
Enabled: false
|
209
|
+
Style/PerlBackrefs:
|
210
|
+
Description: Avoid Perl-style regex back references.
|
211
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
|
212
|
+
Enabled: false
|
213
|
+
Style/Send:
|
214
|
+
Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send`
|
215
|
+
may overlap with existing methods.
|
216
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-public-send
|
217
|
+
Enabled: false
|
218
|
+
Style/SpecialGlobalVars:
|
219
|
+
Description: Avoid Perl-style global variables.
|
220
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
|
221
|
+
Enabled: false
|
222
|
+
Style/VariableInterpolation:
|
223
|
+
Description: Don't interpolate global, instance and class variables directly in
|
224
|
+
strings.
|
225
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
|
226
|
+
Enabled: false
|
227
|
+
Style/WhenThen:
|
228
|
+
Description: Use when x then ... for one-line cases.
|
229
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
|
230
|
+
Enabled: false
|
231
|
+
Lint/EachWithObjectArgument:
|
232
|
+
Description: Check for immutable argument given to each_with_object.
|
233
|
+
Enabled: true
|
234
|
+
Lint/HandleExceptions:
|
235
|
+
Description: Don't suppress exception.
|
236
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
|
237
|
+
Enabled: false
|
238
|
+
Lint/LiteralInCondition:
|
239
|
+
Description: Checks of literals used in conditions.
|
240
|
+
Enabled: false
|
241
|
+
Lint/LiteralInInterpolation:
|
242
|
+
Description: Checks for literals used in interpolation.
|
243
|
+
Enabled: false
|
@@ -3,134 +3,25 @@ require "spec_helper"
|
|
3
3
|
RSpec.describe "Generating a new project" do
|
4
4
|
before(:example) do
|
5
5
|
remove_dummy_app
|
6
|
-
run_arkenstone
|
6
|
+
run_arkenstone
|
7
7
|
end
|
8
8
|
|
9
|
-
it "
|
10
|
-
|
11
|
-
ruby_version_regexp = /^#{Arkenstone::RUBY_VERSION}\n/
|
9
|
+
it "creates a Vagrantfile" do
|
10
|
+
vagrantfile = "#{app_path}/Vagrantfile"
|
12
11
|
|
13
|
-
expect(
|
12
|
+
expect(File).to exist(vagrantfile)
|
14
13
|
end
|
15
14
|
|
16
|
-
it "
|
17
|
-
|
18
|
-
|
19
|
-
simple_form_partial = "#{project_path}/lib/templates/html/scaffold/_form.html.erb"
|
15
|
+
it "forwards the default Rails server port" do
|
16
|
+
vagrantfile = File.read("#{app_path}/Vagrantfile")
|
17
|
+
config_string = 'config.vm.network "forwarded_port", guest: 3000, host: 3001'
|
20
18
|
|
21
|
-
expect(
|
22
|
-
expect(File).to exist(simple_form_locale)
|
23
|
-
expect(File).to exist(simple_form_partial)
|
19
|
+
expect(vagrantfile).to include(config_string)
|
24
20
|
end
|
25
21
|
|
26
|
-
it "
|
27
|
-
|
22
|
+
it "creates the provisioners directory" do
|
23
|
+
provisioners_dir = "#{app_path}/provisioners/ansible"
|
28
24
|
|
29
|
-
expect(
|
30
|
-
expect(db_config).to include("database: #{app_name}_development")
|
31
|
-
end
|
32
|
-
|
33
|
-
it "customizes application layout" do
|
34
|
-
layout = File.read("#{project_path}/app/views/layouts/application.html.erb")
|
35
|
-
layout_regexps = [
|
36
|
-
/^ +<title><%= page_title %><\/title>$/,
|
37
|
-
/^ +<body class="<%= body_class %>">$/
|
38
|
-
]
|
39
|
-
|
40
|
-
layout_regexps.each do |regexp|
|
41
|
-
expect(layout).to match(regexp)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
it "configures Travis CI" do
|
46
|
-
travis_config = File.read("#{project_path}/.travis.yml")
|
47
|
-
travis_config_regexp = /^ +- #{Arkenstone::RUBY_VERSION}/
|
48
|
-
|
49
|
-
expect(travis_config).to match(travis_config_regexp)
|
50
|
-
end
|
51
|
-
|
52
|
-
it "creates factories file" do
|
53
|
-
factories_file = "#{project_path}/spec/factories.rb"
|
54
|
-
|
55
|
-
expect(File).to exist(factories_file)
|
56
|
-
end
|
57
|
-
|
58
|
-
it "creates partials directory" do
|
59
|
-
partials_dir = "#{project_path}/app/views/application"
|
60
|
-
|
61
|
-
expect(File).to exist(partials_dir)
|
62
|
-
end
|
63
|
-
|
64
|
-
it "creates flashes partial" do
|
65
|
-
flashes = "#{project_path}/app/views/application/_flashes.html.erb"
|
66
|
-
|
67
|
-
expect(File).to exist(flashes)
|
68
|
-
end
|
69
|
-
|
70
|
-
it "sets up RSpec" do
|
71
|
-
spec_dir = "#{project_path}/spec"
|
72
|
-
|
73
|
-
expect(File).to exist(spec_dir)
|
74
|
-
end
|
75
|
-
|
76
|
-
it "customizes rails_helper.rb" do
|
77
|
-
rails_helper = File.read("#{project_path}/spec/rails_helper.rb")
|
78
|
-
|
79
|
-
expect(rails_helper).to include('Rails.root.join("spec/support/**/*.rb")')
|
80
|
-
expect(rails_helper).to include("config.use_transactional_fixtures = false")
|
81
|
-
expect(rails_helper).to include("config.include Features, type: :feature")
|
82
|
-
end
|
83
|
-
|
84
|
-
it "sets up Database Cleaner" do
|
85
|
-
database_cleaner_file = "#{project_path}/spec/support/database_cleaner.rb"
|
86
|
-
|
87
|
-
expect(File).to exist(database_cleaner_file)
|
88
|
-
end
|
89
|
-
|
90
|
-
it "strips comments from Ruby files" do
|
91
|
-
result = `grep '^ *#[^!]' -l -r --include=*.rb #{project_path}`
|
92
|
-
|
93
|
-
expect(result).to eq("")
|
94
|
-
end
|
95
|
-
|
96
|
-
it "sets up style sheets" do
|
97
|
-
application_css = "#{project_path}/app/assets/stylesheets/application.css"
|
98
|
-
application_scss = "#{project_path}/app/assets/stylesheets/application.scss"
|
99
|
-
|
100
|
-
expect(File).to_not exist(application_css)
|
101
|
-
expect(File).to exist(application_scss)
|
102
|
-
end
|
103
|
-
|
104
|
-
it "sets up Bitters" do
|
105
|
-
bitters_dir = "#{project_path}/app/assets/stylesheets/base/_base.scss"
|
106
|
-
expect(File).to exist(bitters_dir)
|
107
|
-
end
|
108
|
-
|
109
|
-
it "configures locale" do
|
110
|
-
en_locale = File.read("#{project_path}/config/locales/en.yml")
|
111
|
-
|
112
|
-
expect(en_locale).to include("application: Arkenstone Test")
|
113
|
-
end
|
114
|
-
|
115
|
-
it "sets home page as root path" do
|
116
|
-
home_page = "#{project_path}/app/views/pages/home.html.erb"
|
117
|
-
high_voltage_initializer = File.read("#{project_path}/config/initializers/high_voltage.rb")
|
118
|
-
|
119
|
-
expect(File).to exist(home_page)
|
120
|
-
expect(high_voltage_initializer).to include('config.home_page = "home"')
|
121
|
-
end
|
122
|
-
|
123
|
-
it "initializes a Git repository" do
|
124
|
-
git_dir = "#{project_path}/.git"
|
125
|
-
|
126
|
-
expect(File).to exist(git_dir)
|
127
|
-
end
|
128
|
-
|
129
|
-
it "creates an initial Git commit" do
|
130
|
-
git_opts = "--git-dir=#{project_path}/.git"
|
131
|
-
git_opts << " --work-tree=#{project_path}"
|
132
|
-
git_log = `git #{git_opts} log -1`
|
133
|
-
|
134
|
-
expect(git_log).to include("Initial commit")
|
25
|
+
expect(File).to exist(provisioners_dir)
|
135
26
|
end
|
136
27
|
end
|