dhole 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca426da461b0ab06c4b9dad7766ff45f6fb6d181
4
- data.tar.gz: b6bb46a2b5098e4ef02a2b8b5a0ab0e5740691a4
3
+ metadata.gz: ea3e26a872bf3ce473226958865031e61b0ff641
4
+ data.tar.gz: cb07c43af5be8e7c40df298306ead5f4ba5d2eae
5
5
  SHA512:
6
- metadata.gz: 7b3cbc4a6e02130b023dd72491c401ccf1ba7d295606b826a03db737b17ec958e150d08ec87ce2b9f17a5064db95df594712de5e65fcab22bd64228a508b0a25
7
- data.tar.gz: ec928e06571c6120021d8a02d7b0f513f166f29d6ec905d16aceeeddcefec5928123038e846df20914cf4a6a28053d9224fe9399b8e1b1f8a8bf8b9fe0f1c2ba
6
+ metadata.gz: 94d54aa01271f823c4d56b15a2dabcd2b40f3f47cbcaa5a3781b8ca500207b6878665e86442c086f2863b0b6360af1a73c712082f43b550b394af1d1108750ae
7
+ data.tar.gz: a2e11c56c6e24f2d681773cc9bf45f03c7bbbd8f96b869b73f22be3cebb5e2f6f5a7592f73b5727f0f7756fab95eae9e4cf5eb344f30c6adef50bacee1aef575
@@ -8,6 +8,8 @@ require "dhole/text.rb"
8
8
  require "dhole/image.rb"
9
9
  require "dhole/imagelink.rb"
10
10
  require "dhole/globalimagelink.rb"
11
+ require "dhole/category.rb"
12
+ require "dhole/categorylink.rb"
11
13
 
12
14
  module Dhole
13
15
  class Dhole
@@ -0,0 +1,18 @@
1
+ module Dhole
2
+ class Category < ActiveRecord::Base
3
+ self.table_name = 'category'
4
+ self.primary_key = 'cat_id'
5
+ # cat_files, cat_title
6
+
7
+ def members
8
+ CategoryLink.where(cl_to: cat_title) || []
9
+ end
10
+ def member_pages
11
+ members.select{|cl| cl.cl_type == 'page'}.map {|cl| Page.find(cl.cl_from)}
12
+ end
13
+ # return only members of specified type ('file','page', 'subcat')
14
+ def members_by_type(mtype)
15
+ # TBD
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,7 @@
1
+ module Dhole
2
+ class CategoryLink < ActiveRecord::Base
3
+ self.table_name = 'categorylinks'
4
+ belongs_to :page, class_name: 'Page', foreign_key: 'cl_from'
5
+ # cat_files, cat_title
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module Dhole
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dhole
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Asaf Bartov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-19 00:00:00.000000000 Z
11
+ date: 2014-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,6 +80,8 @@ files:
80
80
  - Rakefile
81
81
  - dhole.gemspec
82
82
  - lib/dhole.rb
83
+ - lib/dhole/category.rb
84
+ - lib/dhole/categorylink.rb
83
85
  - lib/dhole/globalimagelink.rb
84
86
  - lib/dhole/image.rb
85
87
  - lib/dhole/imagelink.rb