blueberry_rails 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/blueberry_rails/action_helpers.rb +5 -0
- data/lib/blueberry_rails/app_builder.rb +21 -1
- data/lib/blueberry_rails/generators/app_generator.rb +25 -2
- data/lib/blueberry_rails/version.rb +1 -1
- data/templates/{Gemfile_custom → Gemfile_custom.erb} +3 -0
- data/templates/layout.html.slim.erb +1 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a103dcf937373f4dcb6dfe955b5d4b2ad51fcfb8
|
4
|
+
data.tar.gz: 584d36813fcafa3a092d1a256454e349bb2eac52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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
|
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.
|
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-
|
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
|