62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
# File 'lib/xing/tasks/develop.rb', line 62
def define
in_namespace do
desc "Launch a browser connected to a running development server"
edict_task :launch_browser, Edicts::LaunchBrowser
edict_task :grunt_watch, Edicts::StartChild do |gw|
gw.manager = manager
gw.label = "Grunt"
gw.child_task = in_namespace('service:grunt_watch').first
end
edict_task :compass_watch, Edicts::StartChild do |cw|
cw.manager = manager
cw.label = "Compass"
cw.child_task = in_namespace('service:compass_watch').first
end
edict_task :rails_server, Edicts::StartChild do |rs|
rs.manager = manager
rs.label = "Rails"
rs.child_task = in_namespace('service:rails_server').first
end
edict_task :sidekiq, Edicts::StartChild do |sk|
sk.manager = manager
sk.label = "Sidekiq"
sk.child_task = in_namespace('service:sidekiq').first
end
edict_task :static_assets, Edicts::StartChild do |sa|
sa.manager = manager
sa.label = "Static"
sa.child_task = in_namespace('service:static_assets').first
end
namespace :service do
edict_task :grunt_watch, Edicts::CleanRun do |gw|
gw.dir = "frontend"
gw.shell_cmd = %w{bundle exec node_modules/.bin/grunt delta:develop}
gw.env_hash = {"CUSTOM_CONFIG_DIR" => config_dir}
end
task :grunt_watch => 'frontend:setup'
edict_task :compass_watch, Edicts::CleanRun do |cw|
cw.dir = "frontend"
cw.shell_cmd = %w{bundle exec compass watch}
end
edict_task :rails_server, Edicts::CleanRun do |rs|
words = %w{bundle exec rails server}
words << "-p#{rails_server_port}"
rs.dir = "backend"
rs.shell_cmd = words
end
task :rails_server => 'backend:setup'
edict_task :sidekiq, Edicts::CleanRun do |sk|
sk.dir = "backend"
sk.shell_cmd = %w{bundle exec sidekiq}
end
edict_task :static_assets, Edicts::CleanRun do |sa|
words = %w{bundle exec rackup}
words << "-p#{static_server_port}" words << "static-app.ru"
sa.dir = "backend"
sa.shell_cmd = words
sa.env_hash = {
"LRD_BACKEND_PORT" => "#{rails_server_port}", "XING_BACKEND_PORT" => "#{rails_server_port}"
}
end
end
task :wait do
manager.wait_all
end
task :startup => [:grunt_watch, :compass_watch, :sidekiq, :static_assets, :rails_server, :launch_browser]
task :all => [:startup, :wait]
end
end
|