bonethug 0.0.37 → 0.0.38

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/config/deploy.rb CHANGED
@@ -184,7 +184,7 @@ task :deploy => :environment do
184
184
  queue! %[php #{deploy_to}/shared/composer.phar install] if use_composer
185
185
 
186
186
  # update bower
187
- queue! %[cd #{deploy_to}/current && bower install] if use_bower
187
+ queue! %[cd #{deploy_to}/current && bower install --allow-root] if use_bower
188
188
 
189
189
  # build the vhosts
190
190
  vh_cnf = conf.get('apache.'+env)
@@ -1,3 +1,3 @@
1
1
  module Bonethug
2
- VERSION = "0.0.37"
2
+ VERSION = "0.0.38"
3
3
  end
@@ -4,6 +4,9 @@
4
4
  # install native stuff
5
5
  # -----------------------------------------------------
6
6
 
7
+ # add repos
8
+ sudo add-apt-repository ppa:richarvey/nodejs
9
+
7
10
  # update
8
11
  sudo apt-get update && sudo apt-get upgrade
9
12
 
@@ -1,6 +1,8 @@
1
1
  <?php
2
2
  class Page extends SiteTree {
3
3
 
4
+ protected static $page_cache = array();
5
+
4
6
  private static $can_be_root = true;
5
7
 
6
8
  private static $db = array(
@@ -21,6 +23,35 @@ class Page extends SiteTree {
21
23
  return $fields;
22
24
  }
23
25
 
26
+ // Helper functions
27
+ // -----------------
28
+
29
+ public static function get_a($pageType = 'Page') {
30
+ $page = null;
31
+ if (!empty(self::$page_cache[$pageType])) $page = self::$page_cache[$pageType];
32
+ else if ($page = DataObject::get_one($pageType)) self::$page_cache[$pageType] = $page;
33
+ return $page;
34
+ }
35
+
36
+ public function IsA ($className) {
37
+ return is_a($this, $className);
38
+ }
39
+
40
+ public function AreSamePage ($page1, $page2) {
41
+ return $page1->ID == $page2->ID;
42
+ }
43
+
44
+ public function PaginatedChildren($limit = null, $order = 'Created DESC', $hitsOptions = null){
45
+
46
+ if ($limit === null) $limit = self::$hits_per_page;
47
+
48
+ $do = new DataObject;
49
+ $do->DataSet = AbcPaginator::get($limit)->fetch('Page', "ParentID = ".$this->ID, $order);
50
+ $do->Paginator = $do->DataSet->Paginator->dataForTemplate($do->DataSet->unlimitedRowCount, 2, null, $hitsOptions);
51
+ $do->HitsSelector = $do->Paginator->HitsSelector;
52
+ return $do;
53
+ }
54
+
24
55
  }
25
56
  class Page_Controller extends ContentController {
26
57
 
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.37
4
+ version: 0.0.38
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: