topkit 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -92,6 +92,36 @@ module Topkit
92
92
  create_file 'app/assets/stylesheets/application.css.scss'
93
93
  end
94
94
 
95
+ def generate_devise
96
+ generate "devise:install"
97
+ generate "devise User"
98
+ bundle_command "exec rake db:migrate"
99
+ generate "devise:views"
100
+ end
101
+
102
+ def add_admin_to_gemfile
103
+ admin_gems = <<-eos
104
+ gem 'devise'
105
+ gem 'rails_admin'
106
+ gem 'rich'
107
+ eos
108
+ inject_into_file 'Gemfile', "\n#{new_gems}", after: /gem 'kaminari'/
109
+ bundle_command "install"
110
+ end
111
+
112
+ def generate_admin
113
+ generate "rails_admin:install"
114
+ end
115
+
116
+ def generate_rich_editor
117
+ generate "rich:install"
118
+ bundle_command "exec rake db:migrate"
119
+ end
120
+
121
+ def generate_cucumber
122
+ generate 'cucumber:install', '--rspec', '--capybara'
123
+ end
124
+
95
125
  def init_git
96
126
  run 'git init'
97
127
  end
@@ -3,7 +3,8 @@ require 'rails/generators/rails/app/app_generator'
3
3
 
4
4
  module Topkit
5
5
  class AppGenerator < Rails::Generators::AppGenerator
6
- class_option :gitlab, type: :string, aliases: '-G', default: false
6
+ #class_option :gitlab, type: :string, aliases: '-G', default: false
7
+ class_option :skip_admin, type: :boolean, aliases: '-A', default: false
7
8
 
8
9
  def finish_template
9
10
  invoke :topkit_customization
@@ -21,6 +22,8 @@ module Topkit
21
22
  invoke :copy_miscellaneous_files
22
23
  invoke :configure_rspec
23
24
  invoke :configure_backbone
25
+ invoke :configure_admin
26
+ invoke :configure_cucumber
24
27
  invoke :setup_git
25
28
  end
26
29
 
@@ -69,14 +72,30 @@ module Topkit
69
72
  end
70
73
 
71
74
  def configure_rspec
75
+ say "Generating rspec"
72
76
  build :generate_rspec
73
77
  build :enable_database_cleaner
74
78
  end
75
79
 
76
80
  def configure_backbone
81
+ say "Generating backbone"
77
82
  build :generate_backbone
78
83
  end
79
84
 
85
+ def configure_admin
86
+ return if options[:skip_admin]
87
+ say "Generating devise with admin"
88
+ build :add_admin_to_gemfile
89
+ build :generate_devise
90
+ build :generate_admin
91
+ build :generate_rich_editor
92
+ end
93
+
94
+ def configure_cucumber
95
+ say "Installing cucumber"
96
+ build :generate_cucumber
97
+ end
98
+
80
99
  def setup_git
81
100
  say "Initializing git repo"
82
101
  build :add_to_git_ignore
@@ -1,3 +1,3 @@
1
1
  module Topkit
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -3,11 +3,10 @@ source 'https://rubygems.org'
3
3
  gem 'rails', '3.2.13'
4
4
 
5
5
  gem 'mysql2'
6
- gem 'jquery-rails'
7
6
  gem 'rails-backbone'
8
7
  gem 'simple_form'
9
- gem 'devise'
10
- gem 'rails_admin'
8
+ gem 'truncate_html'
9
+ gem 'kaminari'
11
10
 
12
11
  group :development, :test do
13
12
  gem 'thin'
@@ -15,14 +14,16 @@ group :development, :test do
15
14
  gem 'rspec-rails'
16
15
  gem 'faker'
17
16
  gem 'factory_girl_rails'
17
+ gem 'selenium-webdriver'
18
18
  end
19
19
 
20
20
  group :development do
21
- gem 'capistrano'
22
21
  gem 'annotate'
22
+ gem 'seed_dump'
23
23
  end
24
24
 
25
25
  group :assets do
26
+ gem 'jquery-rails'
26
27
  gem 'bootstrap-sass'
27
28
  gem 'sass-rails'
28
29
  gem 'coffee-rails'
@@ -32,6 +33,7 @@ end
32
33
 
33
34
  group :test do
34
35
  gem 'database_cleaner'
36
+ gem 'cucumber-rails', :require => false
35
37
  end
36
38
 
37
39
  group :staging, :production do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: topkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: