startblock 1.0 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +3 -9
- data/CHANGELOG +21 -0
- data/Gemfile.lock +49 -60
- data/README.md +3 -1
- data/Rakefile +8 -0
- data/VERSION +1 -0
- data/lib/startblock/app_builder.rb +7 -6
- data/lib/startblock/generators/app_generator.rb +10 -10
- data/lib/startblock/version.rb +2 -2
- data/startblock.gemspec +4 -4
- data/templates/Gemfile.erb +17 -15
- data/templates/application.css.scss +2 -6
- data/templates/application.js +10 -0
- data/templates/rubocop.yml +71 -0
- data/test/features/new_project_test.rb +41 -0
- data/test/support/startblock.rb +47 -0
- data/test/test_helper.rb +15 -0
- metadata +24 -14
- data/NEWS.md +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b272176ada27acb05cdb1d0ac0d082d9c8f1a34e
|
4
|
+
data.tar.gz: 734c10128815708c11b9af83466b76f100332aa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2aec4368ea1f2a047625a1a92183d03001f3112a2b9fc13d1efb5f9276beb15bb0f26d25d3daf66553c6d6262f1c72ad9871f2626975996426ddc5fccea7d6a9
|
7
|
+
data.tar.gz: 26e8f71dbb6b979ba246e13846283d024a19bf5c23346bafa5879cef6b270cdc7d0a260729ee3328f9e121dd3e23704e7e358c20c4e5707b81c72fb3ec8c3098
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.2.3
|
data/.travis.yml
CHANGED
@@ -1,12 +1,6 @@
|
|
1
1
|
language: ruby
|
2
|
+
cache: bundler
|
2
3
|
rvm:
|
3
|
-
- 2.2.
|
4
|
-
before_install:
|
5
|
-
- "echo '--colour' > ~/.rspec"
|
6
|
-
- git config --global user.name 'Travis CI'
|
7
|
-
- git config --global user.email 'travis-ci@example.com'
|
8
|
-
install:
|
9
|
-
- bundle install
|
4
|
+
- 2.2.3
|
10
5
|
notifications:
|
11
|
-
email:
|
12
|
-
sudo: false
|
6
|
+
email: true
|
data/CHANGELOG
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Change Log
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
|
+
|
5
|
+
## V1.1 - Navy Silver (Released on 2015-08-21)
|
6
|
+
|
7
|
+
### Added
|
8
|
+
- Rubocop was added with a default config
|
9
|
+
- Bootstrap is now our default templating 'framework'
|
10
|
+
|
11
|
+
### Changed
|
12
|
+
- Updated the ruby version to 2.2.3
|
13
|
+
- Make rails version follow all patch versions (Added ~> to the version)
|
14
|
+
|
15
|
+
### Removed
|
16
|
+
- Bourbon, Bitters and Neat has been removed
|
17
|
+
- Rollbar
|
18
|
+
- Normalize-rails
|
19
|
+
|
20
|
+
### Fixed
|
21
|
+
- Nothing
|
data/Gemfile.lock
CHANGED
@@ -2,115 +2,100 @@ PATH
|
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
4
|
startblock (1.0)
|
5
|
-
bitters (~> 0.10)
|
6
5
|
bundler (~> 1.3)
|
7
|
-
rails (
|
6
|
+
rails (~> 4.2)
|
8
7
|
thor (~> 0.19)
|
9
8
|
|
10
9
|
GEM
|
11
10
|
remote: https://rubygems.org/
|
12
11
|
specs:
|
13
|
-
actionmailer (4.2.
|
14
|
-
actionpack (= 4.2.
|
15
|
-
actionview (= 4.2.
|
16
|
-
activejob (= 4.2.
|
12
|
+
actionmailer (4.2.3)
|
13
|
+
actionpack (= 4.2.3)
|
14
|
+
actionview (= 4.2.3)
|
15
|
+
activejob (= 4.2.3)
|
17
16
|
mail (~> 2.5, >= 2.5.4)
|
18
17
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
19
|
-
actionpack (4.2.
|
20
|
-
actionview (= 4.2.
|
21
|
-
activesupport (= 4.2.
|
22
|
-
rack (~> 1.6
|
18
|
+
actionpack (4.2.3)
|
19
|
+
actionview (= 4.2.3)
|
20
|
+
activesupport (= 4.2.3)
|
21
|
+
rack (~> 1.6)
|
23
22
|
rack-test (~> 0.6.2)
|
24
23
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
25
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.
|
26
|
-
actionview (4.2.
|
27
|
-
activesupport (= 4.2.
|
24
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
25
|
+
actionview (4.2.3)
|
26
|
+
activesupport (= 4.2.3)
|
28
27
|
builder (~> 3.1)
|
29
28
|
erubis (~> 2.7.0)
|
30
29
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
31
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.
|
32
|
-
activejob (4.2.
|
33
|
-
activesupport (= 4.2.
|
30
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
31
|
+
activejob (4.2.3)
|
32
|
+
activesupport (= 4.2.3)
|
34
33
|
globalid (>= 0.3.0)
|
35
|
-
activemodel (4.2.
|
36
|
-
activesupport (= 4.2.
|
34
|
+
activemodel (4.2.3)
|
35
|
+
activesupport (= 4.2.3)
|
37
36
|
builder (~> 3.1)
|
38
|
-
activerecord (4.2.
|
39
|
-
activemodel (= 4.2.
|
40
|
-
activesupport (= 4.2.
|
37
|
+
activerecord (4.2.3)
|
38
|
+
activemodel (= 4.2.3)
|
39
|
+
activesupport (= 4.2.3)
|
41
40
|
arel (~> 6.0)
|
42
|
-
activesupport (4.2.
|
41
|
+
activesupport (4.2.3)
|
43
42
|
i18n (~> 0.7)
|
44
43
|
json (~> 1.7, >= 1.7.7)
|
45
44
|
minitest (~> 5.1)
|
46
45
|
thread_safe (~> 0.3, >= 0.3.4)
|
47
46
|
tzinfo (~> 1.1)
|
48
|
-
arel (6.0.
|
49
|
-
bitters (0.10.1)
|
50
|
-
bourbon (>= 3.2)
|
51
|
-
sass (>= 3.2)
|
52
|
-
thor
|
53
|
-
bourbon (4.2.0)
|
54
|
-
sass (~> 3.4)
|
55
|
-
thor
|
47
|
+
arel (6.0.3)
|
56
48
|
builder (3.2.2)
|
57
49
|
erubis (2.7.0)
|
58
|
-
globalid (0.3.
|
50
|
+
globalid (0.3.6)
|
59
51
|
activesupport (>= 4.1.0)
|
60
|
-
hike (1.2.3)
|
61
52
|
i18n (0.7.0)
|
62
|
-
json (1.8.
|
63
|
-
loofah (2.0.
|
53
|
+
json (1.8.3)
|
54
|
+
loofah (2.0.3)
|
64
55
|
nokogiri (>= 1.5.9)
|
65
56
|
mail (2.6.3)
|
66
57
|
mime-types (>= 1.16, < 3)
|
67
|
-
mime-types (2.
|
58
|
+
mime-types (2.6.1)
|
68
59
|
mini_portile (0.6.2)
|
69
|
-
minitest (5.
|
70
|
-
multi_json (1.10.1)
|
60
|
+
minitest (5.8.0)
|
71
61
|
nokogiri (1.6.6.2)
|
72
62
|
mini_portile (~> 0.6.0)
|
73
|
-
rack (1.6.
|
63
|
+
rack (1.6.4)
|
74
64
|
rack-test (0.6.3)
|
75
65
|
rack (>= 1.0)
|
76
|
-
rails (4.2.
|
77
|
-
actionmailer (= 4.2.
|
78
|
-
actionpack (= 4.2.
|
79
|
-
actionview (= 4.2.
|
80
|
-
activejob (= 4.2.
|
81
|
-
activemodel (= 4.2.
|
82
|
-
activerecord (= 4.2.
|
83
|
-
activesupport (= 4.2.
|
66
|
+
rails (4.2.3)
|
67
|
+
actionmailer (= 4.2.3)
|
68
|
+
actionpack (= 4.2.3)
|
69
|
+
actionview (= 4.2.3)
|
70
|
+
activejob (= 4.2.3)
|
71
|
+
activemodel (= 4.2.3)
|
72
|
+
activerecord (= 4.2.3)
|
73
|
+
activesupport (= 4.2.3)
|
84
74
|
bundler (>= 1.3.0, < 2.0)
|
85
|
-
railties (= 4.2.
|
75
|
+
railties (= 4.2.3)
|
86
76
|
sprockets-rails
|
87
77
|
rails-deprecated_sanitizer (1.0.3)
|
88
78
|
activesupport (>= 4.2.0.alpha)
|
89
|
-
rails-dom-testing (1.0.
|
79
|
+
rails-dom-testing (1.0.7)
|
90
80
|
activesupport (>= 4.2.0.beta, < 5.0)
|
91
81
|
nokogiri (~> 1.6.0)
|
92
82
|
rails-deprecated_sanitizer (>= 1.0.1)
|
93
|
-
rails-html-sanitizer (1.0.
|
83
|
+
rails-html-sanitizer (1.0.2)
|
94
84
|
loofah (~> 2.0)
|
95
|
-
railties (4.2.
|
96
|
-
actionpack (= 4.2.
|
97
|
-
activesupport (= 4.2.
|
85
|
+
railties (4.2.3)
|
86
|
+
actionpack (= 4.2.3)
|
87
|
+
activesupport (= 4.2.3)
|
98
88
|
rake (>= 0.8.7)
|
99
89
|
thor (>= 0.18.1, < 2.0)
|
100
90
|
rake (10.4.2)
|
101
|
-
|
102
|
-
sprockets (2.12.3)
|
103
|
-
hike (~> 1.2)
|
104
|
-
multi_json (~> 1.0)
|
91
|
+
sprockets (3.3.2)
|
105
92
|
rack (~> 1.0)
|
106
|
-
|
107
|
-
sprockets-rails (2.2.4)
|
93
|
+
sprockets-rails (2.3.2)
|
108
94
|
actionpack (>= 3.0)
|
109
95
|
activesupport (>= 3.0)
|
110
96
|
sprockets (>= 2.8, < 4.0)
|
111
97
|
thor (0.19.1)
|
112
|
-
thread_safe (0.3.
|
113
|
-
tilt (1.4.1)
|
98
|
+
thread_safe (0.3.5)
|
114
99
|
tzinfo (1.2.2)
|
115
100
|
thread_safe (~> 0.1)
|
116
101
|
|
@@ -118,4 +103,8 @@ PLATFORMS
|
|
118
103
|
ruby
|
119
104
|
|
120
105
|
DEPENDENCIES
|
106
|
+
minitest (~> 5.8)
|
121
107
|
startblock!
|
108
|
+
|
109
|
+
BUNDLED WITH
|
110
|
+
1.10.6
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Startblock
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/firmhouse/Startblock.svg)](https://travis-ci.org/firmhouse/Startblock)
|
4
|
+
|
3
5
|
Startblock is the base Rails application used at
|
4
6
|
[Firmhouse](http://firmhouse.com).
|
5
7
|
|
@@ -54,7 +56,7 @@ This gem is cloned from the [Suspenders][suspenders] project and formatted to
|
|
54
56
|
the wishes we have at Firmhouse. The main idea of this gem goes out to the amazing people at
|
55
57
|
[Thoughtbot][thoughtbot].
|
56
58
|
|
57
|
-
[
|
59
|
+
[thoughtbot]: http://thoughtbot.com
|
58
60
|
[suspenders]: http://github.com/thoughtbot/suspenders
|
59
61
|
|
60
62
|
|
data/Rakefile
ADDED
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
V1.1
|
@@ -105,12 +105,9 @@ end
|
|
105
105
|
'app/assets/stylesheets/application.css.scss'
|
106
106
|
end
|
107
107
|
|
108
|
-
def
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
def install_refills
|
113
|
-
run "rails generate refills:import flashes"
|
108
|
+
def setup_javascripts
|
109
|
+
remove_file "app/assets/javascript/application.js"
|
110
|
+
copy_file "application.js", "app/assets/javascript/application.js"
|
114
111
|
end
|
115
112
|
|
116
113
|
def remove_routes_comment_lines
|
@@ -133,6 +130,10 @@ end
|
|
133
130
|
'app/views/application/_mixpanel.html.erb'
|
134
131
|
end
|
135
132
|
|
133
|
+
def setup_rubocop
|
134
|
+
copy_file "rubocop.yml", ".rubocop.yml"
|
135
|
+
end
|
136
|
+
|
136
137
|
private
|
137
138
|
|
138
139
|
def raise_on_missing_translations_in(environment)
|
@@ -26,12 +26,12 @@ module Startblock
|
|
26
26
|
invoke :create_startblock_views
|
27
27
|
invoke :configure_app
|
28
28
|
invoke :setup_stylesheets
|
29
|
-
invoke :
|
30
|
-
invoke :install_refills
|
29
|
+
invoke :setup_javascripts
|
31
30
|
invoke :remove_routes_comment_lines
|
32
31
|
invoke :setup_git
|
33
32
|
invoke :setup_database
|
34
33
|
invoke :setup_mixpanel
|
34
|
+
invoke :setup_rubocop
|
35
35
|
invoke :outro
|
36
36
|
end
|
37
37
|
|
@@ -84,14 +84,9 @@ module Startblock
|
|
84
84
|
build :setup_stylesheets
|
85
85
|
end
|
86
86
|
|
87
|
-
def
|
88
|
-
say
|
89
|
-
build :
|
90
|
-
end
|
91
|
-
|
92
|
-
def install_refills
|
93
|
-
say "Install Refills"
|
94
|
-
build :install_refills
|
87
|
+
def setup_javascripts
|
88
|
+
say "Set up javascripts"
|
89
|
+
build :setup_javascripts
|
95
90
|
end
|
96
91
|
|
97
92
|
def remove_routes_comment_lines
|
@@ -119,6 +114,11 @@ module Startblock
|
|
119
114
|
build :setup_mixpanel
|
120
115
|
end
|
121
116
|
|
117
|
+
def setup_rubocop
|
118
|
+
say "Setting up Rubocop"
|
119
|
+
build :setup_rubocop
|
120
|
+
end
|
121
|
+
|
122
122
|
def outro
|
123
123
|
say 'Congratulations! You just entered our startblock.'
|
124
124
|
end
|
data/lib/startblock/version.rb
CHANGED
data/startblock.gemspec
CHANGED
@@ -26,8 +26,8 @@ start on a working app.
|
|
26
26
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
27
27
|
s.version = Startblock::VERSION
|
28
28
|
|
29
|
-
s.
|
30
|
-
s.
|
31
|
-
s.
|
32
|
-
s.
|
29
|
+
s.add_development_dependency "minitest", "~> 5.8"
|
30
|
+
s.add_runtime_dependency 'bundler', '~> 1.3'
|
31
|
+
s.add_runtime_dependency 'rails', Startblock::RAILS_VERSION
|
32
|
+
s.add_runtime_dependency 'thor', '~> 0.19'
|
33
33
|
end
|
data/templates/Gemfile.erb
CHANGED
@@ -2,43 +2,45 @@ source "https://rubygems.org"
|
|
2
2
|
|
3
3
|
gem "rails", "<%= Startblock::RAILS_VERSION %>"
|
4
4
|
gem "pg"
|
5
|
-
gem
|
6
|
-
gem "bourbon", "~> 4.1.0"
|
7
|
-
gem "refills"
|
8
|
-
gem "neat", "~> 1.7.0"
|
9
|
-
gem "normalize-rails", "~> 3.0.0"
|
5
|
+
gem "turbolinks"
|
10
6
|
gem "coffee-rails", "~> 4.1.0"
|
11
7
|
gem "jquery-rails"
|
12
|
-
gem
|
8
|
+
gem "jquery-turbolinks"
|
9
|
+
gem "bootstrap-sass", "~> 3.3.5"
|
13
10
|
gem "sass-rails", "~> 5.0"
|
14
11
|
gem "uglifier"
|
15
|
-
gem
|
16
|
-
gem
|
17
|
-
gem "redis", '~> 3.1.0'
|
12
|
+
gem "sidekiq", "~> 3.2.5"
|
13
|
+
gem "redis", "~> 3.1.0"
|
18
14
|
gem "redis-namespace", "~> 1.5.1"
|
19
|
-
gem "passenger"
|
20
15
|
|
21
16
|
group :development do
|
22
17
|
gem "spring"
|
23
18
|
gem "web-console"
|
24
19
|
gem "capistrano"
|
25
|
-
gem
|
26
|
-
gem
|
20
|
+
gem "capistrano-rails"
|
21
|
+
gem "capistrano-rails-console"
|
27
22
|
gem "daemon_controller"
|
23
|
+
gem "passenger"
|
24
|
+
gem "quiet_assets"
|
28
25
|
end
|
29
26
|
|
30
27
|
group :development, :test do
|
31
28
|
gem "awesome_print"
|
32
29
|
gem "dotenv-rails"
|
30
|
+
gem "rubocop"
|
33
31
|
end
|
34
32
|
|
35
33
|
group :test do
|
36
34
|
gem "minitest-rails-capybara"
|
37
35
|
gem "minitest-reporters"
|
38
|
-
gem
|
39
|
-
gem
|
40
|
-
gem
|
36
|
+
gem "timecop"
|
37
|
+
gem "shoulda"
|
38
|
+
gem "mocha"
|
41
39
|
end
|
42
40
|
|
43
41
|
group :staging, :production do
|
44
42
|
end
|
43
|
+
|
44
|
+
source "https://rails-assets.org" do
|
45
|
+
gem "rails-assets-fastclick"
|
46
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
AllCops:
|
2
|
+
Include:
|
3
|
+
- "Gemfile"
|
4
|
+
Exclude:
|
5
|
+
- "db/**/*"
|
6
|
+
- "config/**/*"
|
7
|
+
- "script/**/*"
|
8
|
+
- "test/**/*"
|
9
|
+
- "vendor/**/*"
|
10
|
+
- "bin/**/*"
|
11
|
+
- "**/Rakefile"
|
12
|
+
- "**/config.ru"
|
13
|
+
RunRailsCops: true
|
14
|
+
DisplayCopNames: true
|
15
|
+
StyleGuideCopsOnly: false
|
16
|
+
Style/AndOr:
|
17
|
+
EnforcedStyle: always
|
18
|
+
Enabled: true
|
19
|
+
Style/CommentAnnotation:
|
20
|
+
Keywords:
|
21
|
+
- TODO
|
22
|
+
- FIXME
|
23
|
+
- OPTIMIZE
|
24
|
+
- HACK
|
25
|
+
- REVIEW
|
26
|
+
Style/DotPosition:
|
27
|
+
EnforcedStyle: trailing
|
28
|
+
Style/For:
|
29
|
+
EnforcedStyle: each
|
30
|
+
SupportedStyles:
|
31
|
+
- for
|
32
|
+
- each
|
33
|
+
Enabled: true
|
34
|
+
Style/IndentationWidth:
|
35
|
+
Width: 2
|
36
|
+
Style/NonNilCheck:
|
37
|
+
IncludeSemanticChanges: true
|
38
|
+
Style/StringLiterals:
|
39
|
+
EnforcedStyle: double_quotes
|
40
|
+
SupportedStyles:
|
41
|
+
- single_quotes
|
42
|
+
- double_quotes
|
43
|
+
Style/TrailingBlankLines:
|
44
|
+
EnforcedStyle: final_newline
|
45
|
+
SupportedStyles:
|
46
|
+
- final_newline
|
47
|
+
- final_blank_line
|
48
|
+
Metrics/LineLength:
|
49
|
+
Max: 110
|
50
|
+
AllowURI: true
|
51
|
+
URISchemes:
|
52
|
+
- http
|
53
|
+
- https
|
54
|
+
Metrics/MethodLength:
|
55
|
+
CountComments: false # count full line comments?
|
56
|
+
Max: 40
|
57
|
+
Metrics/AbcSize:
|
58
|
+
Max: 25
|
59
|
+
Style/Next:
|
60
|
+
Enabled: false
|
61
|
+
Lint/AssignmentInCondition:
|
62
|
+
Enabled: false
|
63
|
+
Style/Documentation:
|
64
|
+
Description: Document classes and non-namespace modules.
|
65
|
+
Enabled: false
|
66
|
+
Style/ClassAndModuleChildren:
|
67
|
+
Enabled: false
|
68
|
+
Rails/TimeZone:
|
69
|
+
Enabled: false
|
70
|
+
Style/IfUnlessModifier:
|
71
|
+
Enabled: true
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
class NewProjectTest < Minitest::Test
|
4
|
+
def test_ensure_tests_pass
|
5
|
+
Dir.chdir(project_path) do
|
6
|
+
Bundler.with_clean_env do
|
7
|
+
ENV["TEST"] = nil
|
8
|
+
assert `rake test` == "", "rake should not produce an error"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_ruby_version_file
|
14
|
+
ruby_version_file = IO.read("#{project_path}/.ruby-version")
|
15
|
+
assert_equal ruby_version_file, "#{RUBY_VERSION}\n"
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_rubocop_should_pass
|
19
|
+
Dir.chdir(project_path) do
|
20
|
+
Bundler.with_clean_env do
|
21
|
+
assert `rubocop`.match(/no offenses detected/), "Rubocop should not be offended"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_gemfile_should_contain_certain_gems
|
27
|
+
gemfile = IO.read("#{project_path}/Gemfile")
|
28
|
+
|
29
|
+
assert gemfile.match(/bootstrap-sass/), "Gemfile should contain bootstrap-sass gem"
|
30
|
+
assert gemfile.match(/quiet_assets/), "Gemfile should contain quiet assets gem"
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_application_js_should_be_created
|
34
|
+
app_js_file = IO.read("#{project_path}/app/assets/javascript/application.js")
|
35
|
+
|
36
|
+
assert app_js_file.match(/= require jquery.turbolinks/), "Jquery.turbolinks should be present"
|
37
|
+
assert app_js_file.match(/= require bootstrap-sprockets/), "Bootstrap should be present"
|
38
|
+
assert app_js_file.match(/FastClick.attach/), "Fastclick should be initialized"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module StartblockTestHelpers
|
2
|
+
APP_NAME = "dummy_app"
|
3
|
+
|
4
|
+
def create_tmp_directory
|
5
|
+
FileUtils.mkdir_p(tmp_path)
|
6
|
+
end
|
7
|
+
|
8
|
+
def remove_project_directory
|
9
|
+
FileUtils.rm_rf(project_path)
|
10
|
+
end
|
11
|
+
|
12
|
+
def run_startblock(arguments = nil)
|
13
|
+
Dir.chdir(tmp_path) do
|
14
|
+
Bundler.with_clean_env do
|
15
|
+
%x(#{startblock_bin} #{APP_NAME} #{arguments})
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def drop_dummy_database
|
21
|
+
if File.exist?(project_path)
|
22
|
+
Dir.chdir(project_path) do
|
23
|
+
Bundler.with_clean_env do
|
24
|
+
`rake db:drop`
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def project_path
|
31
|
+
@project_path ||= Pathname.new("#{tmp_path}/#{APP_NAME}")
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def tmp_path
|
37
|
+
@tmp_path ||= Pathname.new("#{root_path}/tmp")
|
38
|
+
end
|
39
|
+
|
40
|
+
def root_path
|
41
|
+
File.expand_path('../../../', __FILE__)
|
42
|
+
end
|
43
|
+
|
44
|
+
def startblock_bin
|
45
|
+
File.join(root_path, 'bin', 'startblock')
|
46
|
+
end
|
47
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
require "minitest/autorun"
|
3
|
+
|
4
|
+
Bundler.require(:default, :test)
|
5
|
+
|
6
|
+
require (Pathname.new(__FILE__).dirname + '../lib/startblock').expand_path
|
7
|
+
|
8
|
+
Dir["./test/support/**/*.rb"].each { |file| require file }
|
9
|
+
|
10
|
+
include StartblockTestHelpers
|
11
|
+
|
12
|
+
create_tmp_directory
|
13
|
+
drop_dummy_database
|
14
|
+
remove_project_directory
|
15
|
+
run_startblock
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: startblock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeroen van Baarsen
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-08-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: minitest
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
21
|
-
type: :
|
20
|
+
version: '5.8'
|
21
|
+
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '5.8'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: bundler
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -43,16 +43,16 @@ dependencies:
|
|
43
43
|
name: rails
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 4.2
|
48
|
+
version: '4.2'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 4.2
|
55
|
+
version: '4.2'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: thor
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,11 +81,13 @@ files:
|
|
81
81
|
- ".gitignore"
|
82
82
|
- ".ruby-version"
|
83
83
|
- ".travis.yml"
|
84
|
+
- CHANGELOG
|
84
85
|
- Gemfile
|
85
86
|
- Gemfile.lock
|
86
87
|
- LICENSE
|
87
|
-
- NEWS.md
|
88
88
|
- README.md
|
89
|
+
- Rakefile
|
90
|
+
- VERSION
|
89
91
|
- bin/rake
|
90
92
|
- bin/setup
|
91
93
|
- bin/startblock
|
@@ -102,14 +104,19 @@ files:
|
|
102
104
|
- templates/_javascript.html.erb
|
103
105
|
- templates/_mixpanel.html.erb
|
104
106
|
- templates/application.css.scss
|
107
|
+
- templates/application.js
|
105
108
|
- templates/bin_setup.erb
|
106
109
|
- templates/postgresql_database.yml.erb
|
110
|
+
- templates/rubocop.yml
|
107
111
|
- templates/sample.env
|
108
112
|
- templates/secrets.yml
|
109
113
|
- templates/staging.rb
|
110
114
|
- templates/startblock_gitignore
|
111
115
|
- templates/startblock_layout.html.erb.erb
|
112
116
|
- templates/test_helper.erb
|
117
|
+
- test/features/new_project_test.rb
|
118
|
+
- test/support/startblock.rb
|
119
|
+
- test/test_helper.rb
|
113
120
|
homepage: http://github.com/firmhouse/startblock
|
114
121
|
licenses:
|
115
122
|
- MIT
|
@@ -123,7 +130,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
123
130
|
requirements:
|
124
131
|
- - ">="
|
125
132
|
- !ruby/object:Gem::Version
|
126
|
-
version: 2.
|
133
|
+
version: 2.2.3
|
127
134
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
135
|
requirements:
|
129
136
|
- - ">="
|
@@ -131,8 +138,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
138
|
version: '0'
|
132
139
|
requirements: []
|
133
140
|
rubyforge_project:
|
134
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.4.5.1
|
135
142
|
signing_key:
|
136
143
|
specification_version: 4
|
137
144
|
summary: Generate a Rails app using Firmhouse's best practices.
|
138
|
-
test_files:
|
145
|
+
test_files:
|
146
|
+
- test/features/new_project_test.rb
|
147
|
+
- test/support/startblock.rb
|
148
|
+
- test/test_helper.rb
|
data/NEWS.md
DELETED