blueberry_rails 0.0.1 → 0.0.2

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: c04397bcac9226a5f2d30443e0199d2ef15fc1e7
4
- data.tar.gz: 3d27cedfe3061de5207c7dd714ea0a1afe36ebc4
3
+ metadata.gz: a103dcf937373f4dcb6dfe955b5d4b2ad51fcfb8
4
+ data.tar.gz: 584d36813fcafa3a092d1a256454e349bb2eac52
5
5
  SHA512:
6
- metadata.gz: 9e0485c624a470aedb87c6c65a405a7cb665a2072773677dc3de4b0ff580d11e7084dde8f69a725d0a7b166b1b5e1c084a96fd33cea909bb070cb75c01d60e2c
7
- data.tar.gz: 743d0bd8c7f727feeedf0d2e5ed9e61b29051a82730c7819da980f9fc347b82343f6cea9313714f4aed5a93b49b862ad81279561225303ddbae80313cdc593f2
6
+ metadata.gz: 9fd04e3a6d55fd84003194e1b960edf6bcf7fb0ac3afa3e982963f9b8cb105292347c1b78068711e8974dc132592697e7e6c788c35db307678a1214226a4cbec
7
+ data.tar.gz: ba4c9e804fa8fe617dcc3dcb4d17ba9b5f9ae6e16840cedbe9bcd6f37b7a24a9ead960976deecb3ba27a1b858ad4c34893fedd38d8c445be8f4fdacf56f77e2b
@@ -1,6 +1,11 @@
1
1
  module BlueberryRails
2
2
  module ActionHelpers
3
3
 
4
+ def action_mailer_host(rails_env, host)
5
+ host_config = "config.action_mailer.default_url_options = { host: '#{host}' }"
6
+ configure_environment(rails_env, host_config)
7
+ end
8
+
4
9
  def configure_environment(rails_env, config)
5
10
  inject_into_file("config/environments/#{rails_env}.rb",
6
11
  "\n\n #{config}", before: "\nend")
@@ -9,7 +9,7 @@ module BlueberryRails
9
9
 
10
10
  def replace_gemfile
11
11
  remove_file 'Gemfile'
12
- copy_file 'Gemfile_custom', 'Gemfile'
12
+ template 'Gemfile_custom.erb', 'Gemfile'
13
13
  end
14
14
 
15
15
  def replace_secret_token
@@ -22,6 +22,13 @@ module BlueberryRails
22
22
  copy_file 'disable_xml_params.rb', 'config/initializers/disable_xml_params.rb'
23
23
  end
24
24
 
25
+ def setup_mailer_hosts
26
+ action_mailer_host 'development', "#{app_name}.dev"
27
+ action_mailer_host 'test', 'www.example.com'
28
+ action_mailer_host 'staging', "staging.#{app_name}.com"
29
+ action_mailer_host 'production', "#{app_name}.com"
30
+ end
31
+
25
32
  def set_ruby_to_version_being_used
26
33
  inject_into_file 'Gemfile', "\n\nruby '#{RUBY_VERSION}'",
27
34
  after: /source 'https:\/\/rubygems.org'/
@@ -46,6 +53,7 @@ module BlueberryRails
46
53
  end
47
54
 
48
55
  def create_application_layout
56
+ remove_file 'app/views/layouts/application.html.erb'
49
57
  template 'layout.html.slim.erb',
50
58
  'app/views/layouts/application.html.slim',
51
59
  force: true
@@ -103,6 +111,18 @@ module BlueberryRails
103
111
  "Application.routes.draw do\nend"
104
112
  end
105
113
 
114
+ def install_devise
115
+ generate 'devise:install'
116
+ generate 'controller', 'root index'
117
+ remove_routes_comment_lines
118
+ inject_into_file 'config/routes.rb',
119
+ " root to: 'root#index'\n",
120
+ after: "#{app_const}.routes.draw do\n"
121
+ if options[:devise_model].present?
122
+ generate 'devise', options[:devise_model]
123
+ end
124
+ end
125
+
106
126
  def setup_gitignore
107
127
  remove_file '.gitignore'
108
128
  copy_file 'gitignore', '.gitignore'
@@ -7,8 +7,14 @@ module BlueberryRails
7
7
  class_option :database, :type => :string, :aliases => '-d', :default => 'postgresql',
8
8
  :esc => "Preconfigure for selected database (options: #{DATABASES.join('/')})"
9
9
 
10
- class_option :github, :type => :string, :aliases => '-G', :default => nil,
11
- :desc => 'Create Github repository and add remote origin pointed to repo'
10
+ # class_option :github, :type => :string, :aliases => '-G', :default => nil,
11
+ # :desc => 'Create Github repository and add remote origin pointed to repo'
12
+
13
+ class_option :devise, :type => :boolean, :aliases => '-D', :default => true,
14
+ :desc => 'Include and generate devise'
15
+
16
+ class_option :devise_model, :type => :string, :aliases => '-M', :default => 'User',
17
+ :desc => 'Name of devise model to generate'
12
18
 
13
19
  class_option :skip_test_unit, :type => :boolean, :aliases => '-T', :default => true,
14
20
  :desc => 'Skip Test::Unit files'
@@ -24,8 +30,10 @@ module BlueberryRails
24
30
  invoke :setup_development_environment
25
31
  invoke :setup_test_environment
26
32
  invoke :setup_staging_environment
33
+ invoke :create_views
27
34
  invoke :configure_app
28
35
  invoke :remove_routes_comment_lines
36
+ invoke :setup_gems
29
37
  invoke :setup_git
30
38
  end
31
39
 
@@ -63,15 +71,30 @@ module BlueberryRails
63
71
  build :setup_staging_environment
64
72
  end
65
73
 
74
+ def create_views
75
+ build :create_partials_directory
76
+ build :create_shared_flashes
77
+ build :create_application_layout
78
+ end
79
+
66
80
  def configure_app
67
81
  build :replace_secret_token
68
82
  build :disable_xml_params
83
+ build :setup_mailer_hosts
84
+ build :remove_turbolinks
69
85
  end
70
86
 
71
87
  def remove_routes_comment_lines
72
88
  build :remove_routes_comment_lines
73
89
  end
74
90
 
91
+ def setup_gems
92
+ if options[:devise]
93
+ say 'Setting up devise'
94
+ build :install_devise
95
+ end
96
+ end
97
+
75
98
  def setup_git
76
99
  say 'Initializing git'
77
100
  build :setup_gitignore
@@ -1,3 +1,3 @@
1
1
  module BlueberryRails
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -1,6 +1,9 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'coffee-rails', '~> 4.0.0'
4
+ <% if options[:devise] -%>
5
+ gem 'devise'
6
+ <% end -%>
4
7
  gem 'dotenv-rails'
5
8
  gem 'jquery-rails'
6
9
  gem 'pg'
@@ -1,12 +1,11 @@
1
1
  doctype html
2
2
  html
3
3
  head
4
- title Blueberryapps!:W
4
+ title Blueberryapps!
5
5
  meta charset="utf-8"
6
6
  = stylesheet_link_tag :application, :media => 'all'
7
7
  = csrf_meta_tags
8
8
 
9
-
10
9
  body
11
10
  = render 'flashes'
12
11
  = yield
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.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blueberryapps
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-03 00:00:00.000000000 Z
11
+ date: 2013-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -73,7 +73,7 @@ files:
73
73
  - lib/blueberry_rails/generators/app_generator.rb
74
74
  - lib/blueberry_rails/version.rb
75
75
  - templates/Gemfile
76
- - templates/Gemfile_custom
76
+ - templates/Gemfile_custom.erb
77
77
  - templates/README.md.erb
78
78
  - templates/_flashes.html.slim
79
79
  - templates/database.yml.erb