bonethug 0.0.77 → 0.0.78

Sign up to get free protection for your applications and to get access to all the features.
data/config/cnf.yml CHANGED
@@ -166,6 +166,16 @@ resources:
166
166
  vendor:
167
167
  - vendor
168
168
  - public/vendor
169
+ post_cmds:
170
+ development:
171
+ - touch public/random_file
172
+ - rm public/random_file
173
+ staging:
174
+ - touch public/random_file
175
+ - rm public/random_file
176
+ production:
177
+ - touch public/random_file
178
+ - rm public/random_file
169
179
  watch:
170
180
  sass:
171
181
  -
@@ -183,6 +193,7 @@ watch:
183
193
  filter: !ruby/regexp '/^.+\.coffee$/'
184
194
  concat_js:
185
195
  -
196
+ onstart: true
186
197
  src: public/project/vendor
187
198
  dest: public/project/javascript
188
199
  filter: "*"
data/config/deploy.rb CHANGED
@@ -81,7 +81,7 @@ set :user, deploy.get('user')
81
81
  set :port, deploy.get('port')
82
82
  set :rails_env, env
83
83
  set :shared_paths, shared
84
-
84
+ set :bundle_path, './vendor/thug_bundle' # need to set this or we end up with symlink loop
85
85
 
86
86
  # Tasks
87
87
  # ---------------------------------------------------------------
@@ -422,6 +422,14 @@ task :deploy => :environment do
422
422
  # cleanup!
423
423
  invoke :'deploy:cleanup'
424
424
 
425
+ # run post deploy commands
426
+ cmds = conf.get('post_cmds.'+env)
427
+ if cmds
428
+ cmds.each do |index, cmd|
429
+ queue cmd
430
+ end
431
+ end
432
+
425
433
  end
426
434
  end
427
435
  end
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Bonethug
3
- VERSION = "0.0.77"
4
- BUILD_DATE = "2014-04-05 13:22:33 +1300"
3
+ VERSION = "0.0.78"
4
+ BUILD_DATE = "2014-04-11 11:55:23 +1200"
5
5
  end
6
6
 
@@ -43,14 +43,14 @@ module Bonethug
43
43
  sass = []
44
44
  if sasses = conf.get('watch.sass')
45
45
  sasses.each do |index, watch|
46
- sass.push(src: watch.get('src','Array'), dest: watch.get('dest'), filter: watch.get('filter'), type: :sass)
46
+ sass.push(src: watch.get('src','Array'), dest: watch.get('dest'), filter: watch.get('filter'), all_on_start: watch.get('onstart').to_bool, type: :sass)
47
47
  end
48
48
  end
49
49
 
50
50
  coffee = []
51
51
  if coffees = conf.get('watch.coffee')
52
52
  coffees.each do |index, watch|
53
- coffee.push(src: watch.get('src','Array'), dest: watch.get('dest'), filter: watch.get('filter'), type: :coffee)
53
+ coffee.push(src: watch.get('src','Array'), dest: watch.get('dest'), filter: watch.get('filter'), all_on_start: watch.get('onstart').to_bool, type: :coffee)
54
54
  end
55
55
  end
56
56
 
@@ -58,7 +58,7 @@ module Bonethug
58
58
  concat_js = []
59
59
  if js_concats = conf.get('watch.concat_js')
60
60
  js_concats.each do |index, watch|
61
- concat_js.push(src: watch.get('src'), dest: watch.get('dest'), filter: watch.get('filter','Array'), type: :concat_js)
61
+ concat_js.push(src: watch.get('src'), dest: watch.get('dest'), filter: watch.get('filter','Array'), all_on_start: watch.get('onstart').to_bool, type: :concat_js)
62
62
  end
63
63
  end
64
64
 
@@ -66,7 +66,7 @@ module Bonethug
66
66
  concat_css = []
67
67
  if css_concats = conf.get('watch.concat_css')
68
68
  css_concats.each do |index, watch|
69
- concat_css.push(src: watch.get('src'), dest: watch.get('dest'), filter: watch.get('filter','Array'), type: :concat_css)
69
+ concat_css.push(src: watch.get('src'), dest: watch.get('dest'), filter: watch.get('filter','Array'), all_on_start: watch.get('onstart').to_bool, type: :concat_css)
70
70
  end
71
71
  end
72
72
 
@@ -74,7 +74,7 @@ module Bonethug
74
74
  uglify = []
75
75
  if uglifies = conf.get('watch.uglify')
76
76
  uglifies.each do |index, watch|
77
- uglify.push(src: watch.get('src','Array'), dest: watch.get('dest'), filter: watch.get('filter'), type: :uglify)
77
+ uglify.push(src: watch.get('src','Array'), dest: watch.get('dest'), filter: watch.get('filter'), all_on_start: watch.get('onstart').to_bool, type: :uglify)
78
78
  end
79
79
  end
80
80
 
@@ -82,7 +82,7 @@ module Bonethug
82
82
  erb = []
83
83
  if erbs = conf.get('watch.erb')
84
84
  erbs.each do |index, watch|
85
- erb.push(src: watch.get('src','Array'), dest: watch.get('dest'), filter: watch.get('filter'), type: :erb)
85
+ erb.push(src: watch.get('src','Array'), dest: watch.get('dest'), filter: watch.get('filter'), all_on_start: watch.get('onstart').to_bool, type: :erb)
86
86
  end
87
87
  end
88
88
 
@@ -90,7 +90,7 @@ module Bonethug
90
90
  slim = []
91
91
  if slims = conf.get('watch.slim')
92
92
  slims.each do |index, watch|
93
- slim.push(src: watch.get('src','Array'), dest: watch.get('dest'), filter: watch.get('filter'), type: :slim)
93
+ slim.push(src: watch.get('src','Array'), dest: watch.get('dest'), filter: watch.get('filter'), all_on_start: watch.get('onstart').to_bool, type: :slim)
94
94
  end
95
95
  end
96
96
 
@@ -125,46 +125,46 @@ module Bonethug
125
125
  case type
126
126
  when 'sprockets'
127
127
  guardfile_content += "
128
- guard 'sprockets', :minify => true, :destination => '#{watch[:dest]}', :asset_paths => #{watch[:src].to_s} do
128
+ guard 'sprockets', :minify => true, :destination => '#{watch[:dest]}', :asset_paths => #{watch[:src].to_s}, :all_on_start => #{watch[:all_on_start].to_s} do
129
129
  #{filter}
130
130
  end
131
131
  "
132
132
  else
133
133
  if watch[:type] == :coffee
134
134
  guardfile_content += "
135
- guard :coffeescript, :output => '#{watch[:dest]}', :input => #{watch[:src].to_s} do
135
+ guard :coffeescript, :output => '#{watch[:dest]}', :input => #{watch[:src].to_s}, :all_on_start => #{watch[:all_on_start].to_s} do
136
136
  #{filter}
137
137
  end
138
138
  "
139
139
  elsif watch[:type] == :sass
140
140
  guardfile_content += "
141
- guard :sass, :style => :compressed, :debug_info => true, :output => '#{watch[:dest]}', :input => #{watch[:src].to_s} do
141
+ guard :sass, :style => :compressed, :debug_info => true, :output => '#{watch[:dest]}', :input => #{watch[:src].to_s}, :all_on_start => #{watch[:all_on_start].to_s} do
142
142
  #{filter}
143
143
  end
144
144
  "
145
145
  elsif watch[:type] == :concat_css
146
146
  guardfile_content += "
147
- guard :concat, :output => '#{watch[:dest]}', :input_dir => '#{watch[:src]}', :type => 'css', :files => #{filter}
147
+ guard :concat, :output => '#{watch[:dest]}', :input_dir => '#{watch[:src]}', :type => 'css', :files => #{filter}, :all_on_start => #{watch[:all_on_start].to_s}
148
148
  "
149
149
  elsif watch[:type] == :concat_js
150
150
  guardfile_content += "
151
- guard :concat, :output => '#{watch[:dest]}', :input_dir => '#{watch[:src]}', :type => 'js', :files => #{filter}
151
+ guard :concat, :output => '#{watch[:dest]}', :input_dir => '#{watch[:src]}', :type => 'js', :files => #{filter}, :all_on_start => #{watch[:all_on_start].to_s}
152
152
  "
153
153
  elsif watch[:type] == :uglify
154
154
  guardfile_content += "
155
- guard 'uglify', :output => '#{watch[:dest]}', :input => #{watch[:src].to_s} do
155
+ guard 'uglify', :output => '#{watch[:dest]}', :input => #{watch[:src].to_s}, :all_on_start => #{watch[:all_on_start].to_s} do
156
156
  #{filter}
157
157
  end
158
158
  "
159
159
  elsif watch[:type] == :erb
160
160
  guardfile_content += "
161
- guard :erb, :debug_info => true, :output => '#{watch[:dest]}', :input => #{watch[:src].to_s} do
161
+ guard :erb, :debug_info => true, :output => '#{watch[:dest]}', :input => #{watch[:src].to_s}, :all_on_start => #{watch[:all_on_start].to_s} do
162
162
  #{filter}
163
163
  end
164
164
  "
165
165
  elsif watch[:type] == :slim
166
166
  guardfile_content += "
167
- guard :slim, :debug_info => true, :output => '#{watch[:dest]}', :input => #{watch[:src].to_s} do
167
+ guard :slim, :debug_info => true, :output => '#{watch[:dest]}', :input => #{watch[:src].to_s}, :all_on_start => #{watch[:all_on_start].to_s} do
168
168
  #{filter}
169
169
  end
170
170
  "
data/lib/bonethug.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require "init"
1
2
  require "bonethug/version"
2
3
  require "bonethug/installer"
3
4
  require "bonethug/watcher"
data/lib/init.rb ADDED
@@ -0,0 +1,29 @@
1
+ class String
2
+ def to_bool
3
+ return true if self == true || self =~ (/^(true|t|yes|y|1)$/i)
4
+ return false if self == false || self.blank? || self =~ (/^(false|f|no|n|0)$/i)
5
+ raise ArgumentError.new("invalid value for Boolean: \"#{self}\"")
6
+ end
7
+ end
8
+
9
+ class Fixnum
10
+ def to_bool
11
+ return true if self == 1
12
+ return false if self == 0
13
+ raise ArgumentError.new("invalid value for Boolean: \"#{self}\"")
14
+ end
15
+ end
16
+
17
+ class TrueClass
18
+ def to_i; 1; end
19
+ def to_bool; self; end
20
+ end
21
+
22
+ class FalseClass
23
+ def to_i; 0; end
24
+ def to_bool; self; end
25
+ end
26
+
27
+ class NilClass
28
+ def to_bool; false; end
29
+ end
@@ -36,7 +36,7 @@ sudo apt-get install git ruby1.9.3 wkhtmltopdf nodejs npm
36
36
  # Configure stuff
37
37
  # -----------------------------------------------------
38
38
 
39
- # unix socket
39
+ # unix socket
40
40
  # echo "
41
41
  # <IfModule mod_fastcgi.c>
42
42
  # AddHandler php5-fcgi .php
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.77
4
+ version: 0.0.78
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-04-05 00:00:00.000000000 Z
12
+ date: 2014-04-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -394,6 +394,7 @@ files:
394
394
  - lib/bonethug/utils.rb
395
395
  - lib/bonethug/version.rb
396
396
  - lib/bonethug/watcher.rb
397
+ - lib/init.rb
397
398
  - lib/tasks/bonethug.rake
398
399
  - scripts/ubuntu_setup.sh
399
400
  - scripts/ubuntu_setup_2.4.sh
@@ -556,7 +557,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
556
557
  version: '0'
557
558
  segments:
558
559
  - 0
559
- hash: 964366539695014773
560
+ hash: 4336628524101868890
560
561
  required_rubygems_version: !ruby/object:Gem::Requirement
561
562
  none: false
562
563
  requirements:
@@ -565,7 +566,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
565
566
  version: '0'
566
567
  segments:
567
568
  - 0
568
- hash: 964366539695014773
569
+ hash: 4336628524101868890
569
570
  requirements: []
570
571
  rubyforge_project:
571
572
  rubygems_version: 1.8.23