bonethug 0.0.69 → 0.0.70
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -3
- data/ISSUES.txt +2 -1
- data/bonethug.gemspec +3 -3
- data/config/deploy.rb +3 -2
- data/config/syncer.rb +46 -20
- data/lib/bonethug/cli.rb +26 -17
- data/lib/bonethug/installer.rb +3 -2
- data/lib/bonethug/version.rb +2 -2
- data/lib/bonethug/watcher.rb +150 -150
- data/skel/base/.gitignore +10 -8
- data/skel/project_types/drupal/lib/flush_drupal_cache.php +14 -10
- data/skel/project_types/drupal6/lib/flush_drupal_cache.php +14 -10
- data/skel/project_types/drupal7/composer.json +20 -20
- data/skel/project_types/drupal7/lib/flush_drupal_cache.php +2 -1
- data/skel/project_types/php/.gitignore +17 -13
- data/skel/project_types/php/composer.json +4 -4
- data/skel/project_types/silverstripe3/.gitignore +31 -27
- data/skel/project_types/silverstripe3/composer.json +3 -3
- metadata +8 -8
data/Gemfile
CHANGED
@@ -29,16 +29,16 @@ else
|
|
29
29
|
end
|
30
30
|
|
31
31
|
# asset pipeline - guard sprockets
|
32
|
-
gem 'guard-sprockets',
|
32
|
+
gem 'guard-sprockets', github: 'dormi/guard-sprockets'
|
33
33
|
gem 'uglifier'
|
34
34
|
gem 'sass-rails'
|
35
35
|
gem 'coffee-rails'
|
36
36
|
|
37
37
|
# asset pipeline - guard not sprockets
|
38
|
-
gem 'coffee-script'
|
38
|
+
gem 'coffee-script', github: 'josh/ruby-coffee-script'
|
39
39
|
gem 'sass'
|
40
40
|
gem 'guard-sass'
|
41
|
-
gem 'guard-coffeescript'
|
41
|
+
gem 'guard-coffeescript', '1.3.4'
|
42
42
|
gem 'guard-erb'
|
43
43
|
gem 'guard-slim'
|
44
44
|
gem 'guard-livereload'
|
data/ISSUES.txt
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
- guard 2 seems to not work - using 1.8.3 in the mean time
|
1
|
+
- guard 2 seems to not work in windows - using 1.8.3 in the mean time
|
2
|
+
- guard-coffeescript 1.4.0 doesn't work
|
data/bonethug.gemspec
CHANGED
@@ -52,7 +52,7 @@ Gem::Specification.new do |spec|
|
|
52
52
|
spec.add_dependency 'coffee-script'
|
53
53
|
spec.add_dependency 'sass'
|
54
54
|
spec.add_dependency 'guard-sass'
|
55
|
-
spec.add_dependency 'guard-coffeescript'
|
55
|
+
spec.add_dependency 'guard-coffeescript', '1.3.4'
|
56
56
|
spec.add_dependency 'guard-erb'
|
57
57
|
spec.add_dependency 'guard-slim'
|
58
58
|
spec.add_dependency 'guard-livereload'
|
@@ -61,7 +61,7 @@ Gem::Specification.new do |spec|
|
|
61
61
|
spec.add_dependency 'guard-sprockets'
|
62
62
|
spec.add_dependency 'uglifier'
|
63
63
|
spec.add_dependency 'sass-rails'
|
64
|
-
spec.add_dependency 'coffee-rails'
|
64
|
+
spec.add_dependency 'coffee-rails'
|
65
65
|
|
66
66
|
# spec.add_dependency 'rb-fsevent'
|
67
67
|
# spec.add_dependency 'compass'
|
@@ -73,7 +73,7 @@ Gem::Specification.new do |spec|
|
|
73
73
|
|
74
74
|
# if RUBY_PLATFORM.downcase.include?('linux')
|
75
75
|
# spec.add_dependency 'therubyracer'
|
76
|
-
# spec.add_dependency 'rb-inotify'
|
76
|
+
# spec.add_dependency 'rb-inotify'
|
77
77
|
# end
|
78
78
|
|
79
79
|
# if RUBY_PLATFORM.downcase.include?('darwin')
|
data/config/deploy.rb
CHANGED
@@ -155,7 +155,7 @@ task :init_db => :environment do
|
|
155
155
|
end
|
156
156
|
|
157
157
|
desc "Initialises the db"
|
158
|
-
task :
|
158
|
+
task :setup_db => :environment do
|
159
159
|
|
160
160
|
#rails
|
161
161
|
queue! %[cd #{deploy_to}/current && bundle exec rake db:reset RAILS_ENV="#{env}"] if deploy.get('project_type') =~ /rails[0-9]?/
|
@@ -378,8 +378,9 @@ task :deploy => :environment do
|
|
378
378
|
|
379
379
|
# handle cron
|
380
380
|
invoke :'whenever:update'
|
381
|
-
queue "echo \"\nPlease review the crontab below!!\n\
|
381
|
+
queue "echo \"\nPlease review the crontab below!!\n\""
|
382
382
|
queue 'crontab -l'
|
383
|
+
queue "echo \"\n\n\""
|
383
384
|
|
384
385
|
# run cache flushes / manifest rebuilds
|
385
386
|
queue! %[export APPLICATION_ENV=#{env} && php #{deploy_to}/current/public/framework/cli-script.php dev/build] if ['silverstripe','silverstripe3'].include? deploy.get('project_type')
|
data/config/syncer.rb
CHANGED
@@ -10,26 +10,30 @@ require 'bonethug/conf'
|
|
10
10
|
|
11
11
|
# load the conf
|
12
12
|
conf = Bonethug::Conf.new
|
13
|
-
cnf
|
13
|
+
cnf = conf.to_hash
|
14
|
+
envs = conf.get 'deploy.environments'
|
14
15
|
|
15
16
|
# args
|
16
|
-
|
17
|
-
|
17
|
+
env_local = ARGV[1]
|
18
|
+
env_remote = ARGV[2]
|
19
|
+
type = ARGV[0]
|
20
|
+
|
21
|
+
# validate
|
22
|
+
unless env_local and env_remote
|
23
|
+
puts 'Usage: syncer.rb ' + type + ' [local_environment] [remote_environment]'
|
24
|
+
return
|
25
|
+
end
|
18
26
|
|
19
27
|
# pull config from environment vars
|
20
|
-
raise 'could not find deployment environment' unless
|
28
|
+
raise 'could not find deployment environment' unless envs.has_key? env_local and envs.has_key? env_remote
|
21
29
|
|
22
30
|
# build config
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
vhost = deploy.get('project_slug') + '_' + env
|
30
|
-
|
31
|
-
# composer?
|
32
|
-
use_composer = ['silverstripe','silverstripe3','drupal','php'].include? deploy.get('project_type')
|
31
|
+
remote_deploy = conf.node_merge 'deploy.common', 'deploy.environments.' + env_local
|
32
|
+
local_deploy = conf.node_merge 'deploy.common', 'deploy.environments.' + env_local
|
33
|
+
resources = conf.get('resources','Array') || []
|
34
|
+
log_dirs = conf.get('log_dirs','Array') || []
|
35
|
+
remote_vhost = deploy.get('project_slug') + '_' + env_remote
|
36
|
+
dbs = conf.get 'dbs'
|
33
37
|
|
34
38
|
# directories we need to track
|
35
39
|
resources += ['backups']
|
@@ -38,15 +42,37 @@ resources += ['backups']
|
|
38
42
|
log_dirs.push 'log' unless log_dirs.include? 'log'
|
39
43
|
|
40
44
|
# do the common work
|
41
|
-
|
42
|
-
|
43
|
-
|
45
|
+
remote_path = remote_deploy.get('base_dir') + '/' + remote_vhost
|
46
|
+
remote_ssh = "ssh -p #{remote_deploy.get 'port'} #{remote_deploy.get 'user'}@#{remote_deploy.get 'domain'}"
|
47
|
+
|
48
|
+
# output
|
49
|
+
puts "Cloning Databases... "
|
50
|
+
|
51
|
+
# output
|
52
|
+
dbs.each do |index,db|
|
53
|
+
|
54
|
+
db_remote = db.get env_remote
|
55
|
+
db_local = db.get env_local
|
44
56
|
|
57
|
+
if type == "sync-local-to"
|
58
|
+
system "#{remote_ssh} \"mysqldump -u #{db_remote.get 'user'} -p #{db_remote.get 'pass'} #{db_remote.get 'name'} --verbose | bzip2 -c\" | bunzip2 -c | mysql -u #{db_local.get 'user'} -p #{db_local.get 'pass'} #{db_local.get 'name'}"
|
59
|
+
elsif type == "sync-local-from"
|
60
|
+
system "mysqldump -u #{db_local.get 'user'} -p #{db_local.get 'pass'} #{db_local.get 'name'} --verbose | bzip2 -c | #{remote_ssh} \"bunzip2 -c | mysql -u #{db_remote.get 'user'} -p #{db_remote.get 'pass'} #{db_remote.get 'name'}\""
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
puts "Done."
|
66
|
+
puts "Syncing Files... "
|
67
|
+
|
68
|
+
# sync the files
|
45
69
|
(resources + log_dirs).each do |item|
|
46
70
|
case type
|
47
71
|
when "sync-local-from"
|
48
|
-
|
72
|
+
system "rsync -r -a -v -e \"#{ssh_pass} ssh -l #{rsync.get('user')}\" --delete --copy-dirlinks #{rsync.get('host')}:#{path}/current/#{item} ./"
|
49
73
|
when "sync-local-to"
|
50
|
-
|
74
|
+
system "rsync -r -a -v -e \"#{ssh_pass} ssh -l #{rsync.get('user')}\" --delete --copy-dirlinks ./#{item} #{rsync.get('host')}:#{path}/current/"
|
51
75
|
end
|
52
|
-
end
|
76
|
+
end
|
77
|
+
|
78
|
+
puts "Done."
|
data/lib/bonethug/cli.rb
CHANGED
@@ -47,7 +47,7 @@ module Bonethug
|
|
47
47
|
# run the installer
|
48
48
|
Installer.install type, location
|
49
49
|
|
50
|
-
when 'init-db', 'init-local-db'
|
50
|
+
when 'init-db', 'init-local-db', 'setup-db'
|
51
51
|
|
52
52
|
# handle args
|
53
53
|
env = ARGV.last
|
@@ -61,6 +61,8 @@ module Bonethug
|
|
61
61
|
|
62
62
|
if task == 'init-local-db'
|
63
63
|
Installer.execute_init_mysql_db_script env, admin_user
|
64
|
+
elsif task == 'setup-db'
|
65
|
+
exec "export to=#{env} && export admin_user=#{admin_user} && bundle exec mina -f .bonethug/deploy.rb setup_db --verbose"
|
64
66
|
else
|
65
67
|
exec "export to=#{env} && export admin_user=#{admin_user} && bundle exec mina -f .bonethug/deploy.rb init_db --verbose"
|
66
68
|
end
|
@@ -156,15 +158,28 @@ module Bonethug
|
|
156
158
|
|
157
159
|
end
|
158
160
|
|
161
|
+
when 'sync-local-to',
|
162
|
+
'sync-local-from'
|
163
|
+
|
164
|
+
# args
|
165
|
+
env_local = ARGV[1]
|
166
|
+
env_remote = ARGV[0]
|
167
|
+
|
168
|
+
# validate
|
169
|
+
unless env_local and env_remote
|
170
|
+
puts 'Usage: thug #{task} [local_environment] [remote_environment]'
|
171
|
+
return
|
172
|
+
end
|
173
|
+
|
174
|
+
# run the script
|
175
|
+
exec "ruby .bonethug/syncer.rb #{task} #{env_local} #{env_remote}"
|
176
|
+
|
159
177
|
when 'deploy',
|
160
178
|
'setup',
|
161
179
|
'remote-backup',
|
162
180
|
'local-backup',
|
163
181
|
'sync-backup-to',
|
164
182
|
'sync-backup-from',
|
165
|
-
'sync-local-to',
|
166
|
-
'sync-local-from',
|
167
|
-
'init-db',
|
168
183
|
'force-unlock',
|
169
184
|
'cleanup'
|
170
185
|
|
@@ -186,16 +201,14 @@ module Bonethug
|
|
186
201
|
exec "export to=#{environment} && bundle exec mina -f .bonethug/deploy.rb setup --verbose"
|
187
202
|
|
188
203
|
# remote mina scripts
|
189
|
-
when 'init-db'
|
190
|
-
exec "export to=#{environment} && bundle exec mina -f .bonethug/deploy.rb init_db --verbose"
|
191
204
|
when 'force-unlock'
|
192
205
|
exec "export to=#{environment} && bundle exec mina -f .bonethug/deploy.rb deploy:force_unlock --verbose"
|
193
206
|
when 'cleanup'
|
194
|
-
exec "export to=#{environment} && bundle exec mina -f .bonethug/deploy.rb deploy:cleanup --verbose"
|
207
|
+
exec "export to=#{environment} && bundle exec mina -f .bonethug/deploy.rb deploy:cleanup --verbose"
|
195
208
|
|
196
209
|
# Snapshot Backup
|
197
210
|
when 'remote-backup'
|
198
|
-
exec "export to=#{environment} && bundle exec mina -f .bonethug/deploy.rb backup --verbose"
|
211
|
+
exec "export to=#{environment} && bundle exec mina -f .bonethug/deploy.rb backup --verbose"
|
199
212
|
when 'local-backup'
|
200
213
|
exec "export to=#{environment} && bundle exec astrails-safe .bonethug/backup.rb"
|
201
214
|
|
@@ -205,22 +218,18 @@ module Bonethug
|
|
205
218
|
when 'sync-backup-from'
|
206
219
|
exec "export to=#{environment} && bundle exec mina -f .bonethug/deploy.rb sync_from --verbose"
|
207
220
|
|
208
|
-
|
209
|
-
exec "ruby .bonethug/syncer.rb sync_local_to #{environment}"
|
210
|
-
when 'sync-local-from'
|
211
|
-
exec "ruby .bonethug/syncer.rb sync_local_from #{environment}"
|
212
|
-
end
|
221
|
+
end
|
213
222
|
|
214
223
|
when 'watch'
|
215
224
|
|
216
225
|
# handle args
|
217
226
|
type = ARGV[1] || 'coffee_sass'
|
218
227
|
location = ARGV[2] || '.'
|
219
|
-
watch_only = ARGV[3] || nil
|
220
|
-
|
228
|
+
watch_only = ARGV[3] || nil
|
229
|
+
|
221
230
|
# run the installer
|
222
|
-
Watcher.watch type, location, watch_only
|
223
|
-
|
231
|
+
Watcher.watch type, location, watch_only
|
232
|
+
|
224
233
|
when 'clean'
|
225
234
|
|
226
235
|
location = ARGV[1] || '.'
|
data/lib/bonethug/installer.rb
CHANGED
@@ -301,7 +301,7 @@ module Bonethug
|
|
301
301
|
src_file = @@bonthug_gem_dir + '/skel/project_types/' + project_type + '/' + file
|
302
302
|
dst_file = target + '/' + file
|
303
303
|
FileUtils.cp src_file, dst_file
|
304
|
-
|
304
|
+
|
305
305
|
end
|
306
306
|
end
|
307
307
|
else
|
@@ -322,6 +322,7 @@ module Bonethug
|
|
322
322
|
'astrails-safe' => 'astrails/safe',
|
323
323
|
'whenever' => 'javan/whenever',
|
324
324
|
'guard-erb' => 'azt3k/guard-erb',
|
325
|
+
'coffee-script' => 'josh/ruby-coffee-script',
|
325
326
|
'bonethug' => nil
|
326
327
|
}
|
327
328
|
|
@@ -372,7 +373,7 @@ module Bonethug
|
|
372
373
|
|
373
374
|
def self.init(dir = '.')
|
374
375
|
self.bonethugise(dir,:init)
|
375
|
-
end
|
376
|
+
end
|
376
377
|
|
377
378
|
end
|
378
379
|
|
data/lib/bonethug/version.rb
CHANGED
data/lib/bonethug/watcher.rb
CHANGED
@@ -1,151 +1,151 @@
|
|
1
|
-
# Todo
|
2
|
-
# ----------------
|
3
|
-
# - sass minification isn't working
|
4
|
-
# - actually add the filter to filter by type
|
5
|
-
# - make type filtering more flexible so other types can be used without code modifications
|
6
|
-
# ----------------
|
7
|
-
|
8
|
-
require 'bonethug/conf'
|
9
|
-
require 'fileutils'
|
10
|
-
require 'find'
|
11
|
-
require 'digest/md5'
|
12
|
-
require 'yaml'
|
13
|
-
require 'rbconfig'
|
14
|
-
|
15
|
-
module Bonethug
|
16
|
-
|
17
|
-
class Watcher
|
18
|
-
|
19
|
-
include FileUtils
|
20
|
-
include Digest
|
21
|
-
|
22
|
-
def self.watch(type = nil, target = '.', watch_only = nil)
|
23
|
-
|
24
|
-
# create full path
|
25
|
-
target = File.expand_path target
|
26
|
-
|
27
|
-
# load config
|
28
|
-
puts "Parsing Config..."
|
29
|
-
unless conf = Conf.new.add(target + '/config/cnf.yml')
|
30
|
-
puts "Couldn't find project configuration"
|
31
|
-
return
|
32
|
-
end
|
33
|
-
|
34
|
-
# project type
|
35
|
-
project_type = conf.get('deploy.project_type')
|
36
|
-
|
37
|
-
# end now if its a rails project
|
38
|
-
if ['rails','rails3'].include? project_type
|
39
|
-
puts "Rails doesn't require watching"
|
40
|
-
return
|
41
|
-
end
|
42
|
-
|
43
|
-
sass = []
|
44
|
-
if sasses = conf.get('watch.sass')
|
45
|
-
sasses.each do |index, watch|
|
46
|
-
sass.push(src: watch.get('src','Array'), dest: watch.get('dest'), filter: watch.get('filter'), type: :sass)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
coffee = []
|
51
|
-
if coffees = conf.get('watch.coffee')
|
52
|
-
coffees.each do |index, watch|
|
53
|
-
coffee.push(src: watch.get('src','Array'), dest: watch.get('dest'), filter: watch.get('filter'), type: :coffee)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
# erb doesn't support array based input just yet
|
58
|
-
erb = []
|
59
|
-
if erbs = conf.get('watch.erb')
|
60
|
-
erbs.each do |index, watch|
|
61
|
-
erb.push(src: watch.get('src','Array'), dest: watch.get('dest'), filter: watch.get('filter'), type: :erb)
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
# slim doesn't support aray based inputs just yet
|
66
|
-
slim = []
|
67
|
-
if slims = conf.get('watch.slim')
|
68
|
-
slims.each do |index, watch|
|
69
|
-
slim.push(src: watch.get('src','Array'), dest: watch.get('dest'), filter: watch.get('filter'), type: :slim)
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
# combine the watches
|
74
|
-
watches = coffee + sass + erb + slim
|
75
|
-
|
76
|
-
# Generate Guardfile
|
77
|
-
puts 'Generating Guardfile...'
|
78
|
-
|
79
|
-
guardfile_content = ''
|
80
|
-
watches.each do |watch|
|
81
|
-
|
82
|
-
case watch[:filter].class.name
|
83
|
-
when 'NilClass'
|
84
|
-
watch_val = ''
|
85
|
-
when 'String'
|
86
|
-
watch_val = "'#{watch[:filter]}'"
|
87
|
-
when 'Regexp'
|
88
|
-
watch_val = watch[:filter].inspect
|
89
|
-
else
|
90
|
-
raise "invalid filter type: " + watch[:filter].class.name
|
91
|
-
end
|
92
|
-
|
93
|
-
filter = watch[:filter] ? "watch #{watch_val}" : ""
|
94
|
-
|
95
|
-
case type
|
96
|
-
when 'sprockets'
|
97
|
-
guardfile_content += "
|
98
|
-
guard 'sprockets', :minify => true, :destination => '#{watch[:dest]}', :asset_paths => #{watch[:src].to_s} do
|
99
|
-
#{filter}
|
100
|
-
end
|
101
|
-
"
|
102
|
-
else
|
103
|
-
if watch[:type] == :coffee
|
104
|
-
guardfile_content += "
|
105
|
-
guard :coffeescript, :
|
106
|
-
#{filter}
|
107
|
-
end
|
108
|
-
"
|
109
|
-
elsif watch[:type] == :sass
|
110
|
-
guardfile_content += "
|
111
|
-
guard :sass, :style => :compressed, :debug_info => true, :output => '#{watch[:dest]}', :input => #{watch[:src].to_s} do
|
112
|
-
#{filter}
|
113
|
-
end
|
114
|
-
"
|
115
|
-
elsif watch[:type] == :erb
|
116
|
-
guardfile_content += "
|
117
|
-
guard :erb, :debug_info => true, :output => '#{watch[:dest]}', :input => #{watch[:src].to_s} do
|
118
|
-
#{filter}
|
119
|
-
end
|
120
|
-
"
|
121
|
-
elsif watch[:type] == :slim
|
122
|
-
guardfile_content += "
|
123
|
-
guard :slim, :debug_info => true, :output => '#{watch[:dest]}', :input => #{watch[:src].to_s} do
|
124
|
-
#{filter}
|
125
|
-
end
|
126
|
-
"
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
end
|
131
|
-
|
132
|
-
# save the guardfile
|
133
|
-
guardfile = target + '/.bonethug/Guardfile'
|
134
|
-
FileUtils.rm_rf guardfile
|
135
|
-
File.open(guardfile,'w') do |file|
|
136
|
-
file.puts guardfile_content
|
137
|
-
end
|
138
|
-
|
139
|
-
puts 'Starting Watch Daemon...'
|
140
|
-
# guard 2.0.x polling fix
|
141
|
-
# poll = RbConfig::CONFIG['target_os'] =~ /mswin|mingw|cygwin/i ? '--force-polling' : ''
|
142
|
-
poll = ''
|
143
|
-
cmd = 'bundle exec guard --debug ' + poll + ' --guardfile "' + target + '/.bonethug/Guardfile"'
|
144
|
-
puts cmd
|
145
|
-
exec cmd
|
146
|
-
|
147
|
-
end
|
148
|
-
|
149
|
-
end
|
150
|
-
|
1
|
+
# Todo
|
2
|
+
# ----------------
|
3
|
+
# - sass minification isn't working
|
4
|
+
# - actually add the filter to filter by type
|
5
|
+
# - make type filtering more flexible so other types can be used without code modifications
|
6
|
+
# ----------------
|
7
|
+
|
8
|
+
require 'bonethug/conf'
|
9
|
+
require 'fileutils'
|
10
|
+
require 'find'
|
11
|
+
require 'digest/md5'
|
12
|
+
require 'yaml'
|
13
|
+
require 'rbconfig'
|
14
|
+
|
15
|
+
module Bonethug
|
16
|
+
|
17
|
+
class Watcher
|
18
|
+
|
19
|
+
include FileUtils
|
20
|
+
include Digest
|
21
|
+
|
22
|
+
def self.watch(type = nil, target = '.', watch_only = nil)
|
23
|
+
|
24
|
+
# create full path
|
25
|
+
target = File.expand_path target
|
26
|
+
|
27
|
+
# load config
|
28
|
+
puts "Parsing Config..."
|
29
|
+
unless conf = Conf.new.add(target + '/config/cnf.yml')
|
30
|
+
puts "Couldn't find project configuration"
|
31
|
+
return
|
32
|
+
end
|
33
|
+
|
34
|
+
# project type
|
35
|
+
project_type = conf.get('deploy.project_type')
|
36
|
+
|
37
|
+
# end now if its a rails project
|
38
|
+
if ['rails','rails3'].include? project_type
|
39
|
+
puts "Rails doesn't require watching"
|
40
|
+
return
|
41
|
+
end
|
42
|
+
|
43
|
+
sass = []
|
44
|
+
if sasses = conf.get('watch.sass')
|
45
|
+
sasses.each do |index, watch|
|
46
|
+
sass.push(src: watch.get('src','Array'), dest: watch.get('dest'), filter: watch.get('filter'), type: :sass)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
coffee = []
|
51
|
+
if coffees = conf.get('watch.coffee')
|
52
|
+
coffees.each do |index, watch|
|
53
|
+
coffee.push(src: watch.get('src','Array'), dest: watch.get('dest'), filter: watch.get('filter'), type: :coffee)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# erb doesn't support array based input just yet
|
58
|
+
erb = []
|
59
|
+
if erbs = conf.get('watch.erb')
|
60
|
+
erbs.each do |index, watch|
|
61
|
+
erb.push(src: watch.get('src','Array'), dest: watch.get('dest'), filter: watch.get('filter'), type: :erb)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# slim doesn't support aray based inputs just yet
|
66
|
+
slim = []
|
67
|
+
if slims = conf.get('watch.slim')
|
68
|
+
slims.each do |index, watch|
|
69
|
+
slim.push(src: watch.get('src','Array'), dest: watch.get('dest'), filter: watch.get('filter'), type: :slim)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# combine the watches
|
74
|
+
watches = coffee + sass + erb + slim
|
75
|
+
|
76
|
+
# Generate Guardfile
|
77
|
+
puts 'Generating Guardfile...'
|
78
|
+
|
79
|
+
guardfile_content = ''
|
80
|
+
watches.each do |watch|
|
81
|
+
|
82
|
+
case watch[:filter].class.name
|
83
|
+
when 'NilClass'
|
84
|
+
watch_val = ''
|
85
|
+
when 'String'
|
86
|
+
watch_val = "'#{watch[:filter]}'"
|
87
|
+
when 'Regexp'
|
88
|
+
watch_val = watch[:filter].inspect
|
89
|
+
else
|
90
|
+
raise "invalid filter type: " + watch[:filter].class.name
|
91
|
+
end
|
92
|
+
|
93
|
+
filter = watch[:filter] ? "watch #{watch_val}" : ""
|
94
|
+
|
95
|
+
case type
|
96
|
+
when 'sprockets'
|
97
|
+
guardfile_content += "
|
98
|
+
guard 'sprockets', :minify => true, :destination => '#{watch[:dest]}', :asset_paths => #{watch[:src].to_s} do
|
99
|
+
#{filter}
|
100
|
+
end
|
101
|
+
"
|
102
|
+
else
|
103
|
+
if watch[:type] == :coffee
|
104
|
+
guardfile_content += "
|
105
|
+
guard :coffeescript, :output => '#{watch[:dest]}', :input => #{watch[:src].to_s} do
|
106
|
+
#{filter}
|
107
|
+
end
|
108
|
+
"
|
109
|
+
elsif watch[:type] == :sass
|
110
|
+
guardfile_content += "
|
111
|
+
guard :sass, :style => :compressed, :debug_info => true, :output => '#{watch[:dest]}', :input => #{watch[:src].to_s} do
|
112
|
+
#{filter}
|
113
|
+
end
|
114
|
+
"
|
115
|
+
elsif watch[:type] == :erb
|
116
|
+
guardfile_content += "
|
117
|
+
guard :erb, :debug_info => true, :output => '#{watch[:dest]}', :input => #{watch[:src].to_s} do
|
118
|
+
#{filter}
|
119
|
+
end
|
120
|
+
"
|
121
|
+
elsif watch[:type] == :slim
|
122
|
+
guardfile_content += "
|
123
|
+
guard :slim, :debug_info => true, :output => '#{watch[:dest]}', :input => #{watch[:src].to_s} do
|
124
|
+
#{filter}
|
125
|
+
end
|
126
|
+
"
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
end
|
131
|
+
|
132
|
+
# save the guardfile
|
133
|
+
guardfile = target + '/.bonethug/Guardfile'
|
134
|
+
FileUtils.rm_rf guardfile
|
135
|
+
File.open(guardfile,'w') do |file|
|
136
|
+
file.puts guardfile_content
|
137
|
+
end
|
138
|
+
|
139
|
+
puts 'Starting Watch Daemon...'
|
140
|
+
# guard 2.0.x polling fix
|
141
|
+
# poll = RbConfig::CONFIG['target_os'] =~ /mswin|mingw|cygwin/i ? '--force-polling' : ''
|
142
|
+
poll = ''
|
143
|
+
cmd = 'bundle exec guard --debug ' + poll + ' --guardfile "' + target + '/.bonethug/Guardfile"'
|
144
|
+
puts cmd
|
145
|
+
exec cmd
|
146
|
+
|
147
|
+
end
|
148
|
+
|
149
|
+
end
|
150
|
+
|
151
151
|
end
|
data/skel/base/.gitignore
CHANGED
@@ -1,11 +1,15 @@
|
|
1
|
-
<?php
|
2
|
-
|
3
|
-
$pub_dir = realpath(__DIR__ . '/../public');
|
4
|
-
chdir($pub_dir);
|
5
|
-
define('DRUPAL_ROOT', $pub_dir);
|
6
|
-
|
7
|
-
if (file_exists($pub_dir . '/includes/bootstrap.inc')) {
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
<?php
|
2
|
+
|
3
|
+
$pub_dir = realpath(__DIR__ . '/../public');
|
4
|
+
chdir($pub_dir);
|
5
|
+
define('DRUPAL_ROOT', $pub_dir);
|
6
|
+
|
7
|
+
if (file_exists($pub_dir . '/includes/bootstrap.inc')) {
|
8
|
+
|
9
|
+
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
|
10
|
+
$_SERVER['REQUEST_METHOD'] = 'GET';
|
11
|
+
|
12
|
+
require_once $pub_dir . '/includes/bootstrap.inc';
|
13
|
+
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
|
14
|
+
drupal_flush_all_caches();
|
11
15
|
}
|
@@ -1,11 +1,15 @@
|
|
1
|
-
<?php
|
2
|
-
|
3
|
-
$pub_dir = realpath(__DIR__ . '/../public');
|
4
|
-
chdir($pub_dir);
|
5
|
-
define('DRUPAL_ROOT', $pub_dir);
|
6
|
-
|
7
|
-
if (file_exists($pub_dir . '/includes/bootstrap.inc')) {
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
<?php
|
2
|
+
|
3
|
+
$pub_dir = realpath(__DIR__ . '/../public');
|
4
|
+
chdir($pub_dir);
|
5
|
+
define('DRUPAL_ROOT', $pub_dir);
|
6
|
+
|
7
|
+
if (file_exists($pub_dir . '/includes/bootstrap.inc')) {
|
8
|
+
|
9
|
+
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
|
10
|
+
$_SERVER['REQUEST_METHOD'] = 'GET';
|
11
|
+
|
12
|
+
require_once $pub_dir . '/includes/bootstrap.inc';
|
13
|
+
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
|
14
|
+
drupal_flush_all_caches();
|
11
15
|
}
|
@@ -1,21 +1,21 @@
|
|
1
|
-
{
|
2
|
-
"name": "bonethug/drupal7-skel",
|
3
|
-
"repositories": [
|
4
|
-
{
|
5
|
-
"type": "vcs",
|
6
|
-
"url": "git@github.com:azt3k/drupal.git"
|
7
|
-
}
|
8
|
-
],
|
9
|
-
"require": {
|
10
|
-
"symfony/yaml" : "2.3.*@dev",
|
11
|
-
"drush/drush" : "dev-master",
|
12
|
-
"thecodingmachine/drupal" : "7.*@dev"
|
13
|
-
},
|
14
|
-
"extra": {
|
15
|
-
"installer-paths": {
|
16
|
-
"vendor": [],
|
17
|
-
"public": [],
|
18
|
-
"public/vendor/{$name}": []
|
19
|
-
}
|
20
|
-
}
|
1
|
+
{
|
2
|
+
"name": "bonethug/drupal7-skel",
|
3
|
+
"repositories": [
|
4
|
+
{
|
5
|
+
"type": "vcs",
|
6
|
+
"url": "git@github.com:azt3k/drupal.git"
|
7
|
+
}
|
8
|
+
],
|
9
|
+
"require": {
|
10
|
+
"symfony/yaml" : "2.3.*@dev",
|
11
|
+
"drush/drush" : "dev-master",
|
12
|
+
"thecodingmachine/drupal" : "7.*@dev"
|
13
|
+
},
|
14
|
+
"extra": {
|
15
|
+
"installer-paths": {
|
16
|
+
"vendor": [],
|
17
|
+
"public": [],
|
18
|
+
"public/vendor/{$name}": []
|
19
|
+
}
|
20
|
+
}
|
21
21
|
}
|
@@ -6,7 +6,8 @@ define('DRUPAL_ROOT', $pub_dir);
|
|
6
6
|
|
7
7
|
if (file_exists($pub_dir . '/includes/bootstrap.inc')) {
|
8
8
|
|
9
|
-
$_SERVER['REMOTE_ADDR']
|
9
|
+
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
|
10
|
+
$_SERVER['REQUEST_METHOD'] = 'GET';
|
10
11
|
|
11
12
|
require_once $pub_dir . '/includes/bootstrap.inc';
|
12
13
|
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
|
@@ -1,13 +1,17 @@
|
|
1
|
-
# project framework
|
2
|
-
/.bundle
|
3
|
-
/vendor
|
4
|
-
/bin
|
5
|
-
/logs/*
|
6
|
-
/backups/*
|
7
|
-
/db_dumps
|
8
|
-
/tmp/*
|
9
|
-
/composer.phar
|
10
|
-
|
11
|
-
# components tracked by composer
|
12
|
-
/public/assets/*
|
13
|
-
/vendor
|
1
|
+
# project framework
|
2
|
+
/.bundle
|
3
|
+
/vendor
|
4
|
+
/bin
|
5
|
+
/logs/*
|
6
|
+
/backups/*
|
7
|
+
/db_dumps
|
8
|
+
/tmp/*
|
9
|
+
/composer.phar
|
10
|
+
|
11
|
+
# components tracked by composer
|
12
|
+
/public/assets/*
|
13
|
+
/vendor
|
14
|
+
|
15
|
+
# project files
|
16
|
+
*.sublime-workspace
|
17
|
+
*.sublime-project
|
@@ -1,5 +1,5 @@
|
|
1
|
-
{
|
2
|
-
"require": {
|
3
|
-
"symfony/yaml" : "2.
|
4
|
-
}
|
1
|
+
{
|
2
|
+
"require": {
|
3
|
+
"symfony/yaml" : "2.5.*@dev"
|
4
|
+
}
|
5
5
|
}
|
@@ -1,27 +1,31 @@
|
|
1
|
-
# project framework
|
2
|
-
/.bundle
|
3
|
-
/vendor
|
4
|
-
/bin
|
5
|
-
/log/*
|
6
|
-
/backups/*
|
7
|
-
/db_dumps
|
8
|
-
/tmp/*
|
9
|
-
/composer.phar
|
10
|
-
.sass-cache
|
11
|
-
/public/assets/*
|
12
|
-
/public/vendor/*
|
13
|
-
/vendor/ruby
|
14
|
-
|
15
|
-
#
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
/public/
|
21
|
-
/public/
|
22
|
-
/public/
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
1
|
+
# project framework
|
2
|
+
/.bundle
|
3
|
+
/vendor
|
4
|
+
/bin
|
5
|
+
/log/*
|
6
|
+
/backups/*
|
7
|
+
/db_dumps
|
8
|
+
/tmp/*
|
9
|
+
/composer.phar
|
10
|
+
.sass-cache
|
11
|
+
/public/assets/*
|
12
|
+
/public/vendor/*
|
13
|
+
/vendor/ruby
|
14
|
+
|
15
|
+
# project files
|
16
|
+
*.sublime-workspace
|
17
|
+
*.sublime-project
|
18
|
+
|
19
|
+
# components tracked by composer
|
20
|
+
/public/silverstripe-cache/*
|
21
|
+
/public/bootstrap_forms
|
22
|
+
/public/cms
|
23
|
+
/public/abc-silverstripe
|
24
|
+
/public/abc-silverstripe-mailer
|
25
|
+
/public/framework
|
26
|
+
/public/html5
|
27
|
+
|
28
|
+
# files to keep
|
29
|
+
!.gitkeep
|
30
|
+
!/public/assets/error-404.html
|
31
|
+
!/public/assets/error-500.html
|
@@ -1,14 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"name" : "bonethug/ss3-skel",
|
3
3
|
"require" : {
|
4
|
-
"symfony/yaml" : "2.5.*@dev",
|
4
|
+
"symfony/yaml" : "2.5.*@dev",
|
5
5
|
"silverstripe/framework" : "3.1.*@dev",
|
6
6
|
"silverstripe/cms" : "3.1.*@dev",
|
7
7
|
"silverstripe/html5" : "dev-master",
|
8
8
|
"phpmailer/phpmailer" : "dev-master",
|
9
9
|
"azt3k/abc-silverstripe" : "dev-master",
|
10
10
|
"azt3k/abc-silverstripe-mailer" : "dev-master",
|
11
|
-
"nathancox/minify" : "dev-master"
|
11
|
+
"nathancox/minify" : "dev-master"
|
12
12
|
},
|
13
13
|
"extra": {
|
14
14
|
"installer-paths": {
|
@@ -16,7 +16,7 @@
|
|
16
16
|
],
|
17
17
|
"public/{$name}": [
|
18
18
|
"silverstripe/framework",
|
19
|
-
"silverstripe/cms",
|
19
|
+
"silverstripe/cms",
|
20
20
|
"silverstripe/html5",
|
21
21
|
"azt3k/abc-silverstripe",
|
22
22
|
"azt3k/abc-silverstripe-mailer",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bonethug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.70
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -208,17 +208,17 @@ dependencies:
|
|
208
208
|
requirement: !ruby/object:Gem::Requirement
|
209
209
|
none: false
|
210
210
|
requirements:
|
211
|
-
- -
|
211
|
+
- - '='
|
212
212
|
- !ruby/object:Gem::Version
|
213
|
-
version:
|
213
|
+
version: 1.3.4
|
214
214
|
type: :runtime
|
215
215
|
prerelease: false
|
216
216
|
version_requirements: !ruby/object:Gem::Requirement
|
217
217
|
none: false
|
218
218
|
requirements:
|
219
|
-
- -
|
219
|
+
- - '='
|
220
220
|
- !ruby/object:Gem::Version
|
221
|
-
version:
|
221
|
+
version: 1.3.4
|
222
222
|
- !ruby/object:Gem::Dependency
|
223
223
|
name: guard-erb
|
224
224
|
requirement: !ruby/object:Gem::Requirement
|
@@ -505,7 +505,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
505
505
|
version: '0'
|
506
506
|
segments:
|
507
507
|
- 0
|
508
|
-
hash:
|
508
|
+
hash: 2684865245615476395
|
509
509
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
510
510
|
none: false
|
511
511
|
requirements:
|
@@ -514,7 +514,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
514
514
|
version: '0'
|
515
515
|
segments:
|
516
516
|
- 0
|
517
|
-
hash:
|
517
|
+
hash: 2684865245615476395
|
518
518
|
requirements: []
|
519
519
|
rubyforge_project:
|
520
520
|
rubygems_version: 1.8.23
|