blueberry_rails 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 85a5471d088ab01e2c8f67de92f4efed8ea7e484
4
- data.tar.gz: 413aca5512b2bca982e358a6aa9f59d2e6dd4e85
3
+ metadata.gz: aef7a2456317efb5451806b0ee5131c606bc6a16
4
+ data.tar.gz: 1d993bdf5adb37aa9c33cb06967725328ea39c95
5
5
  SHA512:
6
- metadata.gz: 7ce5feb5a3b0932b12c8bca4e47a964bbe5bb0ddf734a026ba6073aabf25a475a733343a3538090058730f9a31efb9151f0a66c696a60903fc10bbaa076f4bcb
7
- data.tar.gz: 0c2a9c95003732e1aece8365755465fd293d45da7d31dece163800993fa4dfbb5b89b3620439cd6e9afa545e2f79bac2261b87333cbe52e2a9fc0fd54d82ffe5
6
+ metadata.gz: 1893a6a91d753c54e265380bfc9bb18192813cc9127253c429f3d7431bf8b1cd4e919a83099a308e4723dd88a8f2726ac2d8d1e1886474904accd862a91d3b46
7
+ data.tar.gz: 77f130fa5224c4cd00a71add39c96b1aa5ccaaec9bcc986b4ed6b6ee6398644a64d4ad11078f146d0986239ad9bdc7c9aced4f223e0a35d309177fcd3fd28fd2
data/.hound.yml ADDED
@@ -0,0 +1,9 @@
1
+ coffee_script:
2
+ enabled: true
3
+
4
+ ruby:
5
+ enabled: true
6
+ config_file: .rubocop.yml
7
+
8
+ scss:
9
+ enabled: true
data/.rubocop.yml ADDED
@@ -0,0 +1,278 @@
1
+ AllCops:
2
+ Exclude:
3
+ - db/schema.rb
4
+ - bin/*
5
+ RunRailsCops: true
6
+
7
+ AbcSize:
8
+ Enabled: false
9
+
10
+ AccessorMethodName:
11
+ Enabled: true
12
+
13
+ ActionFilter:
14
+ Enabled: true
15
+
16
+ Alias:
17
+ Enabled: true
18
+
19
+ AlignHash:
20
+ EnforcedHashRocketStyle: table
21
+ EnforcedColonStyle: table
22
+
23
+ ArrayJoin:
24
+ Enabled: true
25
+
26
+ AsciiComments:
27
+ Enabled: false
28
+
29
+ AsciiIdentifiers:
30
+ Enabled: true
31
+
32
+ Attr:
33
+ Enabled: true
34
+
35
+ BlockNesting:
36
+ Enabled: false
37
+
38
+ CaseEquality:
39
+ Enabled: false
40
+
41
+ CharacterLiteral:
42
+ Enabled: false
43
+
44
+ ClassAndModuleChildren:
45
+ Enabled: true
46
+
47
+ ClassLength:
48
+ Enabled: false
49
+
50
+ ClassVars:
51
+ Enabled: true
52
+
53
+ CollectionMethods:
54
+ PreferredMethods:
55
+ collect: map
56
+ collect!: map!
57
+ detect: find
58
+ reduce: inject
59
+ find_all: select
60
+
61
+ ColonMethodCall:
62
+ Enabled: true
63
+
64
+ CommentAnnotation:
65
+ Enabled: false
66
+
67
+ CyclomaticComplexity:
68
+ Enabled: false
69
+
70
+ Delegate:
71
+ Enabled: false
72
+
73
+ DeprecatedHashMethods:
74
+ Enabled: true
75
+
76
+ Documentation:
77
+ Enabled: false
78
+
79
+ DotPosition:
80
+ EnforcedStyle: trailing
81
+
82
+ DoubleNegation:
83
+ Enabled: false
84
+
85
+ EachWithObject:
86
+ Enabled: true
87
+
88
+ # TODO When Rubocop adds support for this, use it (probably in 0.26.2)
89
+ # EmptyLinesAroundClassBody:
90
+ # Enabled: false
91
+
92
+ # TODO remove when EmptyLinesAroundClassBody is enabled
93
+ EmptyLinesAroundBody:
94
+ Enabled: false
95
+
96
+ EmptyLiteral:
97
+ Enabled: false
98
+
99
+ Encoding:
100
+ Enabled: false
101
+
102
+ EvenOdd:
103
+ Enabled: true
104
+
105
+ FileName:
106
+ Enabled: false
107
+
108
+ FlipFlop:
109
+ Enabled: false
110
+
111
+ FormatString:
112
+ Enabled: true
113
+ EnforcedStyle: percent
114
+
115
+ GlobalVars:
116
+ Enabled: true
117
+
118
+ GuardClause:
119
+ Enabled: false
120
+
121
+ IfUnlessModifier:
122
+ Enabled: false
123
+
124
+ IfWithSemicolon:
125
+ Enabled: true
126
+
127
+ InlineComment:
128
+ Enabled: false
129
+
130
+ Lambda:
131
+ Enabled: true
132
+
133
+ LambdaCall:
134
+ Enabled: true
135
+
136
+ LineEndConcatenation:
137
+ Enabled: true
138
+
139
+ LineLength:
140
+ Max: 80
141
+
142
+ MethodCalledOnDoEndBlock:
143
+ Enabled: true
144
+
145
+ MethodLength:
146
+ Enabled: false
147
+
148
+ ModuleFunction:
149
+ Enabled: true
150
+
151
+ NegatedIf:
152
+ Enabled: true
153
+
154
+ NegatedWhile:
155
+ Enabled: true
156
+
157
+ Next:
158
+ Enabled: true
159
+
160
+ NilComparison:
161
+ Enabled: true
162
+
163
+ Not:
164
+ Enabled: true
165
+
166
+ NumericLiterals:
167
+ Enabled: true
168
+
169
+ OneLineConditional:
170
+ Enabled: true
171
+
172
+ OpMethod:
173
+ Enabled: true
174
+
175
+ ParameterLists:
176
+ Enabled: false
177
+
178
+ PercentLiteralDelimiters:
179
+ Enabled: false
180
+
181
+ PerlBackrefs:
182
+ Enabled: false
183
+
184
+ PredicateName:
185
+ NamePrefixBlacklist:
186
+ - is_
187
+
188
+ Proc:
189
+ Enabled: true
190
+
191
+ RaiseArgs:
192
+ Enabled: true
193
+
194
+ RegexpLiteral:
195
+ Enabled: true
196
+
197
+ SelfAssignment:
198
+ Enabled: true
199
+
200
+ SingleLineBlockParams:
201
+ Enabled: false
202
+
203
+ SingleLineMethods:
204
+ Enabled: false
205
+
206
+ SignalException:
207
+ Enabled: false
208
+
209
+ SpecialGlobalVars:
210
+ Enabled: true
211
+
212
+ StringLiterals:
213
+ EnforcedStyle: single_quotes
214
+
215
+ VariableInterpolation:
216
+ Enabled: false
217
+
218
+ TrailingComma:
219
+ Enabled: true
220
+
221
+ TrivialAccessors:
222
+ Enabled: true
223
+
224
+ WhenThen:
225
+ Enabled: true
226
+
227
+ WhileUntilModifier:
228
+ Enabled: false
229
+
230
+ WordArray:
231
+ Enabled: true
232
+
233
+ # Lint
234
+
235
+ AmbiguousOperator:
236
+ Enabled: false
237
+
238
+ AmbiguousRegexpLiteral:
239
+ Enabled: false
240
+
241
+ AssignmentInCondition:
242
+ Enabled: false
243
+
244
+ ConditionPosition:
245
+ Enabled: false
246
+
247
+ DeprecatedClassMethods:
248
+ Enabled: false
249
+
250
+ ElseLayout:
251
+ Enabled: false
252
+
253
+ HandleExceptions:
254
+ Enabled: false
255
+
256
+ InvalidCharacterLiteral:
257
+ Enabled: false
258
+
259
+ LiteralInCondition:
260
+ Enabled: false
261
+
262
+ LiteralInInterpolation:
263
+ Enabled: false
264
+
265
+ Loop:
266
+ Enabled: false
267
+
268
+ ParenthesesAsGroupedExpression:
269
+ Enabled: false
270
+
271
+ RequireParentheses:
272
+ Enabled: false
273
+
274
+ UnderscorePrefixedVariableName:
275
+ Enabled: false
276
+
277
+ Void:
278
+ Enabled: false
data/.travis.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  language: ruby
2
2
  script: 'bundle exec rake'
3
3
  rvm:
4
- - 2.1.5
4
+ - 2.2.1
5
5
  before_install:
6
6
  - gem update --system
7
7
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Blueberry Rails [![Build Status](https://secure.travis-ci.org/blueberryapps/blueberry_rails.png?branch=master)](http://travis-ci.org/blueberryapps/blueberry_rails)
2
2
 
3
- A Rails application template used at Blueberry Apps.
3
+ A Rails application template used at Blueberry Apps.
4
4
 
5
5
  ## Installation
6
6
 
@@ -12,6 +12,20 @@ Then you can run
12
12
 
13
13
  $ blueberry_rails newproject
14
14
 
15
+ ### Available options
16
+
17
+ Twitter bootstrap
18
+
19
+ --bootstrap
20
+
21
+ Devise
22
+
23
+ --devise
24
+
25
+ Devise model
26
+
27
+ --devise_model User
28
+
15
29
  ## Gems
16
30
 
17
31
  Blueberry Rails template contains following gems by default:
@@ -41,7 +55,7 @@ Testing related:
41
55
 
42
56
  ## Credits
43
57
 
44
- Based on [suspenders](https://github.com/thoughtbot/suspenders/blob/master/README.md)
58
+ Based on [suspenders](https://github.com/thoughtbot/suspenders/blob/master/README.md)
45
59
  gem by [thoughtbot](http://thoughtbot.com/community).
46
60
 
47
61
  ## Contributing
@@ -4,18 +4,19 @@ module BlueberryRails
4
4
  include BlueberryRails::ActionHelpers
5
5
 
6
6
  def readme
7
- template 'README.md.erb', 'README.md'
7
+ copy_file 'README.md', 'README.md'
8
8
  end
9
9
 
10
- def replace_gemfile
11
- remove_file 'Gemfile'
10
+ def gitignore
11
+ copy_file 'gitignore_custom', '.gitignore'
12
+ end
13
+
14
+ def gemfile
12
15
  template 'Gemfile_custom.erb', 'Gemfile'
13
16
  end
14
17
 
15
- def replace_secret_token
16
- template 'secret_token.rb.erb',
17
- 'config/initializers/secret_token.rb',
18
- force: true
18
+ def secret_token
19
+ template 'secret_token.rb.erb', 'config/initializers/secret_token.rb'
19
20
  end
20
21
 
21
22
  def disable_xml_params
@@ -54,9 +55,7 @@ module BlueberryRails
54
55
 
55
56
  def create_application_layout
56
57
  remove_file 'app/views/layouts/application.html.erb'
57
- template 'layout.html.slim.erb',
58
- 'app/views/layouts/application.html.slim',
59
- force: true
58
+ copy_file 'layout.html.slim', 'app/views/layouts/application.html.slim'
60
59
  end
61
60
 
62
61
  def create_pryrc
@@ -78,8 +77,7 @@ module BlueberryRails
78
77
  end
79
78
 
80
79
  def configure_rspec
81
- remove_file 'spec/spec_helper.rb'
82
- copy_file 'spec_helper.rb', 'spec/spec_helper.rb'
80
+ copy_file 'spec_helper.rb', 'spec/spec_helper.rb', force: true
83
81
  end
84
82
 
85
83
  def test_factories_first
@@ -158,26 +156,33 @@ module BlueberryRails
158
156
  end
159
157
 
160
158
  def setup_capistrano
161
- template 'Capfile', 'Capfile'
159
+ copy_file 'Capfile', 'Capfile'
162
160
  template 'deploy.rb.erb', 'config/deploy.rb'
163
161
  template 'deploy_production.rb.erb', 'config/deploy/production.rb'
164
162
  template 'deploy_staging.rb.erb', 'config/deploy/staging.rb'
165
163
  template 'capistrano_dotenv.cap', 'lib/capistrano/tasks/dotenv.cap'
166
164
  end
167
165
 
166
+ def configure_simple_form
167
+ if options[:bootstrap]
168
+ generate 'simple_form:install --bootstrap'
169
+ else
170
+ generate 'simple_form:install'
171
+ end
172
+ end
173
+
168
174
  def replace_users_factory
169
175
  remove_file 'spec/factories/users.rb'
170
- template 'users_factory.rb', 'spec/factories/users.rb'
176
+ copy_file 'users_factory.rb', 'spec/factories/users.rb'
171
177
  end
172
178
 
173
179
  def replace_root_controller_spec
174
180
  remove_file 'spec/controllers/root_controller_spec.rb'
175
- template 'root_controller_spec.rb', 'spec/controllers/root_controller_spec.rb'
181
+ copy_file 'root_controller_spec.rb',
182
+ 'spec/controllers/root_controller_spec.rb'
176
183
  end
177
184
 
178
185
  def setup_gitignore
179
- remove_file '.gitignore'
180
- copy_file 'gitignore', '.gitignore'
181
186
  [ 'spec/lib',
182
187
  'spec/controllers',
183
188
  'spec/features',
@@ -88,7 +88,7 @@ module BlueberryRails
88
88
  end
89
89
 
90
90
  def configure_app
91
- build :replace_secret_token
91
+ build :secret_token
92
92
  build :disable_xml_params
93
93
  build :setup_mailer_hosts
94
94
  build :remove_turbolinks
@@ -101,6 +101,8 @@ module BlueberryRails
101
101
  end
102
102
 
103
103
  def setup_gems
104
+ say 'Setting up SimpleForm'
105
+ build :configure_simple_form
104
106
  if options[:devise]
105
107
  say 'Setting up devise'
106
108
  build :install_devise
@@ -1,7 +1,7 @@
1
1
  module BlueberryRails
2
- VERSION = '0.3.3'
2
+ VERSION = '0.3.4'
3
3
 
4
- RUBY_VERSION = '2.1.5'
4
+ RUBY_VERSION = '2.2.1'
5
5
 
6
- RAILS_VERSION = '4.1.9'
6
+ RAILS_VERSION = '4.2.0'
7
7
  end
@@ -1,64 +1,33 @@
1
1
  require 'minitest/autorun'
2
- require 'fileutils'
2
+ require './spec/support/blueberry_rails_helpers.rb'
3
3
 
4
- class BlueberryRailsTest < Minitest::Unit::TestCase
4
+ class BlueberryRailsTest < Minitest::Test
5
+ include BlueberryRailsHelpers
5
6
 
6
7
  def setup
7
- FileUtils.rm_rf 'test_project'
8
+ remove_project_directory
8
9
  cmd 'dropdb test_project_development'
9
10
  cmd 'dropdb test_project_test'
10
-
11
- %w[RUBYOPT BUNDLE_PATH BUNDLE_BIN_PATH BUNDLE_GEMFILE].each do |key|
12
- set_env key, nil
13
- end
14
- end
15
-
16
- def teardown
17
- restore_env
18
- end
19
-
20
- def test_rake_runs_cleanly
21
- create_project 'test_project'
22
- assert run_rake('test_project')
23
- end
24
-
25
- def test_rake_runs_cleanly_with_bootstrap_option
26
- create_project 'test_project', '--bootstrap'
27
- assert run_rake('test_project')
28
11
  end
29
12
 
30
- protected
31
-
32
- def create_project(project_name, options = nil)
33
- bin = File.expand_path(File.join('..', 'bin', 'blueberry_rails'), File.dirname(__FILE__))
34
- cmd "#{bin} #{project_name} #{options}"
35
- end
36
-
37
- def run_rake(project_name)
38
- Dir.chdir(project_name) do
39
- cmd 'bundle exec rake db:create'
40
- cmd 'bundle exec rake db:migrate'
41
- cmd('bundle exec rake')
13
+ def run
14
+ Bundler.with_clean_env do
15
+ super
42
16
  end
43
17
  end
44
18
 
45
- def cmd(command)
46
- system "#{command}"
47
- end
19
+ def test_rake_runs_cleanly
20
+ create_project
48
21
 
49
- def original_env
50
- @original_env ||= {}
22
+ assert_exist_file 'config', 'initializers', 'simple_form.rb'
23
+ assert run_rake
51
24
  end
52
25
 
53
- def set_env(key, value)
54
- original_env[key] = ENV.delete(key)
55
- ENV[key] = value
56
- end
26
+ def test_rake_runs_with_bootstrap_option
27
+ create_project '--bootstrap'
57
28
 
58
- def restore_env
59
- original_env.each do |key, val|
60
- ENV[key] = val
61
- end
29
+ assert_exist_file 'config', 'initializers', 'simple_form.rb'
30
+ assert_exist_file 'config', 'initializers', 'simple_form_bootstrap.rb'
31
+ assert run_rake
62
32
  end
63
-
64
33
  end
@@ -0,0 +1,42 @@
1
+ require 'fileutils'
2
+
3
+ module BlueberryRailsHelpers
4
+ APP_NAME = 'test_project'
5
+
6
+ def remove_project_directory
7
+ FileUtils.rm_rf(project_path)
8
+ end
9
+
10
+ def create_project(options = nil)
11
+ cmd "#{blueberry_rails_bin} #{APP_NAME} #{options}"
12
+ end
13
+
14
+ def run_rake
15
+ Dir.chdir(project_path) do
16
+ cmd 'bundle exec rake db:create'
17
+ cmd 'bundle exec rake db:migrate'
18
+ cmd 'bundle exec rake db:test:prepare'
19
+ cmd 'bundle exec rake'
20
+ end
21
+ end
22
+
23
+ def cmd(command)
24
+ system "#{command}"
25
+ end
26
+
27
+ def project_path
28
+ @project_path ||= Pathname.new("#{root_path}/#{APP_NAME}")
29
+ end
30
+
31
+ def blueberry_rails_bin
32
+ File.join(root_path, 'bin', 'blueberry_rails')
33
+ end
34
+
35
+ def root_path
36
+ File.expand_path('../../../', __FILE__)
37
+ end
38
+
39
+ def assert_exist_file(*path)
40
+ assert File.exists?(File.join(project_path, *path))
41
+ end
42
+ end
@@ -1,8 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- ruby "<%= BlueberryRails::RUBY_VERSION %>"
4
-
5
3
  gem 'airbrake'
4
+ gem 'autoprefixer-rails'
6
5
  <% if options[:bootstrap] -%>
7
6
  gem 'bootstrap-sass'
8
7
  <% end -%>
@@ -15,10 +14,10 @@ gem 'flutie'
15
14
  gem 'jquery-rails'
16
15
  gem 'pg'
17
16
  gem 'rails', '~> <%= BlueberryRails::RAILS_VERSION %>'
18
- gem 'sass-rails', '~> 4.0.4'
17
+ gem 'sass-rails', '~> 5.0'
19
18
  gem 'simple_form'
20
19
  gem 'slim-rails'
21
- gem 'uglifier', '>= 2.5.0'
20
+ gem 'uglifier', '>= 1.3.0'
22
21
  gem 'unicorn'
23
22
 
24
23
  group :development do
@@ -32,6 +31,7 @@ group :development do
32
31
  gem 'mailcatcher'
33
32
  gem 'pry-rails'
34
33
  gem 'spring'
34
+ gem 'web-console', '~> 2.0'
35
35
  end
36
36
 
37
37
  group :development, :test do
File without changes
File without changes
@@ -5,9 +5,7 @@ before_install:
5
5
  - sh -e /etc/init.d/xvfb start
6
6
  before_script:
7
7
  - cp .sample.env .env
8
- <% if options[:database] == "postgresql" %>
9
- - psql -c 'create database "<%= app_name %>_test";' -U postgres
10
- <% end %>
8
+ <% if options[:database] == "postgresql" %> - psql -c 'create database "<%= app_name %>_test";' -U postgres<% end %>
11
9
  branches:
12
10
  only:
13
11
  - master
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blueberry_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - BlueberryApps
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-08 00:00:00.000000000 Z
11
+ date: 2015-03-17 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.1.9
33
+ version: 4.2.0
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.1.9
40
+ version: 4.2.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -61,6 +61,8 @@ extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
63
  - ".gitignore"
64
+ - ".hound.yml"
65
+ - ".rubocop.yml"
64
66
  - ".travis.yml"
65
67
  - Gemfile
66
68
  - LICENSE.txt
@@ -74,9 +76,10 @@ files:
74
76
  - lib/blueberry_rails/generators/app_generator.rb
75
77
  - lib/blueberry_rails/version.rb
76
78
  - spec/blueberry_rails_spec.rb
79
+ - spec/support/blueberry_rails_helpers.rb
77
80
  - templates/Capfile
78
81
  - templates/Gemfile_custom.erb
79
- - templates/README.md.erb
82
+ - templates/README.md
80
83
  - templates/_flashes.html.slim
81
84
  - templates/capistrano_dotenv.cap
82
85
  - templates/database.yml.erb
@@ -87,8 +90,8 @@ files:
87
90
  - templates/disable_xml_params.rb
88
91
  - templates/factories_spec.rb
89
92
  - templates/factory_girl_syntax.rb
90
- - templates/gitignore
91
- - templates/layout.html.slim.erb
93
+ - templates/gitignore_custom
94
+ - templates/layout.html.slim
92
95
  - templates/pryrc.rb
93
96
  - templates/root_controller_spec.rb
94
97
  - templates/secret_token.rb.erb
@@ -115,9 +118,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
118
  version: '0'
116
119
  requirements: []
117
120
  rubyforge_project:
118
- rubygems_version: 2.2.2
121
+ rubygems_version: 2.4.6
119
122
  signing_key:
120
123
  specification_version: 4
121
124
  summary: A Rails app template by BlueberryApps
122
125
  test_files:
123
126
  - spec/blueberry_rails_spec.rb
127
+ - spec/support/blueberry_rails_helpers.rb