topkit 0.0.7 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 883024ecb18d8b5f3044a0fe8599aa238fd0ef1c
4
+ data.tar.gz: 0cac84f9a9e1e86bf6c23e8c5dc5275db9ee0dfa
5
+ SHA512:
6
+ metadata.gz: e35a7ad9266c3c74e9166dab123ff41f3c599395a5d24739eb819c93bb898bcce2221c93c6d3fede2e04429d30be0963a1a31f6131fa54b577f5374e823cba79
7
+ data.tar.gz: 8f52356840c0c7bda43742c614118a0f1c7f704fec1d1b4e12ba847287667c560b61912f7dd4b4595f637d65c7a950be3d05bdeac1360fdb6e490971d7510fa3
data/bin/topkit CHANGED
File without changes
@@ -27,16 +27,8 @@ module Topkit
27
27
  copy_file 'Gemfile_clean', 'Gemfile'
28
28
  end
29
29
 
30
- def set_puma_as_default_server
31
- config = <<-RUBY
32
- require 'rack/handler'
33
- Rack::Handler::WEBrick = Rack::Handler.get(:puma)
34
- RUBY
35
- inject_into_file "script/rails", config, before: "require 'rails/commands'"
36
- end
37
-
38
30
  def template_database_file
39
- template 'database.mysql.yml.erb', 'config/database.yml', force: true
31
+ template 'database.pg.yml.erb', 'config/database.yml', force: true
40
32
  end
41
33
 
42
34
  def create_database
@@ -57,13 +49,6 @@ Rack::Handler::WEBrick = Rack::Handler.get(:puma)
57
49
  "Application.routes.draw do\nend"
58
50
  end
59
51
 
60
- def setup_staging_environment
61
- run "cp config/environments/production.rb config/environments/staging.rb"
62
- replace_in_file "config/environments/staging.rb", "config.serve_static_assets = false", "config.serve_static_assets = true"
63
- replace_in_file "config/environments/staging.rb", "config.assets.compile = false", "config.assets.compile = true"
64
- replace_in_file "config/environments/staging.rb", "# config.log_level = :debug", "config.log_level = :debug"
65
- end
66
-
67
52
  def create_partials_directory
68
53
  empty_directory 'app/views/application'
69
54
  end
@@ -91,18 +76,6 @@ Rack::Handler::WEBrick = Rack::Handler.get(:puma)
91
76
  download_file "https://gist.github.com/apcomplete/4113645/download", "vendor/assets/javascripts/backtrace.js"
92
77
  end
93
78
 
94
- def add_relative_url_root
95
- relative_root = <<-eos
96
- #Deploy staging to subdirectory
97
- config.action_controller.relative_url_root = '/#{options[:client]}/#{options[:project]}'
98
- eos
99
- inject_into_file "config/environments/staging.rb", "\n#{relative_root}", after: "config.serve_static_assets = true\n"
100
-
101
- replace_in_file "config.ru",
102
- "run #{app_const}",
103
- %(map ActionController::Base.config.relative_url_root || "/" do\n run #{app_const}\nend)
104
- end
105
-
106
79
  def enable_database_cleaner
107
80
  replace_in_file 'spec/spec_helper.rb',
108
81
  'config.use_transactional_fixtures = true',
@@ -123,25 +96,6 @@ Rack::Handler::WEBrick = Rack::Handler.get(:puma)
123
96
  generate "devise:views"
124
97
  end
125
98
 
126
- def add_admin_to_gemfile
127
- admin_gems = <<-eos
128
- gem 'devise'
129
- gem 'activeadmin'
130
- gem 'rich'
131
- eos
132
- inject_into_file 'Gemfile', "\n#{admin_gems}", after: /gem 'kaminari'/
133
- bundle_command "install"
134
- end
135
-
136
- def generate_admin
137
- generate "active_admin:install"
138
- end
139
-
140
- def generate_rich_editor
141
- generate "rich:install"
142
- bundle_command "exec rake db:migrate"
143
- end
144
-
145
99
  def generate_cucumber
146
100
  generate 'cucumber:install', '--rspec', '--capybara'
147
101
  end
@@ -3,9 +3,6 @@ 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
7
- class_option :skip_admin, type: :boolean, aliases: '-A', default: false,
8
- desc: "Skip rails admin generators"
9
6
  class_option :client, type: :string, desc: "Specify client abbreviation"
10
7
  class_option :project, type: :string, desc: "Specify project number"
11
8
 
@@ -17,17 +14,15 @@ module Topkit
17
14
  def topkit_customization
18
15
  invoke :configure_generators
19
16
  invoke :customize_gemfile
20
- invoke :configure_puma
21
17
  invoke :setup_database
22
18
  invoke :remove_useless_files
23
19
  invoke :remove_routes_comment_lines
24
- invoke :setup_staging_environment
25
20
  invoke :create_views_and_layouts
26
21
  invoke :copy_miscellaneous_files
27
22
  invoke :configure_rspec
28
23
  invoke :configure_backbone
29
- invoke :configure_admin
30
24
  invoke :configure_cucumber
25
+ invoke :generate_devise
31
26
  invoke :setup_git
32
27
  end
33
28
 
@@ -43,10 +38,6 @@ module Topkit
43
38
  bundle_command "package"
44
39
  end
45
40
 
46
- def configure_puma
47
- build :set_puma_as_default_server
48
- end
49
-
50
41
  def setup_database
51
42
  say "Setting up database"
52
43
  build :template_database_file
@@ -62,12 +53,6 @@ module Topkit
62
53
  build :remove_routes_comment_lines
63
54
  end
64
55
 
65
- def setup_staging_environment
66
- say "Setting up staging environment"
67
- build :setup_staging_environment
68
- #build :setup_staging_recipes
69
- end
70
-
71
56
  def create_views_and_layouts
72
57
  say "Creating partials and default layout"
73
58
  build :create_partials_directory
@@ -89,16 +74,11 @@ module Topkit
89
74
  say "Generating backbone"
90
75
  build :generate_backbone
91
76
  build :generate_backtrace
92
- build :add_relative_url_root if options[:client] and options[:project]
93
77
  end
94
78
 
95
- def configure_admin
96
- return if options[:skip_admin]
97
- say "Generating devise with admin"
98
- build :add_admin_to_gemfile
79
+ def generate_devise
80
+ say "Generating Devise"
99
81
  build :generate_devise
100
- build :generate_admin
101
- build :generate_rich_editor
102
82
  end
103
83
 
104
84
  def configure_cucumber
@@ -1,3 +1,3 @@
1
1
  module Topkit
2
- VERSION = "0.0.7"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -1,19 +1,24 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '3.2.13'
3
+ gem 'rails', '4.0.0'
4
+
5
+ gem 'unicorn-rails'
6
+
7
+ gem 'pg'
8
+ gem 'activerecord-postgres-hstore'
4
9
 
5
- gem 'mysql2'
6
10
  gem 'rails-backbone'
7
11
  gem 'simple_form'
8
12
  gem 'truncate_html'
9
13
  gem 'kaminari'
10
- gem 'puma'
14
+ gem 'devise'
11
15
 
12
16
  group :development, :test do
13
17
  gem 'capybara'
14
18
  gem 'rspec-rails'
15
19
  gem 'faker'
16
20
  gem 'factory_girl_rails'
21
+ gem 'shoulda-matchers'
17
22
  gem 'selenium-webdriver'
18
23
  end
19
24
 
@@ -24,7 +29,6 @@ end
24
29
 
25
30
  group :assets do
26
31
  gem 'jquery-rails'
27
- gem 'bootstrap-sass'
28
32
  gem 'sass-rails'
29
33
  gem 'coffee-rails'
30
34
  gem 'uglifier'
@@ -0,0 +1,55 @@
1
+ # PostgreSQL. Versions 8.2 and up are supported.
2
+ #
3
+ # Install the pg driver:
4
+ # gem install pg
5
+ # On Mac OS X with macports:
6
+ # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
7
+ # On Windows:
8
+ # gem install pg
9
+ # Choose the win32 build.
10
+ # Install PostgreSQL and put its /bin directory on your path.
11
+ #
12
+ # Configure Using Gemfile
13
+ # gem 'pg'
14
+ #
15
+ development:
16
+ adapter: postgresql
17
+ encoding: unicode
18
+ database: <%= app_name %>_development
19
+ pool: 5
20
+ username: root
21
+ password: root
22
+
23
+ # Connect on a TCP socket. Omitted by default since the client uses a
24
+ # domain socket that doesn't need configuration. Windows does not have
25
+ # domain sockets, so uncomment these lines.
26
+ #host: localhost
27
+ #port: 5432
28
+
29
+ # Schema search path. The server defaults to $user,public
30
+ #schema_search_path: myapp,sharedapp,public
31
+
32
+ # Minimum log levels, in increasing order:
33
+ # debug5, debug4, debug3, debug2, debug1,
34
+ # log, notice, warning, error, fatal, and panic
35
+ # The server defaults to notice.
36
+ #min_messages: warning
37
+
38
+ # Warning: The database defined as "test" will be erased and
39
+ # re-generated from your development database when you run "rake".
40
+ # Do not set this db to the same as development or production.
41
+ test:
42
+ adapter: postgresql
43
+ encoding: unicode
44
+ database: <%= app_name %>_test
45
+ pool: 5
46
+ username: root
47
+ password: root
48
+
49
+ production:
50
+ adapter: postgresql
51
+ encoding: unicode
52
+ database: <%= app_name %>_production
53
+ pool: 5
54
+ username: root
55
+ password:
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "rails", "~> 3.2"
21
+ spec.add_dependency "rails", "~> 4.0.0"
22
22
  spec.add_dependency "bundler", "~> 1.3"
23
23
 
24
24
  spec.add_development_dependency "rake"
metadata CHANGED
@@ -1,36 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: topkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
5
- prerelease:
4
+ version: 0.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Alex Padgett
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-08-14 00:00:00.000000000 Z
11
+ date: 2013-12-12 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rails
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
- version: '3.2'
19
+ version: 4.0.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
29
- version: '3.2'
26
+ version: 4.0.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: bundler
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
@@ -46,17 +41,15 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  description: Generate rails app with Topic gems, frameworks and layouts
@@ -83,7 +76,7 @@ files:
83
76
  - templates/_header.html.erb
84
77
  - templates/_status.html.erb
85
78
  - templates/application_layout.html.erb
86
- - templates/database.mysql.yml.erb
79
+ - templates/database.pg.yml.erb
87
80
  - templates/database_cleaner_rspec.rb
88
81
  - templates/topkit_gitignore
89
82
  - test/lib/topkit/version_test.rb
@@ -92,27 +85,26 @@ files:
92
85
  homepage: https://github.com/topicdesign/topkit-rails
93
86
  licenses:
94
87
  - MIT
88
+ metadata: {}
95
89
  post_install_message:
96
90
  rdoc_options: []
97
91
  require_paths:
98
92
  - lib
99
93
  required_ruby_version: !ruby/object:Gem::Requirement
100
- none: false
101
94
  requirements:
102
- - - ! '>='
95
+ - - '>='
103
96
  - !ruby/object:Gem::Version
104
97
  version: '0'
105
98
  required_rubygems_version: !ruby/object:Gem::Requirement
106
- none: false
107
99
  requirements:
108
- - - ! '>='
100
+ - - '>='
109
101
  - !ruby/object:Gem::Version
110
102
  version: '0'
111
103
  requirements: []
112
104
  rubyforge_project:
113
- rubygems_version: 1.8.23
105
+ rubygems_version: 2.0.3
114
106
  signing_key:
115
- specification_version: 3
107
+ specification_version: 4
116
108
  summary: Generate a Rails app using Topic Design's conventions. Influenced heavily
117
109
  by thoughtbot's Suspenders and Gaslight's sparkler.
118
110
  test_files:
@@ -1,42 +0,0 @@
1
- # MySQL. Versions 4.1 and 5.0 are recommended.
2
- #
3
- # Install the MYSQL driver
4
- # gem install mysql2
5
- #
6
- # Ensure the MySQL gem is defined in your Gemfile
7
- # gem 'mysql2'
8
- #
9
- # And be sure to use new-style password hashing:
10
- # http://dev.mysql.com/doc/refman/5.0/en/old-client.html
11
- development:
12
- adapter: mysql2
13
- encoding: utf8
14
- reconnect: false
15
- database: <%= app_name %>_development
16
- pool: 5
17
- username: root
18
- password: root
19
- socket: /tmp/mysql.sock
20
-
21
- # Warning: The database defined as "test" will be erased and
22
- # re-generated from your development database when you run "rake".
23
- # Do not set this db to the same as development or production.
24
- test:
25
- adapter: mysql2
26
- encoding: utf8
27
- reconnect: false
28
- database: <%= app_name %>_test
29
- pool: 5
30
- username: root
31
- password: root
32
- socket: /tmp/mysql.sock
33
-
34
- production:
35
- adapter: mysql2
36
- encoding: utf8
37
- reconnect: false
38
- database: <%= app_name %>_production
39
- pool: 5
40
- username: root
41
- password:
42
- socket: /tmp/mysql.sock