gollum_rails 1.4.13 → 1.4.14

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: 5f67ec69d7746afcea87ebf4ae4cc57625b5735c
4
- data.tar.gz: c9bf925679161f987317347e05fafa8caf5fd477
3
+ metadata.gz: 1b14f13cec09a2773a0f5a9c15005db2c886d8e1
4
+ data.tar.gz: 4ba9089266e351d09ea4beb5c3f385dbbcad19d8
5
5
  SHA512:
6
- metadata.gz: 151b9810a740a25fea35423bde68cc862b39c27094479ed8329fcac3b7c4644ea9f485ef9cb311460a3e17a25378bcbd49ba414ce93e1da271b66fcd6c40d5b5
7
- data.tar.gz: 6d4e9b50bcd96ee9c62372ba1f12422b3d3fa7612d33eed097d7c93035f0bc77bd3bc1ec57780c49da0225a9a3ef46d9cfcb82524464f9cabc85e8c68b6b61d8
6
+ metadata.gz: 189fad38e9cdc87b1b1939e99a5ab4a7f01ee11e7a00d1f2ae247089862fa21ec59dd4637b4f11406be3de600d0a9273b0c4beff7a900cd17364c0d356046d72
7
+ data.tar.gz: 331d7592754e7c9873e01c07c055cac68a6f8bf6b2a1fbe738448690f66760b47593a39ff03b98d734a97cd85ed674021429b24fcdd11ec851537d4a45a33c46
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gollum_rails (1.4.13)
4
+ gollum_rails (1.4.14)
5
5
  activemodel (>= 3.2.11)
6
6
  activesupport (>= 3.2.11)
7
7
  gollum-lib (~> 1.0.9)
data/HISTORY.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 1.4.14 21th January 2014
2
+ * set directory by calling Page.folder= or Page.set_folder
3
+ * all supports directories
4
+ * improved specs
5
+
1
6
  # 1.4.13 16th January 2014
2
7
  * Update wiki reloading
3
8
 
data/gollum_rails.gemspec CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
4
4
  s.name = 'gollum_rails'
5
5
  s.rubyforge_project = s.name
6
6
 
7
- s.version = '1.4.13'
7
+ s.version = '1.4.14'
8
8
 
9
9
  s.summary = 'Combines Gollum and Rails'
10
10
  s.description= 'include Gollum into Rails with ease'
data/lib/gollum_rails.rb CHANGED
@@ -44,7 +44,7 @@ module GollumRails
44
44
  autoload :Orm
45
45
 
46
46
  # GollumRails version string
47
- VERSION = '1.4.13'
47
+ VERSION = '1.4.14'
48
48
 
49
49
  end
50
50
 
@@ -13,6 +13,16 @@ module GollumRails
13
13
  Gollum::Markup.formats.include?(format.to_sym)
14
14
  end
15
15
 
16
+ def set_folder(options)
17
+ if options.kind_of? Hash
18
+
19
+ return if options.empty?
20
+ options = options[:folder]
21
+ end
22
+ Setup.wiki_options = { page_file_dir: options }
23
+ end
24
+ alias_method :folder=, :set_folder
25
+
16
26
 
17
27
 
18
28
  end
@@ -31,6 +41,7 @@ module GollumRails
31
41
  end
32
42
  end
33
43
 
44
+
34
45
 
35
46
  def path_name
36
47
  name.gsub(/(^\/|(\/){2}+|#{canonicalized_filename})/, "")
@@ -55,6 +66,8 @@ module GollumRails
55
66
  wiki.preview_page(name, content, format).formatted_data
56
67
  end
57
68
 
69
+
70
+
58
71
  # == Gets the url for current page from Gollum::Page
59
72
  #
60
73
  # Returns a String
@@ -41,13 +41,22 @@ module GollumRails
41
41
  end
42
42
 
43
43
  # Gets all pages in the wiki
44
- def all
44
+ def all(options={})
45
+ set_folder(options)
45
46
  pages = wiki.pages
46
47
  r = pages.map do |page|
47
48
  self.new(gollum_page: page)
48
49
  end
49
50
  end
50
51
 
52
+ def first(options)
53
+ all(options).first
54
+ end
55
+
56
+ def last(options)
57
+ all(options).last
58
+ end
59
+
51
60
  alias_method :find_all, :all
52
61
 
53
62
  # TODO: implement more of this (format, etc)
@@ -432,6 +432,7 @@ describe "Gollum Page" do
432
432
 
433
433
  end
434
434
 
435
+
435
436
  describe "path names" do
436
437
  class Fns < GollumRails::Page
437
438
  end
@@ -442,6 +443,48 @@ describe "Gollum Page" do
442
443
  end
443
444
 
444
445
  it "should output a path name as there was a path supplied" do
446
+ res = Fns.new @call.merge(name: 'test/pagess')
447
+ res.save
448
+ res2 = Fns.new @call.merge(name: 'test/pagess2')
449
+ res2.save
450
+ expect(Fns.all(folder: 'test').length).to be 2
451
+ #expect(res.path_name).not_to be_nil
452
+ res2.destroy(@commit)
453
+ res.destroy(@commit)
454
+ end
455
+ it "should find more pages under root without options" do
456
+ res = Fns.new @call.merge(name: 'test4/pagess')
457
+ res2 = Fns.new @call.merge(name: 'test5/pagess')
458
+ res.save
459
+ res2.save
460
+ #Fns.all(folder: 'test1/').each{|p| puts p.url}
461
+ expect(Fns.all(folder: 'test4').length).to be 1
462
+ expect(Fns.all(folder: 'test5').length).to be 1
463
+
464
+ res2.destroy(@commit)
465
+ res.destroy(@commit)
466
+
467
+ end
468
+
469
+ it "should be empty for a non existing folder" do
470
+ res = Fns.new @call.merge(name: 'test/pagess')
471
+ res.save
472
+
473
+ expect(Fns.first(folder: 'test2')).to be_nil
474
+ expect(Fns.last(folder: 'test2')).to be_nil
475
+
476
+ res.destroy(@commit)
477
+ end
478
+ it "should not be empty for an existing folder" do
479
+ res = Fns.new @call.merge(name: 'test/pagess')
480
+ res.save
481
+
482
+ expect(Fns.first(folder: 'test')).not_to be_nil
483
+ expect(Fns.last(folder: 'test')).not_to be_nil
484
+
485
+ res.destroy(@commit)
486
+ end
487
+ it "should change the folder" do
445
488
  res = Fns.new @call.merge(name: 'test/pagess')
446
489
  res.save
447
490
  expect(res.path_name).not_to be_nil
metadata CHANGED
@@ -1,139 +1,139 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gollum_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.13
4
+ version: 1.4.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Kasper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-16 00:00:00.000000000 Z
11
+ date: 2014-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.2.11
20
20
  type: :runtime
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: 3.2.11
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 3.2.11
34
34
  type: :runtime
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: 3.2.11
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: gollum-lib
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 1.0.9
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.0.9
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 2.13.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 2.13.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rr
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: 1.1.1
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 1.1.1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rails
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: 3.2.11
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: 3.2.11
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: guard
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: guard-rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rb-fsevent
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - '>='
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  description: include Gollum into Rails with ease
@@ -189,12 +189,12 @@ require_paths:
189
189
  - lib
190
190
  required_ruby_version: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - '>='
192
+ - - ">="
193
193
  - !ruby/object:Gem::Version
194
194
  version: 1.9.3
195
195
  required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  requirements:
197
- - - '>='
197
+ - - ">="
198
198
  - !ruby/object:Gem::Version
199
199
  version: '0'
200
200
  requirements: []