compass_ae_starter_kit 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/compass_ae_starter_kit.rb +1 -0
- data/lib/compass_ae_starter_kit/commands/compass_ae.rb +39 -22
- data/lib/compass_ae_starter_kit/templates/default_template.rb +3 -6
- data/lib/compass_ae_starter_kit/templates/development_template.rb +3 -6
- data/lib/compass_ae_starter_kit/version.rb +1 -1
- metadata +7 -6
@@ -1,8 +1,10 @@
|
|
1
1
|
module CompassAeStarterKit
|
2
|
+
RAILS_MAJOR = 3
|
3
|
+
RAILS_MINOR = 1
|
4
|
+
RAILS_TINY = '*'
|
2
5
|
class CompassAE
|
3
6
|
class << self
|
4
|
-
|
5
|
-
def banner
|
7
|
+
def banner
|
6
8
|
%(
|
7
9
|
Usage:
|
8
10
|
compass_ae new <app_name> [rails_opt] Creates a new Rails Compass AE Application
|
@@ -11,35 +13,50 @@ Usage:
|
|
11
13
|
compass_ae dev <app_name> [rails_opt] Creates a new Rails Compass AE Application and clones our repository and points the Compass AE gems to it
|
12
14
|
rails_opt: all the options accepted by the rails command
|
13
15
|
|
14
|
-
compass_ae --help|-h
|
16
|
+
compass_ae --help|-h This help screen
|
15
17
|
)
|
16
18
|
end
|
17
19
|
|
18
20
|
def run
|
19
|
-
|
21
|
+
#Get rails version
|
22
|
+
major, minor, tiny = `rails -v`.gsub!('Rails ', '').gsub!("\n",'').split('.').collect{|version| version.to_i}
|
23
|
+
if version_allowed?(RAILS_MAJOR, major) and version_allowed?(RAILS_MINOR, minor) and version_allowed?(RAILS_TINY, tiny)
|
24
|
+
template_path = File.join(File.dirname(__FILE__), '../templates/default_template.rb')
|
20
25
|
|
21
|
-
|
22
|
-
|
23
|
-
|
26
|
+
if ARGV.first != "new" and ARGV.first != "dev"
|
27
|
+
ARGV[0] = "--help"
|
28
|
+
end
|
24
29
|
|
25
|
-
|
26
|
-
|
27
|
-
|
30
|
+
if ARGV.first == "dev"
|
31
|
+
template_path = File.join(File.dirname(__FILE__), '../templates/development_template.rb')
|
32
|
+
ARGV[0] = "new"
|
33
|
+
end
|
34
|
+
|
35
|
+
command = ARGV.shift
|
36
|
+
case command
|
37
|
+
when '--help'
|
38
|
+
puts self.banner
|
39
|
+
when 'new'
|
40
|
+
app_name = ARGV.shift
|
41
|
+
raise "The application name is missing!" if app_name.nil?
|
42
|
+
puts 'Generating Rails infrastructure...'
|
43
|
+
system "rails new #{app_name} #{ARGV * ' '} -m #{template_path}"
|
44
|
+
Dir.chdir app_name
|
45
|
+
system "rake db:migrate"
|
46
|
+
system "rake db:migrate_data"
|
47
|
+
end
|
48
|
+
else
|
49
|
+
puts "Installed Rails version is not compatible #{[major, minor, tiny].compact.join('.')}, please install #{[RAILS_MAJOR, RAILS_MINOR, RAILS_TINY].compact.join('.')}"
|
28
50
|
end
|
29
51
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
raise "The application name is missing!" if app_name.nil?
|
37
|
-
puts 'Generating Rails infrastructure...'
|
38
|
-
system "rails new #{app_name} #{ARGV * ' '} -m #{template_path}"
|
39
|
-
Dir.chdir app_name
|
40
|
-
system "rake db:migrate"
|
41
|
-
system "rake db:migrate_data"
|
52
|
+
end
|
53
|
+
|
54
|
+
def version_allowed?(allowed_version, version)
|
55
|
+
result = true
|
56
|
+
unless(allowed_version == '*')
|
57
|
+
result = (allowed_version == version)
|
42
58
|
end
|
59
|
+
result
|
43
60
|
end
|
44
61
|
|
45
62
|
end#self
|
@@ -5,16 +5,13 @@ FileUtils.cp File.join(File.dirname(__FILE__),'../../../public','index.html'), '
|
|
5
5
|
|
6
6
|
CompassAeStarterKit::FileSupport.patch_file 'config/initializers/session_store.rb',
|
7
7
|
"# #{app_const}.config.session_store :active_record_store",
|
8
|
-
"#{app_const}.config.session_store :active_record_store",
|
8
|
+
"#{app_const}.config.session_store :active_record_store #use active_record for session storage, this is needed for knitkit",
|
9
9
|
:patch_mode => :change
|
10
10
|
|
11
11
|
CompassAeStarterKit::FileSupport.patch_file 'config/routes.rb',
|
12
12
|
"#{app_const}.routes.draw do",
|
13
|
-
"
|
14
|
-
|
15
|
-
mount Knitkit::Engine => '/knitkit'
|
16
|
-
mount ErpTechSvcs::Engine => '/erp_tech_svcs'
|
17
|
-
mount CompassAeConsole::Engine => '/compass_ae_console'",
|
13
|
+
" #mount CompassAE engines
|
14
|
+
ErpBaseErpSvcs.mount_compass_ae_engines(self)",
|
18
15
|
:patch_mode => :insert_after
|
19
16
|
|
20
17
|
CompassAeStarterKit::FileSupport.patch_file 'config/environments/production.rb',
|
@@ -5,16 +5,13 @@ FileUtils.cp File.join(File.dirname(__FILE__),'../../../public','index.html'), '
|
|
5
5
|
|
6
6
|
CompassAeStarterKit::FileSupport.patch_file 'config/initializers/session_store.rb',
|
7
7
|
"# #{app_const}.config.session_store :active_record_store",
|
8
|
-
"#{app_const}.config.session_store :active_record_store",
|
8
|
+
"#{app_const}.config.session_store :active_record_store #use active_record for session storage, this is needed for knitkit",
|
9
9
|
:patch_mode => :change
|
10
10
|
|
11
11
|
CompassAeStarterKit::FileSupport.patch_file 'config/routes.rb',
|
12
12
|
"#{app_const}.routes.draw do",
|
13
|
-
"
|
14
|
-
|
15
|
-
mount Knitkit::Engine => '/knitkit'
|
16
|
-
mount ErpTechSvcs::Engine => '/erp_tech_svcs'
|
17
|
-
mount CompassAeConsole::Engine => '/compass_ae_console'",
|
13
|
+
" #mount CompassAE engines
|
14
|
+
ErpBaseErpSvcs.mount_compass_ae_engines(self)",
|
18
15
|
:patch_mode => :insert_after
|
19
16
|
|
20
17
|
CompassAeStarterKit::FileSupport.patch_file 'config/environments/production.rb',
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compass_ae_starter_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &82892770 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 3.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *82892770
|
25
25
|
description: Contains compass_ae command to create a new Compass AE application
|
26
26
|
email:
|
27
27
|
- russonrails@gmail.com
|
@@ -41,7 +41,8 @@ files:
|
|
41
41
|
- public/index.html
|
42
42
|
- GPL-3-LICENSE
|
43
43
|
- README.md
|
44
|
-
-
|
44
|
+
- !binary |-
|
45
|
+
YmluL2NvbXBhc3NfYWU=
|
45
46
|
homepage: http://development.compassagile.com
|
46
47
|
licenses: []
|
47
48
|
post_install_message:
|
@@ -62,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
63
|
version: '0'
|
63
64
|
requirements: []
|
64
65
|
rubyforge_project:
|
65
|
-
rubygems_version: 1.8.
|
66
|
+
rubygems_version: 1.8.10
|
66
67
|
signing_key:
|
67
68
|
specification_version: 3
|
68
69
|
summary: Gem to help get the Compass AE framework up a running
|