dhole 0.0.2 → 0.0.3

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: 0ec9a1b3cf83cdf6547b06d5ac378eba04b481f7
4
- data.tar.gz: e28f8fffa4fa80acb1b454b08271d906e0ca329c
3
+ metadata.gz: 75d4063a1ac95ea0d0e709389eacbff99a6dcbb1
4
+ data.tar.gz: 706e0dbdb55c6268e2d1f641f75fb6b904973107
5
5
  SHA512:
6
- metadata.gz: f7f0983e1191f2d09d1ff9a1a7a8982c225eeba60d903dd31f5e0db5aab525be3a2bae0ba404fecacb76494048eb0865f7cde858488127d338cce966fe89e1d1
7
- data.tar.gz: e9db9f11a06a421bd28a006574196284551a41b868e38e802371d44523439f662155dc887bf0c67da930419fcbf7365bccfc2f4eec63b4a17782b86a246706b0
6
+ metadata.gz: 6a6f4177fae1b8f22efd068661f190ae6f683476b168e3a53a35d075ca088eb47198a49cb78be5b1e4aa72e772e28874c15a2c3dd5d195febf0f9c2d30dbc7d5
7
+ data.tar.gz: 8dce7597f898b269e5f9c470c61a28831f8bed0d9a904020d37df42a463d8335b5447fea8b48110c3c87af8c33f82675a63daa637925958d2494490a7b7e36bf
@@ -21,4 +21,5 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "bundler", "~> 1.7"
22
22
  spec.add_development_dependency "rake", "~> 10.0"
23
23
  spec.add_development_dependency "activerecord"
24
+ spec.add_development_dependency "composite_primary_keys"
24
25
  end
@@ -1,7 +1,8 @@
1
1
  module Dhole
2
2
  class GlobalImageLink < ActiveRecord::Base
3
3
  self.table_name = 'globalimagelinks'
4
- belongs_to :linking_page, class_name: 'Page', foreign_key: 'gil_from'
4
+ self.primary_keys = 'gil_to', 'gil_wiki', 'gil_page'
5
+ #belongs_to :linking_page, class_name: 'Page', foreign_key: 'gil_from'
5
6
  #belongs_to :linked_image, class_name: 'Image', foreign_key: 'gil_to' # TODO: replace this with an actual lookup, as this doesn't resolve to an ID, of course
6
7
  end
7
8
  end
@@ -1,6 +1,7 @@
1
1
  module Dhole
2
2
  class Image < ActiveRecord::Base
3
3
  self.table_name = 'image'
4
+ self.primary_key = 'img_name'
4
5
  #has_many :localimagelinks, class_name: 'ImageLink'
5
6
  #has_many :localusages, through: :image_links, class_name: 'Page'
6
7
 
@@ -10,7 +11,7 @@ module Dhole
10
11
  ImageLink.where(il_to: img_name).pluck(:il_from)
11
12
  end
12
13
  def global_usage
13
- GlobalImageLink.where(gil_to: img_name).pluck(:gil_from)
14
+ GlobalImageLink.where(gil_to: img_name, gil_namespace_id: '0').pluck(:gil_wiki, :gil_page)
14
15
  end
15
16
  end
16
17
  end
@@ -1,6 +1,7 @@
1
1
  module Dhole
2
2
  class Page < ActiveRecord::Base
3
3
  self.table_name = 'page'
4
+ self.primary_key = 'page_id'
4
5
  has_many :categories
5
6
  has_many :langlinks, class_name: 'LangLink', foreign_key: 'll_from'
6
7
  has_many :imagelinks, class_name: 'ImageLink', foreign_key: 'il_from'
@@ -1,6 +1,7 @@
1
1
  module Dhole
2
2
  class Revision < ActiveRecord::Base
3
3
  self.table_name = 'revision'
4
+ self.primary_key = 'rev_id'
4
5
  belongs_to :text, :class_name => 'Text', :foreign_key => 'rev_text_id'
5
6
  end
6
7
  end
@@ -1,6 +1,7 @@
1
1
  module Dhole
2
2
  class Text < ActiveRecord::Base
3
3
  self.table_name = 'text'
4
+ self.primary_key = 'old_id'
4
5
  has_one :revision, :class_name => 'Revision'
5
6
  end
6
7
  end
@@ -1,3 +1,3 @@
1
1
  module Dhole
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dhole
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Asaf Bartov
@@ -14,42 +14,56 @@ dependencies:
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.7'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activerecord
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: composite_primary_keys
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
55
69
  description: ActiveRecord mapping of main Mediawiki entities and relationships
@@ -59,7 +73,7 @@ executables: []
59
73
  extensions: []
60
74
  extra_rdoc_files: []
61
75
  files:
62
- - .gitignore
76
+ - ".gitignore"
63
77
  - Gemfile
64
78
  - LICENSE.txt
65
79
  - README.md
@@ -84,17 +98,17 @@ require_paths:
84
98
  - lib
85
99
  required_ruby_version: !ruby/object:Gem::Requirement
86
100
  requirements:
87
- - - '>='
101
+ - - ">="
88
102
  - !ruby/object:Gem::Version
89
103
  version: '0'
90
104
  required_rubygems_version: !ruby/object:Gem::Requirement
91
105
  requirements:
92
- - - '>='
106
+ - - ">="
93
107
  - !ruby/object:Gem::Version
94
108
  version: '0'
95
109
  requirements: []
96
110
  rubyforge_project:
97
- rubygems_version: 2.4.5
111
+ rubygems_version: 2.4.3
98
112
  signing_key:
99
113
  specification_version: 4
100
114
  summary: Mediawiki Object-Relational Mapping