gimbal 0.0.3 → 0.0.4
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/.ruby-version +1 -1
- data/.travis.yml +1 -1
- data/lib/gimbal/app_builder.rb +10 -5
- data/lib/gimbal/generators/app_generator.rb +6 -0
- data/lib/gimbal/version.rb +2 -2
- data/spec/fakes/bin/hub +0 -0
- data/spec/features/github_spec.rb +14 -13
- data/spec/features/new_project_spec.rb +26 -22
- data/spec/support/gimbal.rb +10 -0
- data/templates/Gemfile.erb +3 -2
- data/templates/_analytics.html.haml +5 -0
- data/templates/_flashes.html.haml +5 -0
- data/templates/_javascript.html.haml +8 -0
- data/templates/gimbal_gitignore +1 -0
- data/templates/gimbal_layout.html.haml.erb +17 -0
- data/templates/rails_helper.rb +1 -1
- metadata +10 -9
- data/templates/_flashes.html.erb +0 -7
- data/templates/_javascript.html.erb +0 -12
- data/templates/gimbal_layout.html.erb.erb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03f55873c2f2a8082257070620282cb6c028a752
|
4
|
+
data.tar.gz: c41cf3ce49c838e10317a5c6abd0b3b9b06382af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46179e670dee4588a816dc4118cb00989e0d8de815faf47a7045bc1fa69ff0a0bb82eb65594e4b486735b8cd0d6e7c1a3990a979548eb0682aef1172939ac843
|
7
|
+
data.tar.gz: f6f80c232c70650790d2a3c8d90fcd531b4527fe71813a9b2f2f678b01a2a9287c2b387765374bb6a0108d7fed237ff38798310e2dea768cbe5baf4b002ab278
|
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.
|
1
|
+
2.2.4
|
data/.travis.yml
CHANGED
data/lib/gimbal/app_builder.rb
CHANGED
@@ -158,18 +158,23 @@ module Gimbal
|
|
158
158
|
end
|
159
159
|
|
160
160
|
def create_shared_flashes
|
161
|
-
copy_file "_flashes.html.
|
161
|
+
copy_file "_flashes.html.haml", "app/views/application/_flashes.html.haml"
|
162
162
|
copy_file "flashes_helper.rb", "app/helpers/flashes_helper.rb"
|
163
163
|
end
|
164
164
|
|
165
165
|
def create_shared_javascripts
|
166
|
-
copy_file '_javascript.html.
|
166
|
+
copy_file '_javascript.html.haml', 'app/views/application/_javascript.html.haml'
|
167
|
+
end
|
168
|
+
|
169
|
+
def create_analytics_partial
|
170
|
+
copy_file '_analytics.html.haml',
|
171
|
+
'app/views/application/_analytics.html.haml'
|
167
172
|
end
|
168
173
|
|
169
174
|
def create_application_layout
|
170
|
-
|
171
|
-
|
172
|
-
|
175
|
+
remove_file 'app/views/layouts/application.html.erb'
|
176
|
+
template 'gimbal_layout.html.haml.erb',
|
177
|
+
'app/views/layouts/application.html.haml'
|
173
178
|
end
|
174
179
|
|
175
180
|
def create_database
|
@@ -35,6 +35,7 @@ module Gimbal
|
|
35
35
|
invoke :setup_git
|
36
36
|
invoke :setup_database
|
37
37
|
invoke :create_github_repo
|
38
|
+
invoke :setup_analytics
|
38
39
|
invoke :setup_bundler_audit
|
39
40
|
invoke :setup_spring
|
40
41
|
end
|
@@ -94,6 +95,11 @@ module Gimbal
|
|
94
95
|
build :create_application_layout
|
95
96
|
end
|
96
97
|
|
98
|
+
def setup_analytics
|
99
|
+
say 'Configure Analytics'
|
100
|
+
build :create_analytics_partial
|
101
|
+
end
|
102
|
+
|
97
103
|
def configure_app
|
98
104
|
say 'Configuring app'
|
99
105
|
build :configure_time_formats
|
data/lib/gimbal/version.rb
CHANGED
data/spec/fakes/bin/hub
CHANGED
File without changes
|
@@ -1,15 +1,16 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
3
|
+
RSpec.describe "GitHub" do
|
4
|
+
before do
|
5
|
+
drop_dummy_database
|
6
|
+
remove_project_directory
|
7
|
+
end
|
8
|
+
|
9
|
+
it "creates a project with --github option" do
|
10
|
+
repo_name = 'test'
|
11
|
+
run_gimbal("--github=#{repo_name}")
|
12
|
+
setup_app_dependencies
|
13
|
+
|
14
|
+
expect(FakeGithub).to have_created_repo(repo_name)
|
15
|
+
end
|
16
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
RSpec.describe
|
3
|
+
RSpec.describe 'Create a new project with default config' do
|
4
4
|
before(:all) do
|
5
5
|
drop_dummy_database
|
6
6
|
remove_project_directory
|
@@ -10,12 +10,12 @@ RSpec.describe "Create a new project with default config" do
|
|
10
10
|
it 'ensures project specs pass' do
|
11
11
|
Dir.chdir(project_path) do
|
12
12
|
Bundler.with_clean_env do
|
13
|
-
expect(`rake`).to
|
13
|
+
expect(`rake`).to match(/0 failures/)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
it
|
18
|
+
it 'configs missing assets to raise in test' do
|
19
19
|
test_config = IO.read("#{project_path}/config/environments/test.rb")
|
20
20
|
|
21
21
|
expect(test_config).to match(
|
@@ -23,7 +23,7 @@ RSpec.describe "Create a new project with default config" do
|
|
23
23
|
)
|
24
24
|
end
|
25
25
|
|
26
|
-
it
|
26
|
+
it 'configs raise_on_delivery errors in development' do
|
27
27
|
dev_config = IO.read("#{project_path}/config/environments/development.rb")
|
28
28
|
|
29
29
|
expect(dev_config).to match(
|
@@ -31,7 +31,7 @@ RSpec.describe "Create a new project with default config" do
|
|
31
31
|
)
|
32
32
|
end
|
33
33
|
|
34
|
-
it
|
34
|
+
it 'configs development to send mail using letter_opener' do
|
35
35
|
dev_config = IO.read("#{project_path}/config/environments/development.rb")
|
36
36
|
|
37
37
|
expect(dev_config).to match(
|
@@ -39,7 +39,7 @@ RSpec.describe "Create a new project with default config" do
|
|
39
39
|
)
|
40
40
|
end
|
41
41
|
|
42
|
-
it
|
42
|
+
it 'configs development to raise on missing translations' do
|
43
43
|
dev_config = IO.read("#{project_path}/config/environments/development.rb")
|
44
44
|
|
45
45
|
expect(dev_config).to match(
|
@@ -47,7 +47,7 @@ RSpec.describe "Create a new project with default config" do
|
|
47
47
|
)
|
48
48
|
end
|
49
49
|
|
50
|
-
it
|
50
|
+
it 'configs test to raise on missing translations' do
|
51
51
|
dev_config = IO.read("#{project_path}/config/environments/test.rb")
|
52
52
|
|
53
53
|
expect(dev_config).to match(
|
@@ -55,7 +55,7 @@ RSpec.describe "Create a new project with default config" do
|
|
55
55
|
)
|
56
56
|
end
|
57
57
|
|
58
|
-
it
|
58
|
+
it 'configs bullet gem in development' do
|
59
59
|
dev_config = IO.read("#{project_path}/config/environments/development.rb")
|
60
60
|
|
61
61
|
expect(dev_config).to match /^ +Bullet.enable = true$/
|
@@ -63,7 +63,7 @@ RSpec.describe "Create a new project with default config" do
|
|
63
63
|
expect(dev_config).to match /^ +Bullet.rails_logger = true$/
|
64
64
|
end
|
65
65
|
|
66
|
-
it
|
66
|
+
it 'raises on unpermitted parameters in all environments' do
|
67
67
|
result = IO.read("#{project_path}/config/application.rb")
|
68
68
|
|
69
69
|
expect(result).to match(
|
@@ -71,7 +71,7 @@ RSpec.describe "Create a new project with default config" do
|
|
71
71
|
)
|
72
72
|
end
|
73
73
|
|
74
|
-
it
|
74
|
+
it 'configures generators' do
|
75
75
|
result = IO.read("#{project_path}/config/application.rb")
|
76
76
|
|
77
77
|
expect(result).to match(/^ +generate.helper false$/)
|
@@ -83,48 +83,52 @@ RSpec.describe "Create a new project with default config" do
|
|
83
83
|
expect(result).to match(/^ +generate.view_specs false/)
|
84
84
|
end
|
85
85
|
|
86
|
-
it
|
87
|
-
|
86
|
+
it 'removes the default erb layout' do
|
87
|
+
expect(File).not_to exist("#{project_path}/app/views/layouts/application.html.erb")
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'configures language in html element' do
|
91
|
+
layout_path = '/app/views/layouts/application.html.haml'
|
88
92
|
layout_file = IO.read("#{project_path}#{layout_path}")
|
89
|
-
expect(layout_file).to match(
|
93
|
+
expect(layout_file).to match(/%html\{lang: 'en'\}/)
|
90
94
|
end
|
91
95
|
|
92
|
-
it
|
96
|
+
it 'evaluates en.yml.erb' do
|
93
97
|
locales_en_file = IO.read("#{project_path}/config/locales/en.yml")
|
94
98
|
app_name = GimbalTestHelpers::APP_NAME
|
95
99
|
|
96
100
|
expect(locales_en_file).to match(/application: #{app_name.humanize}/)
|
97
101
|
end
|
98
102
|
|
99
|
-
it
|
103
|
+
it 'adds support file for action mailer' do
|
100
104
|
expect(File).to exist("#{project_path}/spec/support/action_mailer.rb")
|
101
105
|
end
|
102
106
|
|
103
|
-
it
|
107
|
+
it 'adds support file for factory girl' do
|
104
108
|
expect(File).to exist("#{project_path}/spec/support/factory_girl.rb")
|
105
109
|
end
|
106
110
|
|
107
|
-
it
|
111
|
+
it 'adds support file for database cleaner' do
|
108
112
|
expect(File).to exist("#{project_path}/spec/support/database_cleaner.rb")
|
109
113
|
end
|
110
114
|
|
111
|
-
it
|
115
|
+
it 'adds support file for database cleaner' do
|
112
116
|
expect(File).to exist("#{project_path}/spec/support/shoulda_matchers.rb")
|
113
117
|
end
|
114
118
|
|
115
|
-
it
|
119
|
+
it 'adds support file for i18n' do
|
116
120
|
expect(File).to exist("#{project_path}/spec/support/i18n.rb")
|
117
121
|
end
|
118
122
|
|
119
|
-
it
|
123
|
+
it 'adds specs for missing or unused translations' do
|
120
124
|
expect(File).to exist("#{project_path}/spec/i18n_spec.rb")
|
121
125
|
end
|
122
126
|
|
123
|
-
it
|
127
|
+
it 'configs i18n-tasks' do
|
124
128
|
expect(File).to exist("#{project_path}/config/i18n-tasks.yml")
|
125
129
|
end
|
126
130
|
|
127
|
-
it
|
131
|
+
it 'creates .ruby-version from Gimbal .ruby-version' do
|
128
132
|
ruby_version_file = IO.read("#{project_path}/.ruby-version")
|
129
133
|
|
130
134
|
expect(ruby_version_file).to eq "#{RUBY_VERSION}\n"
|
data/spec/support/gimbal.rb
CHANGED
@@ -20,6 +20,16 @@ module GimbalTestHelpers
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
def setup_app_dependencies
|
24
|
+
if File.exist?(project_path)
|
25
|
+
Dir.chdir(project_path) do
|
26
|
+
Bundler.with_clean_env do
|
27
|
+
`bundle check || bundle install`
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
23
33
|
def drop_dummy_database
|
24
34
|
if File.exist?(project_path)
|
25
35
|
Dir.chdir(project_path) do
|
data/templates/Gemfile.erb
CHANGED
@@ -6,7 +6,8 @@ ruby "<%= Gimbal::RUBY_VERSION %>"
|
|
6
6
|
gem "autoprefixer-rails"
|
7
7
|
gem "coffee-rails", "~> 4.1.0"
|
8
8
|
# gem "delayed_job_active_record"
|
9
|
-
|
9
|
+
gem "flutie"
|
10
|
+
gem "haml-rails", "~> 0.9"
|
10
11
|
# gem "high_voltage"
|
11
12
|
gem "jquery-rails"
|
12
13
|
# gem "newrelic_rpm", ">= 3.9.8"
|
@@ -17,7 +18,7 @@ gem "puma"
|
|
17
18
|
gem "rails", "<%= Gimbal::RAILS_VERSION %>"
|
18
19
|
# gem "recipient_interceptor"
|
19
20
|
gem "sass-rails", "~> 5.0"
|
20
|
-
|
21
|
+
gem "title"
|
21
22
|
gem "uglifier"
|
22
23
|
|
23
24
|
group :development do
|
@@ -0,0 +1,5 @@
|
|
1
|
+
- if ENV["SEGMENT_KEY"]
|
2
|
+
:javascript
|
3
|
+
window.analytics=window.analytics||[],window.analytics.methods=["identify","group","track","page","pageview","alias","ready","on","once","off","trackLink","trackForm","trackClick","trackSubmit"],window.analytics.factory=function(t){return function(){var a=Array.prototype.slice.call(arguments);return a.unshift(t),window.analytics.push(a),window.analytics}};for(var i=0;i<window.analytics.methods.length;i++){var key=window.analytics.methods[i];window.analytics[key]=window.analytics.factory(key)}window.analytics.load=function(t){if(!document.getElementById("analytics-js")){var a=document.createElement("script");a.type="text/javascript",a.id="analytics-js",a.async=!0,a.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n)}},window.analytics.SNIPPET_VERSION="2.0.9",
|
4
|
+
window.analytics.load("#{ENV["SEGMENT_KEY"]}");
|
5
|
+
window.analytics.page();
|
data/templates/gimbal_gitignore
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
!!! 5
|
2
|
+
%html{lang: '<%= I18n.locale %>'}
|
3
|
+
%head
|
4
|
+
%meta{charset: 'utf-8'}
|
5
|
+
%meta{name: 'ROBOTS', content: 'NOODP'}
|
6
|
+
%meta{name: 'viewport', content: 'initial-scale=1'}
|
7
|
+
-#
|
8
|
+
Configure default and controller-, and view-specific titles in
|
9
|
+
config/locales/en.yml. For more see:
|
10
|
+
https://github.com/calebthompson/title#usage
|
11
|
+
%title= title
|
12
|
+
= stylesheet_link_tag :application, media: 'all'
|
13
|
+
= csrf_meta_tags
|
14
|
+
%body{class: body_class}
|
15
|
+
= render "flashes"
|
16
|
+
= yield
|
17
|
+
= render "javascript"
|
data/templates/rails_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gimbal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Pascoe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.2
|
33
|
+
version: '4.2'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.2
|
40
|
+
version: '4.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,8 +96,9 @@ files:
|
|
96
96
|
- spec/support/fake_github.rb
|
97
97
|
- spec/support/gimbal.rb
|
98
98
|
- templates/Gemfile.erb
|
99
|
-
- templates/
|
100
|
-
- templates/
|
99
|
+
- templates/_analytics.html.haml
|
100
|
+
- templates/_flashes.html.haml
|
101
|
+
- templates/_javascript.html.haml
|
101
102
|
- templates/action_mailer.rb
|
102
103
|
- templates/bundler_audit.rake
|
103
104
|
- templates/config_i18n_tasks.yml
|
@@ -106,7 +107,7 @@ files:
|
|
106
107
|
- templates/factory_girl_rspec.rb
|
107
108
|
- templates/flashes_helper.rb
|
108
109
|
- templates/gimbal_gitignore
|
109
|
-
- templates/gimbal_layout.html.
|
110
|
+
- templates/gimbal_layout.html.haml.erb
|
110
111
|
- templates/i18n.rb
|
111
112
|
- templates/mysql_database.yml.erb
|
112
113
|
- templates/puma.rb
|
@@ -126,7 +127,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
127
|
requirements:
|
127
128
|
- - ">="
|
128
129
|
- !ruby/object:Gem::Version
|
129
|
-
version: 2.2.
|
130
|
+
version: 2.2.4
|
130
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
132
|
requirements:
|
132
133
|
- - ">="
|
@@ -134,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
135
|
version: '0'
|
135
136
|
requirements: []
|
136
137
|
rubyforge_project:
|
137
|
-
rubygems_version: 2.4.
|
138
|
+
rubygems_version: 2.4.8
|
138
139
|
signing_key:
|
139
140
|
specification_version: 4
|
140
141
|
summary: A Rails App Generator.
|
data/templates/_flashes.html.erb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html lang="<%= I18n.locale %>">
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8" />
|
5
|
-
<meta name="ROBOTS" content="NOODP" />
|
6
|
-
<meta name="viewport" content="initial-scale=1" />
|
7
|
-
<%%#
|
8
|
-
Configure default and controller-, and view-specific titles in
|
9
|
-
config/locales/en.yml. For more see:
|
10
|
-
https://github.com/calebthompson/title#usage
|
11
|
-
%>
|
12
|
-
<title><%%= title %></title>
|
13
|
-
<%%= stylesheet_link_tag :application, media: "all" %>
|
14
|
-
<%%= csrf_meta_tags %>
|
15
|
-
</head>
|
16
|
-
<body class="<%%= body_class %>">
|
17
|
-
<%%= render "flashes" -%>
|
18
|
-
<%%= yield %>
|
19
|
-
<%%= render "javascript" %>
|
20
|
-
</body>
|
21
|
-
</html>
|