erp_dev_svcs 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/compass-util +54 -0
- data/lib/erp_dev_svcs.rb +3 -0
- data/lib/erp_dev_svcs/commands/build_gems.rb +64 -0
- data/lib/erp_dev_svcs/commands/git.rb +19 -0
- data/lib/erp_dev_svcs/commands/helper.rb +142 -0
- data/lib/erp_dev_svcs/commands/new_gem_owner.rb +44 -0
- data/lib/erp_dev_svcs/commands/push_gems.rb +63 -0
- data/lib/erp_dev_svcs/commands/setup_dev_env.rb +53 -0
- data/lib/erp_dev_svcs/commands/test.rb +38 -0
- data/lib/erp_dev_svcs/commands/uninstall_gems.rb +39 -0
- data/lib/erp_dev_svcs/controller_support/controller_support.rb +12 -7
- data/lib/erp_dev_svcs/engine.rb +5 -0
- data/lib/erp_dev_svcs/version.rb +7 -1
- metadata +75 -65
data/bin/compass-util
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
command = ARGV.shift
|
4
|
+
|
5
|
+
case command
|
6
|
+
|
7
|
+
when 'new_gem_owner'
|
8
|
+
require 'erp_dev_svcs/commands/new_gem_owner'
|
9
|
+
#require 'erp_dev_svcs/factory_support'
|
10
|
+
ErpDevSvcs::Commands::NewGemOwner.execute
|
11
|
+
when 'build_gems'
|
12
|
+
require 'erp_dev_svcs/commands/build_gems'
|
13
|
+
ErpDevSvcs::Commands::BuildGems.execute
|
14
|
+
when 'git'
|
15
|
+
require 'erp_dev_svcs/commands/git'
|
16
|
+
ErpDevSvcs::Commands::Git.execute
|
17
|
+
when 'test'
|
18
|
+
require 'erp_dev_svcs/commands/test'
|
19
|
+
ErpDevSvcs::Commands::Test.execute
|
20
|
+
when 'setup_dev_env'
|
21
|
+
require 'erp_dev_svcs/commands/setup_dev_env'
|
22
|
+
ErpDevSvcs::Commands::SetupDevEnv.execute
|
23
|
+
when 'push_gems'
|
24
|
+
require 'erp_dev_svcs/commands/push_gems'
|
25
|
+
ErpDevSvcs::Commands::PushGems.execute
|
26
|
+
when 'uninstall_gems'
|
27
|
+
require 'erp_dev_svcs/commands/uninstall_gems'
|
28
|
+
ErpDevSvcs::Commands::UninstallGems.execute
|
29
|
+
else
|
30
|
+
puts <<-EOT
|
31
|
+
Usage: compass-util COMMAND [ARGS]
|
32
|
+
|
33
|
+
This app contains utility programs for Compass developers:
|
34
|
+
|
35
|
+
build_gems Defaults to building all gems in the lib
|
36
|
+
directory. You can also pass specific
|
37
|
+
gems.
|
38
|
+
|
39
|
+
new_gem_owner This command will add a new owner to the
|
40
|
+
compass gems on rubygems.org
|
41
|
+
|
42
|
+
git This will execute the supplied git command
|
43
|
+
on each compass application (ie. fetch, pull,status, etc)
|
44
|
+
|
45
|
+
test Execute the RSpec test suite in each mountable engine
|
46
|
+
|
47
|
+
setup_dev_env Creates dev Gemfiles, runs bundler update in each engine
|
48
|
+
so tests will work
|
49
|
+
push_gems Push gems to ruby gems or geminabox
|
50
|
+
|
51
|
+
uninstall_gems Uninstall installed gems
|
52
|
+
EOT
|
53
|
+
exit(1)
|
54
|
+
end
|
data/lib/erp_dev_svcs.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
#compass libraries
|
2
2
|
require 'erp_base_erp_svcs'
|
3
3
|
|
4
|
+
require "erp_dev_svcs/version"
|
4
5
|
require "erp_dev_svcs/engine"
|
5
6
|
require 'factory_girl'
|
7
|
+
require 'erp_dev_svcs/commands/build_gems'
|
6
8
|
require 'erp_dev_svcs/factory_support'
|
9
|
+
require "erp_dev_svcs/commands/new_gem_owner"
|
7
10
|
require 'erp_dev_svcs/controller_support/controller_support'
|
8
11
|
|
9
12
|
module ErpDevSvcs
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
require 'erp_dev_svcs/commands/helper'
|
3
|
+
|
4
|
+
module ErpDevSvcs
|
5
|
+
module Commands
|
6
|
+
class BuildGems
|
7
|
+
|
8
|
+
def self.execute
|
9
|
+
new()
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
options = {:install => false,
|
14
|
+
:gems => nil}
|
15
|
+
|
16
|
+
opt_parser = OptionParser.new do |opt|
|
17
|
+
opt.banner = "Usage: compass-util build_gems [OPTIONS]"
|
18
|
+
|
19
|
+
opt.on("-g", "--gems [GEMLIST]", Array,
|
20
|
+
"List of gems to build; defaults to all") {|gem| options[:gems] = gem}
|
21
|
+
|
22
|
+
opt.on("-i", "--install",nil,
|
23
|
+
"Install the gem locally after it's built") do |x|
|
24
|
+
options[:install] = true
|
25
|
+
end
|
26
|
+
|
27
|
+
opt.on("-n", "--no-docs",nil,
|
28
|
+
"Use --no-ri --no-rdoc") do |x|
|
29
|
+
options[:no_docs] = true
|
30
|
+
end
|
31
|
+
|
32
|
+
opt.on_tail("-h", "--help", "Show this message") do
|
33
|
+
puts opt
|
34
|
+
exit
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
opt_parser.parse!
|
39
|
+
|
40
|
+
ErpDevSvcs::Commands::Helper.exec_in_engines(options[:gems]) do |engine_name|
|
41
|
+
old_gem_files = Dir.glob("*.gem")
|
42
|
+
old_gem_files.each {|x| File.delete(x); puts "\nDeleting old gem: #{x}"}
|
43
|
+
|
44
|
+
puts "Starting build of #{engine_name}"
|
45
|
+
build_result = %x[gem build #{engine_name}.gemspec]
|
46
|
+
puts build_result
|
47
|
+
|
48
|
+
if options[:install]
|
49
|
+
gem_file = Dir.glob("*.gem")
|
50
|
+
puts "Installing #{gem_file[0]}..."
|
51
|
+
install_result = if options[:no_docs]
|
52
|
+
%x[gem install #{gem_file[0]} --no-ri --no-rdoc]
|
53
|
+
else
|
54
|
+
%x[gem install #{gem_file[0]}]
|
55
|
+
end
|
56
|
+
puts install_result
|
57
|
+
end
|
58
|
+
puts "\n"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'erp_dev_svcs/commands/helper'
|
2
|
+
|
3
|
+
module ErpDevSvcs
|
4
|
+
module Commands
|
5
|
+
class Git
|
6
|
+
|
7
|
+
def self.execute
|
8
|
+
new()
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize
|
12
|
+
ErpDevSvcs::Commands::Helper.exec_in_dirs do
|
13
|
+
git_result = %x[git #{ARGV[0]}]
|
14
|
+
puts git_result
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,142 @@
|
|
1
|
+
module ErpDevSvcs
|
2
|
+
module Commands
|
3
|
+
class Helper
|
4
|
+
COMPASS_ROOT = "lib/compass_agile_enterprise"
|
5
|
+
COMMERCIAL_ROOT = "lib/truenorth"
|
6
|
+
|
7
|
+
KEY_ENGINES = {0 => 'erp_base_erp_svcs/erp_base_erp_svcs.gemspec',
|
8
|
+
1 => 'erp_tech_svcs/erp_tech_svcs.gemspec',
|
9
|
+
2 => 'erp_dev_svcs/erp_dev_svcs.gemspec',
|
10
|
+
3 => 'erp_app/erp_app.gemspec',
|
11
|
+
4 => 'erp_agreements/erp_agreements.gemspec',
|
12
|
+
5 => 'erp_products/erp_products.gemspec',
|
13
|
+
6 => 'erp_orders/erp_orders.gemspec',
|
14
|
+
7 => 'erp_txns_and_accts/erp_txns_and_accts.gemspec',
|
15
|
+
8 => 'erp_commerce/erp_commerce.gemspec',
|
16
|
+
9 => 'erp_inventory/erp_inventory.gemspec',
|
17
|
+
10 => 'erp_work_effort/erp_work_effort.gemspec'}
|
18
|
+
|
19
|
+
def self.find_rails_root!
|
20
|
+
if in_rails_application?
|
21
|
+
return
|
22
|
+
else
|
23
|
+
Dir.chdir("..")
|
24
|
+
find_rails_root!
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.in_rails_application?
|
29
|
+
File.exists?(File.join('config', 'boot.rb'))
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.sort_gems gemspecs
|
33
|
+
KEY_ENGINES.each do |key, val|
|
34
|
+
gemspecs.delete(val)
|
35
|
+
end
|
36
|
+
KEY_ENGINES.each do |key, val|
|
37
|
+
gemspecs.insert(key, val)
|
38
|
+
end
|
39
|
+
gemspecs
|
40
|
+
end
|
41
|
+
|
42
|
+
##
|
43
|
+
#Will set the cwd to each engine under
|
44
|
+
#compass/lib and execute the block passed in.
|
45
|
+
#Will return cwd to lib/compass.
|
46
|
+
#
|
47
|
+
#This method also accepts an alternate parameter of
|
48
|
+
#an array with engine names in it. If present,the
|
49
|
+
#block will only be executed on the engines listed in
|
50
|
+
#that array
|
51
|
+
def self.exec_in_engines(only_in_these_gems = nil)
|
52
|
+
|
53
|
+
code_dirs = [COMPASS_ROOT, COMMERCIAL_ROOT]
|
54
|
+
code_dirs.each do |code_dir|
|
55
|
+
begin
|
56
|
+
find_rails_root!
|
57
|
+
Dir.chdir(code_dir)
|
58
|
+
root_dir = Dir.pwd
|
59
|
+
|
60
|
+
#we're using gemspecs to know that we have
|
61
|
+
#a mountable engine located there
|
62
|
+
gemspecs = Dir.glob("**/*.gemspec")
|
63
|
+
gemspecs = sort_gems(gemspecs) if code_dir == COMPASS_ROOT
|
64
|
+
gemspecs.each do |gem|
|
65
|
+
#XXX:we're skipping compass_ae since all it does is
|
66
|
+
#help install compass
|
67
|
+
next if gem == "compass_ae.gemspec"
|
68
|
+
gemspec = /(.*)\/(.*.gemspec)/.match(gem)
|
69
|
+
#set engine name to the submatch via "[1]"
|
70
|
+
engine_name = /(.*).gemspec/.match(gemspec[2])[1]
|
71
|
+
|
72
|
+
if only_in_these_gems.nil? || only_in_these_gems.include?(engine_name)
|
73
|
+
Dir.chdir(gemspec[1])
|
74
|
+
#pass in the engine name
|
75
|
+
yield engine_name
|
76
|
+
Dir.chdir(root_dir)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
rescue Errno::ENOENT
|
80
|
+
puts "#{code_dir} does not exist; skipping..."
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
|
86
|
+
##
|
87
|
+
#This will cd into the COMPASS_ROOT and COMMERCIAL_DIR
|
88
|
+
#and execute the passed block; in COMMERCIAL_DIR, it will
|
89
|
+
#cd to the subdir and execute each command. The assumption here
|
90
|
+
#is that you're trying to perform a command on individual repos
|
91
|
+
def self.exec_in_dirs
|
92
|
+
begin
|
93
|
+
find_rails_root!
|
94
|
+
Dir.chdir(COMPASS_ROOT)
|
95
|
+
puts "Operating on compass root dir..."
|
96
|
+
yield
|
97
|
+
|
98
|
+
find_rails_root!
|
99
|
+
Dir.chdir(COMMERCIAL_ROOT)
|
100
|
+
root_dir = Dir.pwd
|
101
|
+
puts "Now operating on commercial repos..."
|
102
|
+
Dir.foreach(".") do |dir_item|
|
103
|
+
next if dir_item == '..' || dir_item == '.'
|
104
|
+
if File.directory?(dir_item)
|
105
|
+
Dir.chdir(dir_item)
|
106
|
+
puts "\nChanging to #{dir_item}...\n"
|
107
|
+
yield
|
108
|
+
Dir.chdir(root_dir)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
rescue Errno::ENOENT => e
|
112
|
+
puts "#{e.message} does not exist; skipping..."
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
def self.compass_gem_names
|
117
|
+
[:erp_base_erp_svcs,
|
118
|
+
:erp_dev_svcs,
|
119
|
+
:erp_tech_svcs,
|
120
|
+
:erp_app,
|
121
|
+
:erp_forms,
|
122
|
+
:erp_agreements,
|
123
|
+
:erp_products,
|
124
|
+
:erp_orders,
|
125
|
+
:erp_txns_and_accts,
|
126
|
+
:erp_commerce,
|
127
|
+
:erp_inventory,
|
128
|
+
:erp_communication_events,
|
129
|
+
:erp_rules,
|
130
|
+
:erp_work_effort,
|
131
|
+
:erp_invoicing,
|
132
|
+
:erp_financial_accounting,
|
133
|
+
:compass_ae_console,
|
134
|
+
:knitkit,
|
135
|
+
:rails_db_admin,
|
136
|
+
:compass_ae_starter_kit,
|
137
|
+
:erp_search]
|
138
|
+
end
|
139
|
+
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
require 'erp_dev_svcs/commands/helper'
|
3
|
+
|
4
|
+
module ErpDevSvcs
|
5
|
+
module Commands
|
6
|
+
class NewGemOwner
|
7
|
+
|
8
|
+
def self.execute
|
9
|
+
new()
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
options = {}
|
14
|
+
|
15
|
+
gem_names = ErpDevSvcs::Commands::Helper.compass_gem_names
|
16
|
+
|
17
|
+
opt_parser = OptionParser.new do |opt|
|
18
|
+
opt.banner = "Usage: compass-util new_gem_owner --emails LISTOFEMAILS"
|
19
|
+
|
20
|
+
opt.on("-e", "--emails LISTOFEMAILS", Array,
|
21
|
+
"comma seperated list of email addresses of the users "\
|
22
|
+
"you want to own the compass gems") {|emails| options[:emails] = emails}
|
23
|
+
|
24
|
+
opt.on_tail("-h", "--help", "Show this message") do
|
25
|
+
puts opt
|
26
|
+
exit
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
opt_parser.parse!
|
31
|
+
|
32
|
+
puts opt_parser; exit if options[:emails].nil?
|
33
|
+
|
34
|
+
ErpDevSvcs::Commands::Helper.exec_in_engines do |engine_name|
|
35
|
+
options[:emails].each do |email|
|
36
|
+
puts "Adding #{email} as an owner on #{engine_name}"
|
37
|
+
result = %x[gem owner #{engine_name} -a #{email}]
|
38
|
+
puts result
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
require 'erp_dev_svcs/commands/helper'
|
3
|
+
|
4
|
+
module ErpDevSvcs
|
5
|
+
module Commands
|
6
|
+
class PushGems
|
7
|
+
|
8
|
+
def self.execute
|
9
|
+
new()
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
options = {}
|
14
|
+
|
15
|
+
optparse = OptionParser.new do|opts|
|
16
|
+
opts.banner = "Usage: compass-util push_gems [options]"
|
17
|
+
|
18
|
+
options[:verbose] = false
|
19
|
+
opts.on('-v', '--verbose', 'Output more information') do
|
20
|
+
options[:verbose] = true
|
21
|
+
end
|
22
|
+
|
23
|
+
options[:ruby_gems] = false
|
24
|
+
opts.on('-r', '--ruby_gems', 'push to ruby gems') do
|
25
|
+
options[:ruby_gems] = true
|
26
|
+
end
|
27
|
+
|
28
|
+
options[:geminabox] = true
|
29
|
+
opts.on('-b', '--geminabox', 'push to geminabox') do
|
30
|
+
options[:geminabox] = true
|
31
|
+
options[:ruby_gems] = false
|
32
|
+
end
|
33
|
+
|
34
|
+
opts.on("-g", "--gems [GEMLIST]", Array,
|
35
|
+
"List of engines to operate on;"\
|
36
|
+
"defaults to all") {|engines| options[:engines] = engines}
|
37
|
+
|
38
|
+
opts.on_tail("-h", "--help", "Show this message") do
|
39
|
+
puts opts
|
40
|
+
exit
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
optparse.parse!
|
45
|
+
|
46
|
+
ErpDevSvcs::Commands::Helper.exec_in_engines(options[:gems]) do |engine_name|
|
47
|
+
gem_file = Dir.glob("*.gem")[0]
|
48
|
+
|
49
|
+
if options[:ruby_gems]
|
50
|
+
result = %x[gem push #{gem_file}]
|
51
|
+
puts result if options[:verbose]
|
52
|
+
end
|
53
|
+
|
54
|
+
if options[:geminabox]
|
55
|
+
result = %x[gem inabox #{gem_file}]
|
56
|
+
puts result if options[:verbose]
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
require 'erp_dev_svcs/commands/helper'
|
3
|
+
|
4
|
+
module ErpDevSvcs
|
5
|
+
module Commands
|
6
|
+
class SetupDevEnv
|
7
|
+
|
8
|
+
def self.execute
|
9
|
+
new()
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
options = {:engines => nil,
|
14
|
+
:create_gemfiles => false,
|
15
|
+
:bundle => false}
|
16
|
+
|
17
|
+
opt_parser = OptionParser.new do |opt|
|
18
|
+
opt.banner = "Usage: compass-util test [OPTIONS]"
|
19
|
+
|
20
|
+
opt.on("-g", "--gems [GEMLIST]", Array,
|
21
|
+
"List of engines to operate on;"\
|
22
|
+
"defaults to all") {|engines| options[:engines] = engines}
|
23
|
+
opt.on("-c", "--create-gemfiles", nil,
|
24
|
+
"Create Gemfiles in engines from Gemfile.example") do |x|
|
25
|
+
options[:create_gemfiles] = true
|
26
|
+
end
|
27
|
+
opt.on("-b", "--bundle-engines", nil,
|
28
|
+
"Run 'bundle install' in engines") {|x| options[:bundle] = true}
|
29
|
+
opt.on_tail("-h", "--help", "Show this message") do
|
30
|
+
puts opt
|
31
|
+
exit
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
opt_parser.parse!
|
36
|
+
|
37
|
+
if options[:create_gemfiles] == false && options[:bundle] == false
|
38
|
+
puts opt_parser
|
39
|
+
exit
|
40
|
+
end
|
41
|
+
|
42
|
+
ErpDevSvcs::Commands::Helper.exec_in_engines(options[:engines]) do |engine_name|
|
43
|
+
puts "\nOperating on engine #{engine_name}... \n"
|
44
|
+
puts %x[cp Gemfile.example Gemfile] if options[:create_gemfiles] == true
|
45
|
+
puts %x[bundle update] if options[:bundle] == true
|
46
|
+
#result = %x[cp Gemfile.example Gemfile]
|
47
|
+
#puts result
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
require 'erp_dev_svcs/commands/helper'
|
3
|
+
|
4
|
+
module ErpDevSvcs
|
5
|
+
module Commands
|
6
|
+
class Test
|
7
|
+
|
8
|
+
def self.execute
|
9
|
+
new()
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
options = {:gems => nil}
|
14
|
+
|
15
|
+
opt_parser = OptionParser.new do |opt|
|
16
|
+
opt.banner = "Usage: compass-util test [OPTIONS]"
|
17
|
+
|
18
|
+
opt.on("-g", "--gems [GEMLIST]", Array,
|
19
|
+
"List of engines to test;"\
|
20
|
+
"defaults to all") {|gem| options[:gems] = gem}
|
21
|
+
|
22
|
+
opt.on_tail("-h", "--help", "Show this message") do
|
23
|
+
puts opt
|
24
|
+
exit
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
opt_parser.parse!
|
29
|
+
ErpDevSvcs::Commands::Helper.exec_in_engines(options[:gems]) do |engine_name|
|
30
|
+
puts "\nRunning #{engine_name}'s test suite... \n"
|
31
|
+
result = %x[bundle exec rspec --tty --color spec]
|
32
|
+
puts result
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
require 'erp_dev_svcs/commands/helper'
|
3
|
+
|
4
|
+
module ErpDevSvcs
|
5
|
+
module Commands
|
6
|
+
class UninstallGems
|
7
|
+
|
8
|
+
def self.execute
|
9
|
+
new()
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
options = {:install => false, :gems => nil}
|
14
|
+
|
15
|
+
opt_parser = OptionParser.new do |opt|
|
16
|
+
opt.banner = "Usage: compass-util uninstall_gems"
|
17
|
+
|
18
|
+
opt.on("-g", "--gems [GEMLIST]", Array,
|
19
|
+
"List of gems to uninstall; defaults to all") {|gem| options[:gems] = gem}
|
20
|
+
|
21
|
+
opt.on_tail("-h", "--help", "Show this message") do
|
22
|
+
puts opt
|
23
|
+
exit
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
opt_parser.parse!
|
28
|
+
|
29
|
+
ErpDevSvcs::Commands::Helper.exec_in_engines(options[:gems]) do |engine_name|
|
30
|
+
puts "Uninstalling gem #{engine_name}"
|
31
|
+
result = %x[gem uninstall #{engine_name}]
|
32
|
+
puts result
|
33
|
+
puts "\n"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -9,25 +9,25 @@ module ErpDevSvcs
|
|
9
9
|
#TODO: Make this method only available to controller tests
|
10
10
|
def basic_user_auth
|
11
11
|
|
12
|
-
@business_party_type =
|
13
|
-
@party =
|
12
|
+
@business_party_type = FactoryGirl.create(:individual)
|
13
|
+
@party = FactoryGirl.create(:individual_party, :business_party => @business_party_type)
|
14
14
|
|
15
|
-
@pref_opt1 =
|
16
|
-
@pref_type1 =
|
15
|
+
@pref_opt1 = FactoryGirl.create(:preference_option)
|
16
|
+
@pref_type1 = FactoryGirl.create(:preference_type)
|
17
17
|
|
18
18
|
|
19
|
-
@pref_opt2 =
|
19
|
+
@pref_opt2 = FactoryGirl.create(:preference_option,
|
20
20
|
:description => "Blue",
|
21
21
|
:internal_identifier => "blue_extjs_theme",
|
22
22
|
:value => "ext-all.css")
|
23
23
|
|
24
|
-
@pref_type2 =
|
24
|
+
@pref_type2 = FactoryGirl.create(:preference_type,
|
25
25
|
:description => "Theme",
|
26
26
|
:internal_identifier => "extjs_theme")
|
27
27
|
|
28
28
|
#@request.env["devise.mapping"] = Devise.mappings[User.find(1)]
|
29
29
|
salt = 'asdasdastr4325234324sdfds'
|
30
|
-
@user =
|
30
|
+
@user = FactoryGirl.create(:user, :party => @party,
|
31
31
|
:salt => salt,
|
32
32
|
:crypted_password => Sorcery::CryptoProviders::BCrypt.encrypt("password", salt),
|
33
33
|
:activation_state => 'active')
|
@@ -35,5 +35,10 @@ module ErpDevSvcs
|
|
35
35
|
|
36
36
|
@user
|
37
37
|
end
|
38
|
+
|
39
|
+
def basic_user_auth_with_admin
|
40
|
+
@user = User.find_by_username('admin')
|
41
|
+
login_user(@user)
|
42
|
+
end
|
38
43
|
end
|
39
44
|
end
|
data/lib/erp_dev_svcs/engine.rb
CHANGED
data/lib/erp_dev_svcs/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erp_dev_svcs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,22 @@ 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: erp_base_erp_svcs
|
16
|
-
requirement: &
|
16
|
+
requirement: &71328750 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - =
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 3.0.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *71328750
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: cucumber-rails
|
27
|
-
requirement: &
|
27
|
+
requirement: &71353310 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.1.1
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *71353310
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: database_cleaner
|
38
|
-
requirement: &
|
38
|
+
requirement: &71352720 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *71352720
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: factory_girl_rails
|
49
|
-
requirement: &
|
49
|
+
requirement: &71351930 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.3.0
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *71351930
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rspec-rails
|
60
|
-
requirement: &
|
60
|
+
requirement: &71350490 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '2.7'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *71350490
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: simplecov
|
71
|
-
requirement: &
|
71
|
+
requirement: &71348520 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0.5'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *71348520
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: spork
|
82
|
-
requirement: &
|
82
|
+
requirement: &71347610 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ~>
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: 0.9.0.rc
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *71347610
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: sqlite3
|
93
|
-
requirement: &
|
93
|
+
requirement: &71346700 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ~>
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: 1.3.4
|
99
99
|
type: :runtime
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *71346700
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: watchr
|
104
|
-
requirement: &
|
104
|
+
requirement: &71371960 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,56 +109,66 @@ dependencies:
|
|
109
109
|
version: '0'
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
113
|
-
description: This
|
114
|
-
support the development process, but will not live in the running production code.
|
112
|
+
version_requirements: *71371960
|
113
|
+
description: This engine exists as development support for CompassAE.
|
115
114
|
email:
|
116
115
|
- russonrails@gmail.com
|
117
|
-
executables:
|
116
|
+
executables:
|
117
|
+
- compass-util
|
118
118
|
extensions: []
|
119
119
|
extra_rdoc_files: []
|
120
120
|
files:
|
121
|
-
- app/assets/javascripts/erp_dev_svcs/application.js
|
122
121
|
- app/assets/stylesheets/erp_dev_svcs/application.css
|
123
|
-
- app/
|
124
|
-
- app/helpers/erp_dev_svcs/application_helper.rb
|
122
|
+
- app/assets/javascripts/erp_dev_svcs/application.js
|
125
123
|
- app/views/layouts/erp_dev_svcs/application.html.erb
|
124
|
+
- app/helpers/erp_dev_svcs/application_helper.rb
|
125
|
+
- app/controllers/erp_dev_svcs/application_controller.rb
|
126
126
|
- config/routes.rb
|
127
|
-
- lib/erp_dev_svcs
|
127
|
+
- lib/erp_dev_svcs.rb
|
128
128
|
- lib/erp_dev_svcs/engine.rb
|
129
|
+
- lib/erp_dev_svcs/controller_support/controller_support.rb
|
130
|
+
- lib/erp_dev_svcs/commands/build_gems.rb
|
131
|
+
- lib/erp_dev_svcs/commands/setup_dev_env.rb
|
132
|
+
- lib/erp_dev_svcs/commands/test.rb
|
133
|
+
- lib/erp_dev_svcs/commands/git.rb
|
134
|
+
- lib/erp_dev_svcs/commands/uninstall_gems.rb
|
135
|
+
- lib/erp_dev_svcs/commands/helper.rb
|
136
|
+
- lib/erp_dev_svcs/commands/push_gems.rb
|
137
|
+
- lib/erp_dev_svcs/commands/new_gem_owner.rb
|
129
138
|
- lib/erp_dev_svcs/factory_support.rb
|
130
139
|
- lib/erp_dev_svcs/version.rb
|
131
|
-
- lib/erp_dev_svcs.rb
|
132
140
|
- lib/tasks/erp_dev_svcs_tasks.rake
|
133
141
|
- GPL-3-LICENSE
|
134
142
|
- Rakefile
|
135
143
|
- README.rdoc
|
136
|
-
- spec/
|
144
|
+
- spec/spec_helper.rb
|
145
|
+
- spec/dummy/public/422.html
|
146
|
+
- spec/dummy/public/404.html
|
147
|
+
- spec/dummy/public/500.html
|
148
|
+
- spec/dummy/public/favicon.ico
|
149
|
+
- spec/dummy/config.ru
|
137
150
|
- spec/dummy/app/assets/stylesheets/application.css
|
138
|
-
- spec/dummy/app/
|
139
|
-
- spec/dummy/app/helpers/application_helper.rb
|
151
|
+
- spec/dummy/app/assets/javascripts/application.js
|
140
152
|
- spec/dummy/app/views/layouts/application.html.erb
|
141
|
-
- spec/dummy/
|
153
|
+
- spec/dummy/app/helpers/application_helper.rb
|
154
|
+
- spec/dummy/app/controllers/application_controller.rb
|
155
|
+
- spec/dummy/config/routes.rb
|
156
|
+
- spec/dummy/config/locales/en.yml
|
142
157
|
- spec/dummy/config/boot.rb
|
143
|
-
- spec/dummy/config/
|
144
|
-
- spec/dummy/config/environment.rb
|
158
|
+
- spec/dummy/config/application.rb
|
145
159
|
- spec/dummy/config/environments/spec.rb
|
146
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
147
|
-
- spec/dummy/config/initializers/inflections.rb
|
148
160
|
- spec/dummy/config/initializers/mime_types.rb
|
149
|
-
- spec/dummy/config/initializers/secret_token.rb
|
150
161
|
- spec/dummy/config/initializers/session_store.rb
|
162
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
151
163
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
152
|
-
- spec/dummy/config/
|
153
|
-
- spec/dummy/config/
|
154
|
-
- spec/dummy/config.
|
155
|
-
- spec/dummy/
|
156
|
-
- spec/dummy/public/422.html
|
157
|
-
- spec/dummy/public/500.html
|
158
|
-
- spec/dummy/public/favicon.ico
|
164
|
+
- spec/dummy/config/initializers/inflections.rb
|
165
|
+
- spec/dummy/config/initializers/secret_token.rb
|
166
|
+
- spec/dummy/config/environment.rb
|
167
|
+
- spec/dummy/config/database.yml
|
159
168
|
- spec/dummy/Rakefile
|
160
169
|
- spec/dummy/script/rails
|
161
|
-
-
|
170
|
+
- !binary |-
|
171
|
+
YmluL2NvbXBhc3MtdXRpbA==
|
162
172
|
homepage: http://development.compassagile.com
|
163
173
|
licenses: []
|
164
174
|
post_install_message:
|
@@ -182,32 +192,32 @@ rubyforge_project:
|
|
182
192
|
rubygems_version: 1.8.10
|
183
193
|
signing_key:
|
184
194
|
specification_version: 3
|
185
|
-
summary: This
|
195
|
+
summary: This engine exists to serve as a way to organize code that exists to support
|
186
196
|
the development process, but will not live in the running production code.
|
187
197
|
test_files:
|
188
|
-
- spec/
|
198
|
+
- spec/spec_helper.rb
|
199
|
+
- spec/dummy/public/422.html
|
200
|
+
- spec/dummy/public/404.html
|
201
|
+
- spec/dummy/public/500.html
|
202
|
+
- spec/dummy/public/favicon.ico
|
203
|
+
- spec/dummy/config.ru
|
189
204
|
- spec/dummy/app/assets/stylesheets/application.css
|
190
|
-
- spec/dummy/app/
|
191
|
-
- spec/dummy/app/helpers/application_helper.rb
|
205
|
+
- spec/dummy/app/assets/javascripts/application.js
|
192
206
|
- spec/dummy/app/views/layouts/application.html.erb
|
193
|
-
- spec/dummy/
|
207
|
+
- spec/dummy/app/helpers/application_helper.rb
|
208
|
+
- spec/dummy/app/controllers/application_controller.rb
|
209
|
+
- spec/dummy/config/routes.rb
|
210
|
+
- spec/dummy/config/locales/en.yml
|
194
211
|
- spec/dummy/config/boot.rb
|
195
|
-
- spec/dummy/config/
|
196
|
-
- spec/dummy/config/environment.rb
|
212
|
+
- spec/dummy/config/application.rb
|
197
213
|
- spec/dummy/config/environments/spec.rb
|
198
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
199
|
-
- spec/dummy/config/initializers/inflections.rb
|
200
214
|
- spec/dummy/config/initializers/mime_types.rb
|
201
|
-
- spec/dummy/config/initializers/secret_token.rb
|
202
215
|
- spec/dummy/config/initializers/session_store.rb
|
216
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
203
217
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
204
|
-
- spec/dummy/config/
|
205
|
-
- spec/dummy/config/
|
206
|
-
- spec/dummy/config.
|
207
|
-
- spec/dummy/
|
208
|
-
- spec/dummy/public/422.html
|
209
|
-
- spec/dummy/public/500.html
|
210
|
-
- spec/dummy/public/favicon.ico
|
218
|
+
- spec/dummy/config/initializers/inflections.rb
|
219
|
+
- spec/dummy/config/initializers/secret_token.rb
|
220
|
+
- spec/dummy/config/environment.rb
|
221
|
+
- spec/dummy/config/database.yml
|
211
222
|
- spec/dummy/Rakefile
|
212
223
|
- spec/dummy/script/rails
|
213
|
-
- spec/spec_helper.rb
|