gimbal 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-style.yml +1 -1
- data/CHANGELOG.md +4 -0
- data/gimbal.gemspec +1 -0
- data/lib/gimbal/app_builder.rb +13 -1
- data/lib/gimbal/generators/app_generator.rb +14 -3
- data/lib/gimbal/version.rb +3 -3
- data/spec/features/new_project_spec.rb +12 -2
- data/templates/Gemfile.erb +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91faeeb184aa276a46b56594f75cc47afb2176e1
|
4
|
+
data.tar.gz: 78d329e1f2a2a4f01d22ae7fdfa48002dc3227b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82eb03430c8e41dc1a079f89a3a19b675cec8f5c0f57213d767feed3ef9618080bd00d541fcae2ad4ca29e273acecd6c4931f81f0a2a28779c60888e4588b7fd
|
7
|
+
data.tar.gz: 541a78b1c00540e15ed924e7d446ab81872d1e2a8349b24378499255cde8c16c597835da2a4730a7c70f159fa050ad336f93d3dc1e664762b6fd6b12c4083397
|
data/.ruby-style.yml
CHANGED
@@ -35,7 +35,7 @@ Style/IfUnlessModifier:
|
|
35
35
|
Description: Favor modifier if/unless usage when you have a single-line body.
|
36
36
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
|
37
37
|
Enabled: false
|
38
|
-
MaxLineLength:
|
38
|
+
MaxLineLength: 120
|
39
39
|
Style/OptionHash:
|
40
40
|
Description: Don't use option hashes when you can use keyword arguments.
|
41
41
|
Enabled: false
|
data/CHANGELOG.md
CHANGED
data/gimbal.gemspec
CHANGED
data/lib/gimbal/app_builder.rb
CHANGED
@@ -84,8 +84,12 @@ module Gimbal
|
|
84
84
|
inject_into_class 'config/application.rb', 'Application', config
|
85
85
|
end
|
86
86
|
|
87
|
+
def enable_administrate_gem
|
88
|
+
enable_gem 'administrate'
|
89
|
+
end
|
90
|
+
|
87
91
|
def enable_devise_gem
|
88
|
-
|
92
|
+
enable_gem 'devise'
|
89
93
|
end
|
90
94
|
|
91
95
|
def configure_i18n_for_missing_translations
|
@@ -159,6 +163,10 @@ module Gimbal
|
|
159
163
|
copy_file "spec_helper.rb", "spec/spec_helper.rb"
|
160
164
|
end
|
161
165
|
|
166
|
+
def install_administrate
|
167
|
+
bundle_command 'exec rails generate administrate:install'
|
168
|
+
end
|
169
|
+
|
162
170
|
def install_devise
|
163
171
|
bundle_command 'exec rails generate devise:install'
|
164
172
|
end
|
@@ -271,6 +279,10 @@ end
|
|
271
279
|
|
272
280
|
private
|
273
281
|
|
282
|
+
def enable_gem(gem_name)
|
283
|
+
uncomment_lines('Gemfile', "gem \"#{gem_name}\"")
|
284
|
+
end
|
285
|
+
|
274
286
|
def raise_on_missing_translations_in(environment)
|
275
287
|
config = 'config.action_view.raise_on_missing_translations = true'
|
276
288
|
|
@@ -34,6 +34,11 @@ add remote origin pointed to repo'
|
|
34
34
|
default: true,
|
35
35
|
desc: "Don't run bundle install"
|
36
36
|
|
37
|
+
class_option :skip_administrate,
|
38
|
+
type: :boolean,
|
39
|
+
default: false,
|
40
|
+
desc: 'Skip administrate gem and setup'
|
41
|
+
|
37
42
|
class_option :skip_devise,
|
38
43
|
type: :boolean,
|
39
44
|
default: false,
|
@@ -73,11 +78,11 @@ add remote origin pointed to repo'
|
|
73
78
|
invoke :setup_git
|
74
79
|
invoke :setup_database
|
75
80
|
invoke :setup_devise
|
81
|
+
invoke :setup_administrate
|
76
82
|
invoke :create_github_repo
|
77
83
|
invoke :setup_analytics
|
78
84
|
invoke :setup_bundler_audit
|
79
85
|
invoke :setup_spring
|
80
|
-
invoke :migrate_database
|
81
86
|
invoke :generate_basic_homepage
|
82
87
|
end
|
83
88
|
|
@@ -86,6 +91,7 @@ add remote origin pointed to repo'
|
|
86
91
|
build :replace_gemfile
|
87
92
|
build :set_ruby_to_version_being_used
|
88
93
|
|
94
|
+
build :enable_administrate_gem unless options[:skip_administrate]
|
89
95
|
build :enable_devise_gem unless options[:skip_devise]
|
90
96
|
|
91
97
|
bundle_command 'install'
|
@@ -103,8 +109,11 @@ add remote origin pointed to repo'
|
|
103
109
|
build :create_database
|
104
110
|
end
|
105
111
|
|
106
|
-
def
|
107
|
-
|
112
|
+
def setup_administrate
|
113
|
+
unless options[:skip_administrate]
|
114
|
+
say 'Setting up Administrate'
|
115
|
+
build :install_administrate
|
116
|
+
end
|
108
117
|
end
|
109
118
|
|
110
119
|
def setup_devise
|
@@ -114,6 +123,8 @@ add remote origin pointed to repo'
|
|
114
123
|
build :install_devise
|
115
124
|
build :generate_devise_model
|
116
125
|
build :configure_devise
|
126
|
+
|
127
|
+
build :migrate_database
|
117
128
|
end
|
118
129
|
end
|
119
130
|
|
data/lib/gimbal/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Gimbal
|
2
|
-
RAILS_VERSION = '~> 4.2'
|
3
|
-
RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip
|
4
|
-
VERSION = '0.
|
2
|
+
RAILS_VERSION = '~> 4.2'.freeze
|
3
|
+
RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip.freeze
|
4
|
+
VERSION = '0.2.0'.freeze
|
5
5
|
end
|
@@ -1,17 +1,22 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
RSpec.describe 'Create a new project' do
|
4
|
-
context 'skipping
|
4
|
+
context 'skipping optional gems' do
|
5
5
|
before(:all) do
|
6
6
|
drop_dummy_database
|
7
7
|
remove_project_directory
|
8
|
-
run_gimbal('--skip-devise')
|
8
|
+
run_gimbal('--skip-devise --skip-administrate')
|
9
9
|
end
|
10
10
|
|
11
11
|
it 'leaves the devise gem disabled' do
|
12
12
|
gemfile = IO.read("#{project_path}/Gemfile")
|
13
13
|
expect(gemfile).to match(/^\# gem "devise"$/)
|
14
14
|
end
|
15
|
+
|
16
|
+
it 'leaves the administrate gem disabled' do
|
17
|
+
gemfile = IO.read("#{project_path}/Gemfile")
|
18
|
+
expect(gemfile).to match(/^\# gem "administrate"$/)
|
19
|
+
end
|
15
20
|
end
|
16
21
|
|
17
22
|
context 'with default config' do
|
@@ -77,6 +82,11 @@ RSpec.describe 'Create a new project' do
|
|
77
82
|
expect(dev_config).to match(/^ +Bullet.rails_logger = true$/)
|
78
83
|
end
|
79
84
|
|
85
|
+
it 'enables the administrate gem' do
|
86
|
+
gemfile = IO.read("#{project_path}/Gemfile")
|
87
|
+
expect(gemfile).to match(/^gem "administrate"$/)
|
88
|
+
end
|
89
|
+
|
80
90
|
it 'enables the devise gem' do
|
81
91
|
gemfile = IO.read("#{project_path}/Gemfile")
|
82
92
|
expect(gemfile).to match(/^gem "devise"$/)
|
data/templates/Gemfile.erb
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.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Pascoe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: spring
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rails
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|