bonethug 0.0.31 → 0.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore CHANGED
@@ -16,3 +16,5 @@ spec/reports
16
16
  test/tmp
17
17
  test/version_tmp
18
18
  tmp
19
+ *.sublime-project
20
+ *.sublime-workspace
data/config/cnf.yml CHANGED
@@ -165,11 +165,11 @@ watch:
165
165
  -
166
166
  src: public/themes/project/scss
167
167
  dest: public/themes/project/css
168
- filter: !ruby/regexp '/typography\.scss$/'
168
+ filter: !ruby/regexp '/typography\.scss$/'
169
169
  coffee:
170
170
  -
171
171
  src: public/project/coffee
172
172
  dest: public/project/javascript
173
- filter: !ruby/regexp '/main\.coffee$/'
173
+ filter: !ruby/regexp '/^.+\.coffee$/'
174
174
  log_dirs:
175
175
  - log
@@ -37,7 +37,10 @@ module Bonethug
37
37
  puts 'Installing '+ type + ' to ' + target + '...'
38
38
 
39
39
  # load the configuration
40
- raise "Unsupported type: " + type.to_s unless @@conf.get('project_types').has_key? type.to_s
40
+ unless @@conf.get('project_types').has_key? type.to_s
41
+ puts "Unsupported type: " + type.to_s
42
+ exit
43
+ end
41
44
  conf = @@conf.node_merge 'base', 'project_types.' + type
42
45
 
43
46
  # set the tmp dir
@@ -199,10 +202,15 @@ module Bonethug
199
202
  @@project_config_files.each do |type, dirs|
200
203
  dirs.each do |config|
201
204
 
205
+ # vars
202
206
  src_file = @@bonthug_gem_dir + '/config/' + config
203
207
  example_file = target + '/config/example/' + config if type == :editable
204
208
  target_file = type == :editable ? target + '/config/' + config : target + '/.bonethug/' + config
205
209
 
210
+ # output
211
+ puts 'Handling ' + target_file
212
+
213
+ # what mode are we in?
206
214
  if mode == :init
207
215
  FileUtils.cp src_file, example_file if type == :editable and !File.exist?(example_file)
208
216
  FileUtils.cp src_file, target_file unless File.exist?(target_file)
@@ -210,12 +218,35 @@ module Bonethug
210
218
  FileUtils.cp src_file, example_file if type == :editable
211
219
  FileUtils.cp src_file, target_file if type == :generated or !File.exist?(target_file)
212
220
  else
213
- raise "invalid bonethugise mode"
221
+ puts "Invalid bonethugise mode"
222
+ exit
214
223
  end
215
224
 
216
225
  end
217
226
  end
218
227
 
228
+ # Handle project type specific files
229
+ if mode == :update
230
+ target_cnf = target + '/config/cnf.yml'
231
+ project_conf = Conf.new.add target_cnf
232
+ project_type = project_conf.get('deploy.common.project_type')
233
+ if project_type
234
+ bonethug_files = @@conf.get 'project_types.' + project_type + '.bonethug_files'
235
+ bonethug_files.each do |index, file|
236
+ puts 'Handling ' + index.to_s + ':' + file.to_s
237
+ src_file = @@bonthug_gem_dir +
238
+ '/skel/project_types/' +
239
+ project_type +
240
+ '/' +
241
+ file
242
+ dst_file = target + '/' + file
243
+ FileUtils.cp src_file, dst_file
244
+ end
245
+ else
246
+ puts "Couldn't find project type in " + target_cnf
247
+ end
248
+ end
249
+
219
250
  # handle gemfile
220
251
  gemfile_path = target + '/Gemfile'
221
252
  if File.exist? gemfile_path
@@ -1,3 +1,3 @@
1
1
  module Bonethug
2
- VERSION = "0.0.31"
2
+ VERSION = "0.0.32"
3
3
  end
data/skel/base/Gemfile CHANGED
@@ -3,4 +3,4 @@ source "https://rubygems.org"
3
3
  gem 'mina', github: 'nadarei/mina'
4
4
  gem 'astrails-safe', github: 'astrails/safe'
5
5
  gem 'whenever', github: 'javan/whenever'
6
- gem 'bonethug'
6
+ gem 'bonethug', '>=0.0.31'
@@ -33,6 +33,14 @@ class SS_LoadConf {
33
33
  }
34
34
 
35
35
  }
36
+
37
+ public static function translate_env($env) {
38
+ if (!empty(self::$ss_env[$env])) {
39
+ return self::$ss_env[$env];
40
+ } else {
41
+ return $env;
42
+ }
43
+ }
36
44
 
37
45
  public static function cnf() {
38
46
 
@@ -73,6 +73,13 @@ switch(APPLICATION_ENV){
73
73
 
74
74
  }
75
75
 
76
+ // Allow override in dev and stage mode for testing asset pipeline
77
+ // ---------------------------
78
+
79
+ if (!empty($_GET['env']) && (APPLICATION_ENV == 'staging' || APPLICATION_ENV == 'development')) {
80
+ Director::set_environment_type(SS_LoadConf::translate_env($_GET['env']));
81
+ }
82
+
76
83
  // DB
77
84
  // ---------------------------
78
85
 
@@ -119,29 +126,58 @@ if (!defined('SS_SITE_DATABASE_NAME')) define('SS_SITE_DATABASE_NAME', $database
119
126
  Config::inst()->update('GDBackend', 'default_quality', 80);
120
127
 
121
128
 
122
- // JS Assets
129
+ // Assets
123
130
  // ---------------------------
124
131
 
125
- Config::inst()->update('Requirements', 'write_js_to_body', false);
126
- Requirements::combine_files(
127
- 'application.js',
128
- array(
129
- 'vendor/jquery/jquery.min.js',
130
- 'project/javascript/main.js',
131
- 'vendor/selectivizr/selectivizr.min.js',
132
- 'vendor/respond/respond.min.js',
133
- 'vendor/modernizr/modernizr.js'
134
- )
132
+ Requirements::set_write_js_to_body(true);
133
+ Requirements::set_combined_files_enabled(true);
134
+
135
+ // CSS
136
+ // ---
137
+
138
+ $cssRequirements = array(
139
+ 'themes/project/css/styles.css',
140
+ 'themes/project/css/typography.css'
135
141
  );
142
+ Requirements::combine_files('application.css', $cssRequirements);
136
143
 
144
+ // Primary JS
145
+ // ----------
137
146
 
138
- // CSS Assets
139
- // ---------------------------
147
+ $jsRequirements = array(
148
+ 'vendor/jquery/jquery.min.js',
149
+ 'project/javascript/main.js',
150
+ 'project/javascript/forms.js'
151
+ );
152
+ Requirements::combine_files('application.js', $jsRequirements);
140
153
 
141
- Requirements::combine_files(
142
- 'application.css',
154
+ // HTML5 Shims
155
+ // -----------
156
+
157
+ $shimRequirments = array(
158
+ 'vendor/selectivizr/selectivizr.min.js',
159
+ 'vendor/respond/respond.min.js',
160
+ 'vendor/modernizr/modernizr.js'
161
+ );
162
+ Requirements::combine_files('lte-ie8-shims.js',$shimRequirments);
163
+ RequirementsHelper::require_block(array_merge(
164
+ array('assets/_combinedfiles/lte-ie8-shims.js'),
165
+ $shimRequirments
166
+ ));
167
+ Requirements::insertHeadTags('
168
+ <!--[if (gte IE 6)&(lte IE 8)]>
169
+ <script src="/assets/_combinedfiles/lte-ie8-shims.js"></script>
170
+ <![endif]-->
171
+ ');
172
+
173
+ // block all front end requirements from the cms
174
+ LeftAndMainHelper::require_block(array_merge(
143
175
  array(
144
- 'themes/project/main.css',
145
- 'themes/project/typography.css'
146
- )
147
- );
176
+ 'assets/_combinedfiles/application.css',
177
+ 'assets/_combinedfiles/application.js',
178
+ 'assets/_combinedfiles/lte-ie8-shims.js'
179
+ ),
180
+ $cssRequirements,
181
+ $jsRequirements,
182
+ $shimRequirments
183
+ ));
@@ -44,14 +44,6 @@ class Page_Controller extends ContentController {
44
44
 
45
45
  public function init() {
46
46
  parent::init();
47
-
48
- // Note: you should use SS template require tags inside your templates
49
- // instead of putting Requirements calls here. However these are
50
- // included so that our older themes still work
51
- Requirements::themedCSS('reset');
52
- Requirements::themedCSS('layout');
53
- Requirements::themedCSS('typography');
54
- Requirements::themedCSS('form');
55
47
  }
56
48
 
57
49
  }
@@ -0,0 +1,15 @@
1
+ @function image-path($file) {
2
+ @return $image-path + '/' + $file;
3
+ }
4
+
5
+ @function font-path($file) {
6
+ @return $font-path + '/' + $file;;
7
+ }
8
+
9
+ @function image-url($file) {
10
+ @return url(image-path($file));
11
+ }
12
+
13
+ @function font-url($file) {
14
+ @return url(font-path($file));
15
+ }
@@ -0,0 +1,10 @@
1
+ @mixin define-font($font-name, $font) {
2
+ @font-face {
3
+ font-family: $font-name;
4
+ src: url(font_path('#{$font}.eot'));
5
+ src: url(font_path('#{$font}.eot')) format('embedded-opentype'),
6
+ url(font_path('#{$font}.woff')) format('woff'),
7
+ url(font_path('#{$font}.ttf')) format('truetype'),
8
+ url(font_path('#{$font}.svg')) format('svg');
9
+ }
10
+ }
@@ -0,0 +1,2 @@
1
+ $image_path: '/themes/project/images';
2
+ $font_path: '/themes/project/fonts';
@@ -0,0 +1,3 @@
1
+ @import 'vars',
2
+ 'functions',
3
+ 'mixins';
@@ -19,13 +19,6 @@
19
19
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
20
20
  $MetaTags(false)
21
21
 
22
- <!--[if lt IE 9]>
23
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
24
- <![endif]-->
25
-
26
- <% require themedCSS('application') %>
27
- <% require themedCSS('typography') %>
28
-
29
22
  <link rel="shortcut icon" href="themes/project/images/favicon.ico" type="image/x-icon" />
30
23
  <link rel="apple-touch-icon" href="themes/project/images/apple-touch-icon.png" />
31
24
  <link rel="apple-touch-icon" sizes="57x57" href="themes/project/images/apple-touch-icon-57x57.png" />
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.31
4
+ version: 0.0.32
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: 2013-10-04 00:00:00.000000000 Z
12
+ date: 2013-10-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -384,6 +384,9 @@ files:
384
384
  - skel/project_types/silverstripe3/public/themes/project/images/favicons/apple-touch-icon.png
385
385
  - skel/project_types/silverstripe3/public/themes/project/images/favicons/favicon.ico
386
386
  - skel/project_types/silverstripe3/public/themes/project/images/favicons/iconifier-readme.txt
387
+ - skel/project_types/silverstripe3/public/themes/project/scss/_functions.scss
388
+ - skel/project_types/silverstripe3/public/themes/project/scss/_mixins.scss
389
+ - skel/project_types/silverstripe3/public/themes/project/scss/_vars.scss
387
390
  - skel/project_types/silverstripe3/public/themes/project/scss/main.scss
388
391
  - skel/project_types/silverstripe3/public/themes/project/scss/typography.scss
389
392
  - skel/project_types/silverstripe3/public/themes/project/templates/Includes/.gitkeep