gollum-lib 4.0.2 → 4.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- N2Y4ZGU4MTBjNjg3YjBjNzVmNjNjZTE1ZjgzNWJjOWYwNGRhOGZjYw==
4
+ YjljZjMxYzNlY2MyMzg5NzYyZTk1ZGI2YjgwYzBhMDMzYmQ1MTRjZQ==
5
5
  data.tar.gz: !binary |-
6
- ZmZiMTllMGJiMWRhNzUyMDIyNDUzZWZlMjBkNjlkYTNhMjAyN2UwOA==
6
+ ODIyNzMyNmU1ODlhZjRmMzU3MjRjMDU3YWIwZjI3YjhkZTZiZDdmZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDFmMDkyODFlZjc0YzJmMGNkNWIwNmI4NTk0OGJkYWQ1MTIwYzY3MTlkZjRh
10
- N2ZjOTA5ODgwYjJkOGUyMzU1YTczN2EwOGJjMWQxMGMwYmIxMzE1NWJlZDBj
11
- ZjJhNzc1ZDZjOTFjNGZkZTkzYTkxNGQxN2YxYjNkM2FhYzkzNTE=
9
+ ZDc2NDRmNDk5OTcwZjY5OGI1Yzk1OTdiNDQyNWE0MTZhMmY2OTExOTVjMmE3
10
+ NDlkMWRmOGYyN2JhZTcwNTZmMGFhZDViZjA1OTMxMjkzZjQ4NjM1OGVhZjRk
11
+ MjMyNzM4OWU4YTQ5YWY3YzE4NzUxNjAxNTUwNmM1YjBlMDExYWU=
12
12
  data.tar.gz: !binary |-
13
- N2FkZGIwZGU5YTZkM2NiNGYwMWMzOGEyMDU1Yzc5MzcxYmU3N2MwNzdkMWIz
14
- MTYwOGQ1OTViNmJmMmM2ZmQ3NWM1OTQyMDVlYTYwYjJhOTYwNThlZmZiNDMz
15
- OTU5NzM2ZGFkOGQxZmY0YjZiOTYxYzMwMmZlOGViYzFmMWQ4YTE=
13
+ MGRmNDc4OTVlYjIzMTU2ZGQ3YWQzZGVkMmIzZGVhNGVlMDNiMDA1MTM3Mjg4
14
+ NjJiMmY1MTBhOWIwZWY0ZTc5ZWY0MzUyYzk3MTVhMDVhYmFhNzJlYzU5MjQ4
15
+ N2UyYmEzNmZlYTM4YjAxYzE3MjljZWE5NjQ2NzAwZDliNDExODc=
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gemspec
3
+ gemspec :name => RUBY_PLATFORM == 'java' ? 'gollum-lib_java' : 'gollum-lib'
data/Rakefile CHANGED
@@ -13,7 +13,7 @@ def name
13
13
  end
14
14
 
15
15
  def version
16
- line = File.read("lib/#{name}.rb")[/^\s*VERSION\s*=\s*.*/]
16
+ line = File.read("lib/gollum-lib/version.rb")[/^\s*VERSION\s*=\s*.*/]
17
17
  line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
18
18
  end
19
19
 
@@ -27,13 +27,13 @@ def next_version
27
27
  end
28
28
 
29
29
  def bump_version
30
- old_file = File.read("lib/#{name}.rb")
30
+ old_file = File.read("lib/gollum-lib/version.rb")
31
31
  old_version_line = old_file[/^\s*VERSION\s*=\s*.*/]
32
32
  new_version = next_version
33
33
  # replace first match of old version with new version
34
34
  old_file.sub!(old_version_line, " VERSION = '#{new_version}'")
35
35
 
36
- File.write("lib/#{name}.rb", old_file)
36
+ File.write("lib/gollum-lib/version.rb", old_file)
37
37
 
38
38
  new_version
39
39
  end
@@ -47,11 +47,15 @@ def rubyforge_project
47
47
  end
48
48
 
49
49
  def gemspec_file
50
- "#{name}.gemspec"
50
+ "gemspec.rb"
51
51
  end
52
52
 
53
- def gem_file
54
- "#{name}-#{version}.gem"
53
+ def gemspecs
54
+ ["#{name}.gemspec", "#{name}_java.gemspec"]
55
+ end
56
+
57
+ def gem_files
58
+ ["#{name}-#{version}.gem", "#{name}-#{version}-java.gem"]
55
59
  end
56
60
 
57
61
  def replace_header(head, header_name)
@@ -124,6 +128,7 @@ task :release => :build do
124
128
  sh "git push origin master"
125
129
  sh "git push origin v#{version}"
126
130
  sh "gem push pkg/#{name}-#{version}.gem"
131
+ sh "gem push pkg/#{name}-#{version}-java.gem"
127
132
  end
128
133
 
129
134
  desc 'Publish to rubygems. Same as release'
@@ -132,8 +137,12 @@ task :publish => :release
132
137
  desc 'Build gem'
133
138
  task :build => :gemspec do
134
139
  sh "mkdir -p pkg"
135
- sh "gem build #{gemspec_file}"
136
- sh "mv #{gem_file} pkg"
140
+ gemspecs.each do |gemspec|
141
+ sh "gem build #{gemspec}"
142
+ end
143
+ gem_files.each do |gem_file|
144
+ sh "mv #{gem_file} pkg"
145
+ end
137
146
  end
138
147
 
139
148
  desc 'Update gemspec'
@@ -144,7 +153,6 @@ task :gemspec => :validate do
144
153
 
145
154
  # replace name version and date
146
155
  replace_header(head, :name)
147
- replace_header(head, :version)
148
156
  replace_header(head, :date)
149
157
  #comment this out if your rubyforge_project has a different name
150
158
  replace_header(head, :rubyforge_project)
data/gemspec.rb ADDED
@@ -0,0 +1,100 @@
1
+ def specification(version, default_adapter, platform = nil)
2
+ Proc.new do |s|
3
+ s.specification_version = 2 if s.respond_to? :specification_version=
4
+ s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
5
+ s.rubygems_version = '0.0.1'
6
+ s.required_ruby_version = '>= 1.9'
7
+
8
+ s.name = 'gollum-lib'
9
+ s.version = version
10
+ s.platform = platform if platform
11
+ s.date = '2015-04-10'
12
+ s.rubyforge_project = 'gollum-lib'
13
+ s.license = 'MIT'
14
+
15
+ s.summary = 'A simple, Git-powered wiki.'
16
+ s.description = 'A simple, Git-powered wiki with a sweet API and local frontend.'
17
+
18
+ s.authors = ['Tom Preston-Werner', 'Rick Olson']
19
+ s.email = 'tom@github.com'
20
+ s.homepage = 'http://github.com/gollum/gollum-lib'
21
+
22
+ s.require_paths = %w[lib]
23
+
24
+ s.rdoc_options = ['--charset=UTF-8']
25
+ s.extra_rdoc_files = %w[README.md LICENSE]
26
+
27
+ s.add_dependency *default_adapter
28
+ s.add_dependency 'rouge', '~> 1.7.4'
29
+ s.add_dependency 'nokogiri', '~> 1.6.4'
30
+ s.add_dependency 'stringex', '~> 2.5.1'
31
+ s.add_dependency 'sanitize', '~> 2.1.0'
32
+ s.add_dependency 'github-markup', '~> 1.3.3'
33
+
34
+ s.add_development_dependency 'org-ruby', '~> 0.9.9'
35
+ s.add_development_dependency 'kramdown', '~> 1.6.0'
36
+ s.add_development_dependency 'RedCloth', '~> 4.2.9'
37
+ s.add_development_dependency 'mocha', '~> 1.1.0'
38
+ s.add_development_dependency 'shoulda', '~> 3.5.0'
39
+ s.add_development_dependency 'wikicloth', '~> 0.8.3'
40
+ s.add_development_dependency 'rake', '~> 10.4.0'
41
+ s.add_development_dependency 'pry', '~> 0.10.1'
42
+ # required by pry
43
+ s.add_development_dependency 'rb-readline', '~> 0.5.1'
44
+ # updating minitest-reporters requires a new minitest which fails with gollum's tests.
45
+ s.add_development_dependency 'minitest-reporters', '~> 0.14.16'
46
+ s.add_development_dependency 'nokogiri-diff', '~> 0.2.0'
47
+ # required by guard
48
+ s.add_development_dependency 'guard', '~> 2.8.2'
49
+ s.add_development_dependency 'guard-minitest', '~> 2.3.2'
50
+ s.add_development_dependency 'rb-inotify', '~> 0.9.3'
51
+ s.add_development_dependency 'rb-fsevent', '~> 0.9.4'
52
+ s.add_development_dependency 'rb-fchange', '~> 0.0.6'
53
+ s.add_development_dependency 'twitter_cldr', '~> 3.1.0'
54
+ # = MANIFEST =
55
+ s.files = %w[
56
+ Gemfile
57
+ HISTORY.md
58
+ LICENSE
59
+ README.md
60
+ Rakefile
61
+ docs/sanitization.md
62
+ gemspec.rb
63
+ gollum-lib.gemspec
64
+ gollum-lib_java.gemspec
65
+ lib/gollum-lib.rb
66
+ lib/gollum-lib/blob_entry.rb
67
+ lib/gollum-lib/committer.rb
68
+ lib/gollum-lib/file.rb
69
+ lib/gollum-lib/file_view.rb
70
+ lib/gollum-lib/filter.rb
71
+ lib/gollum-lib/filter/code.rb
72
+ lib/gollum-lib/filter/macro.rb
73
+ lib/gollum-lib/filter/metadata.rb
74
+ lib/gollum-lib/filter/plain_text.rb
75
+ lib/gollum-lib/filter/remote_code.rb
76
+ lib/gollum-lib/filter/render.rb
77
+ lib/gollum-lib/filter/sanitize.rb
78
+ lib/gollum-lib/filter/tags.rb
79
+ lib/gollum-lib/filter/toc.rb
80
+ lib/gollum-lib/filter/wsd.rb
81
+ lib/gollum-lib/git_access.rb
82
+ lib/gollum-lib/gitcode.rb
83
+ lib/gollum-lib/helpers.rb
84
+ lib/gollum-lib/hook.rb
85
+ lib/gollum-lib/macro.rb
86
+ lib/gollum-lib/macro/all_pages.rb
87
+ lib/gollum-lib/markup.rb
88
+ lib/gollum-lib/markups.rb
89
+ lib/gollum-lib/page.rb
90
+ lib/gollum-lib/pagination.rb
91
+ lib/gollum-lib/sanitization.rb
92
+ lib/gollum-lib/version.rb
93
+ lib/gollum-lib/wiki.rb
94
+ licenses/licenses.txt
95
+ ]
96
+ # = MANIFEST =
97
+
98
+ s.test_files = s.files.select { |path| path =~ /^test\/test_.*\.rb/ }
99
+ end
100
+ end
data/gollum-lib.gemspec CHANGED
@@ -1,94 +1,4 @@
1
- Gem::Specification.new do |s|
2
- s.specification_version = 2 if s.respond_to? :specification_version=
3
- s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
4
- s.rubygems_version = '0.0.1'
5
- s.required_ruby_version = '>= 1.9'
6
-
7
- s.name = 'gollum-lib'
8
- s.version = '4.0.2'
9
- s.date = '2015-01-19'
10
- s.rubyforge_project = 'gollum-lib'
11
- s.license = 'MIT'
12
-
13
- s.summary = 'A simple, Git-powered wiki.'
14
- s.description = 'A simple, Git-powered wiki with a sweet API and local frontend.'
15
-
16
- s.authors = ['Tom Preston-Werner', 'Rick Olson']
17
- s.email = 'tom@github.com'
18
- s.homepage = 'http://github.com/gollum/gollum-lib'
19
-
20
- s.require_paths = %w[lib]
21
-
22
- s.rdoc_options = ['--charset=UTF-8']
23
- s.extra_rdoc_files = %w[README.md LICENSE]
24
-
25
- s.add_dependency 'gollum-grit_adapter', '~> 0.1', '>= 0.1.1'
26
- s.add_dependency 'rouge', '~> 1.7.4'
27
- s.add_dependency 'nokogiri', '~> 1.6.4'
28
- s.add_dependency 'stringex', '~> 2.5.1'
29
- s.add_dependency 'sanitize', '~> 2.1.0'
30
- s.add_dependency 'github-markup', '~> 1.3.1'
31
-
32
- s.add_development_dependency 'org-ruby', '~> 0.9.9'
33
- s.add_development_dependency 'github-markdown', '~> 0.6.7'
34
- s.add_development_dependency 'RedCloth', '~> 4.2.9'
35
- s.add_development_dependency 'mocha', '~> 1.1.0'
36
- s.add_development_dependency 'shoulda', '~> 3.5.0'
37
- s.add_development_dependency 'wikicloth', '~> 0.8.1'
38
- s.add_development_dependency 'rake', '~> 10.4.0'
39
- s.add_development_dependency 'pry', '~> 0.10.1'
40
- # required by pry
41
- s.add_development_dependency 'rb-readline', '~> 0.5.1'
42
- # updating minitest-reporters requires a new minitest which fails with gollum's tests.
43
- s.add_development_dependency 'minitest-reporters', '~> 0.14.16'
44
- s.add_development_dependency 'nokogiri-diff', '~> 0.2.0'
45
- # required by guard
46
- s.add_development_dependency 'guard', '~> 2.8.2'
47
- s.add_development_dependency 'guard-minitest', '~> 2.3.2'
48
- s.add_development_dependency 'rb-inotify', '~> 0.9.3'
49
- s.add_development_dependency 'rb-fsevent', '~> 0.9.4'
50
- s.add_development_dependency 'rb-fchange', '~> 0.0.6'
51
- s.add_development_dependency 'twitter_cldr', '~> 3.1.0'
52
- # = MANIFEST =
53
- s.files = %w[
54
- Gemfile
55
- HISTORY.md
56
- LICENSE
57
- README.md
58
- Rakefile
59
- docs/sanitization.md
60
- gollum-lib.gemspec
61
- lib/gollum-lib.rb
62
- lib/gollum-lib/blob_entry.rb
63
- lib/gollum-lib/committer.rb
64
- lib/gollum-lib/file.rb
65
- lib/gollum-lib/file_view.rb
66
- lib/gollum-lib/filter.rb
67
- lib/gollum-lib/filter/code.rb
68
- lib/gollum-lib/filter/macro.rb
69
- lib/gollum-lib/filter/metadata.rb
70
- lib/gollum-lib/filter/plain_text.rb
71
- lib/gollum-lib/filter/remote_code.rb
72
- lib/gollum-lib/filter/render.rb
73
- lib/gollum-lib/filter/sanitize.rb
74
- lib/gollum-lib/filter/tags.rb
75
- lib/gollum-lib/filter/toc.rb
76
- lib/gollum-lib/filter/wsd.rb
77
- lib/gollum-lib/git_access.rb
78
- lib/gollum-lib/gitcode.rb
79
- lib/gollum-lib/helpers.rb
80
- lib/gollum-lib/hook.rb
81
- lib/gollum-lib/macro.rb
82
- lib/gollum-lib/macro/all_pages.rb
83
- lib/gollum-lib/markup.rb
84
- lib/gollum-lib/markups.rb
85
- lib/gollum-lib/page.rb
86
- lib/gollum-lib/pagination.rb
87
- lib/gollum-lib/sanitization.rb
88
- lib/gollum-lib/wiki.rb
89
- licenses/licenses.txt
90
- ]
91
- # = MANIFEST =
92
-
93
- s.test_files = s.files.select { |path| path =~ /^test\/test_.*\.rb/ }
94
- end
1
+ require File.join(File.dirname(__FILE__), 'gemspec.rb')
2
+ require File.join(File.dirname(__FILE__), 'lib', 'gollum-lib', 'version.rb')
3
+ default_adapter = ['gollum-grit_adapter', '~> 1.0']
4
+ Gem::Specification.new &specification(Gollum::Lib::VERSION, default_adapter)
@@ -0,0 +1,4 @@
1
+ require File.join(File.dirname(__FILE__), 'gemspec.rb')
2
+ require File.join(File.dirname(__FILE__), 'lib', 'gollum-lib', 'version.rb')
3
+ default_adapter = ['gollum-rjgit_adapter', '~> 0.1']
4
+ Gem::Specification.new &specification(Gollum::Lib::VERSION, default_adapter, "java")
data/lib/gollum-lib.rb CHANGED
@@ -4,7 +4,7 @@ require 'digest/md5'
4
4
  require 'digest/sha1'
5
5
  require 'ostruct'
6
6
 
7
- DEFAULT_ADAPTER = 'grit_adapter'
7
+ DEFAULT_ADAPTER = RUBY_PLATFORM == 'java' ? 'rjgit_adapter' : 'grit_adapter'
8
8
 
9
9
  if defined?(Gollum::GIT_ADAPTER)
10
10
  require "#{Gollum::GIT_ADAPTER.downcase}_adapter"
@@ -37,9 +37,6 @@ require File.expand_path('../gollum-lib/filter', __FILE__)
37
37
  $KCODE = 'U' if RUBY_VERSION[0, 3] == '1.8'
38
38
 
39
39
  module Gollum
40
- module Lib
41
- VERSION = '4.0.2'
42
- end
43
40
 
44
41
  def self.assets_path
45
42
  ::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
@@ -53,8 +53,8 @@ module Gollum
53
53
  # Returns a Gollum::Git::Actor.
54
54
  def actor
55
55
  @actor ||= begin
56
- @options[:name] = @wiki.default_committer_name if @options[:name].to_s.empty?
57
- @options[:email] = @wiki.default_committer_email if @options[:email].to_s.empty?
56
+ @options[:name] = @wiki.default_committer_name if @options[:name].nil?
57
+ @options[:email] = @wiki.default_committer_email if @options[:email].nil?
58
58
  Gollum::Git::Actor.new(@options[:name], @options[:email])
59
59
  end
60
60
  end
@@ -10,7 +10,7 @@ module Gollum
10
10
  # page_file_dir - String the directory in which all page files reside
11
11
  #
12
12
  # Returns this instance.
13
- def initialize(path, page_file_dir = nil, bare = false)
13
+ def initialize(path, page_file_dir = nil, bare = nil)
14
14
  @page_file_dir = page_file_dir
15
15
  @path = path
16
16
  @repo = Gollum::Git::Repo.new(path, { :is_bare => bare })
@@ -1,6 +1,11 @@
1
1
  # ~*~ encoding: utf-8 ~*~
2
2
  module Gollum
3
3
  class Markup
4
+
5
+ GitHub::Markup::Markdown::MARKDOWN_GEMS['kramdown'] = proc { |content|
6
+ Kramdown::Document.new(content, :auto_ids => false, :input => "markdown").to_html
7
+ }
8
+
4
9
  register(:markdown, "Markdown", :regexp => /md|mkdn?|mdown|markdown/)
5
10
  register(:textile, "Textile")
6
11
  register(:rdoc, "RDoc")
@@ -0,0 +1,5 @@
1
+ module Gollum
2
+ module Lib
3
+ VERSION = '4.0.3'
4
+ end
5
+ end
@@ -885,8 +885,9 @@ module Gollum
885
885
  #
886
886
  # Returns the String email address.
887
887
  def default_committer_email
888
- @default_committer_email ||= \
889
- @repo.config['user.email'] || self.class.default_committer_email
888
+ email = @repo.config['user.email']
889
+ email = email.delete('<>') if email
890
+ @default_committer_email ||= email || self.class.default_committer_email
890
891
  end
891
892
 
892
893
  # Gets the commit object for the given ref or sha.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gollum-lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-19 00:00:00.000000000 Z
12
+ date: 2015-04-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gollum-grit_adapter
@@ -17,20 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ~>
19
19
  - !ruby/object:Gem::Version
20
- version: '0.1'
21
- - - ! '>='
22
- - !ruby/object:Gem::Version
23
- version: 0.1.1
20
+ version: '1.0'
24
21
  type: :runtime
25
22
  prerelease: false
26
23
  version_requirements: !ruby/object:Gem::Requirement
27
24
  requirements:
28
25
  - - ~>
29
26
  - !ruby/object:Gem::Version
30
- version: '0.1'
31
- - - ! '>='
32
- - !ruby/object:Gem::Version
33
- version: 0.1.1
27
+ version: '1.0'
34
28
  - !ruby/object:Gem::Dependency
35
29
  name: rouge
36
30
  requirement: !ruby/object:Gem::Requirement
@@ -93,14 +87,14 @@ dependencies:
93
87
  requirements:
94
88
  - - ~>
95
89
  - !ruby/object:Gem::Version
96
- version: 1.3.1
90
+ version: 1.3.3
97
91
  type: :runtime
98
92
  prerelease: false
99
93
  version_requirements: !ruby/object:Gem::Requirement
100
94
  requirements:
101
95
  - - ~>
102
96
  - !ruby/object:Gem::Version
103
- version: 1.3.1
97
+ version: 1.3.3
104
98
  - !ruby/object:Gem::Dependency
105
99
  name: org-ruby
106
100
  requirement: !ruby/object:Gem::Requirement
@@ -116,19 +110,19 @@ dependencies:
116
110
  - !ruby/object:Gem::Version
117
111
  version: 0.9.9
118
112
  - !ruby/object:Gem::Dependency
119
- name: github-markdown
113
+ name: kramdown
120
114
  requirement: !ruby/object:Gem::Requirement
121
115
  requirements:
122
116
  - - ~>
123
117
  - !ruby/object:Gem::Version
124
- version: 0.6.7
118
+ version: 1.6.0
125
119
  type: :development
126
120
  prerelease: false
127
121
  version_requirements: !ruby/object:Gem::Requirement
128
122
  requirements:
129
123
  - - ~>
130
124
  - !ruby/object:Gem::Version
131
- version: 0.6.7
125
+ version: 1.6.0
132
126
  - !ruby/object:Gem::Dependency
133
127
  name: RedCloth
134
128
  requirement: !ruby/object:Gem::Requirement
@@ -177,14 +171,14 @@ dependencies:
177
171
  requirements:
178
172
  - - ~>
179
173
  - !ruby/object:Gem::Version
180
- version: 0.8.1
174
+ version: 0.8.3
181
175
  type: :development
182
176
  prerelease: false
183
177
  version_requirements: !ruby/object:Gem::Requirement
184
178
  requirements:
185
179
  - - ~>
186
180
  - !ruby/object:Gem::Version
187
- version: 0.8.1
181
+ version: 0.8.3
188
182
  - !ruby/object:Gem::Dependency
189
183
  name: rake
190
184
  requirement: !ruby/object:Gem::Requirement
@@ -353,7 +347,9 @@ files:
353
347
  - README.md
354
348
  - Rakefile
355
349
  - docs/sanitization.md
350
+ - gemspec.rb
356
351
  - gollum-lib.gemspec
352
+ - gollum-lib_java.gemspec
357
353
  - lib/gollum-lib.rb
358
354
  - lib/gollum-lib/blob_entry.rb
359
355
  - lib/gollum-lib/committer.rb
@@ -381,6 +377,7 @@ files:
381
377
  - lib/gollum-lib/page.rb
382
378
  - lib/gollum-lib/pagination.rb
383
379
  - lib/gollum-lib/sanitization.rb
380
+ - lib/gollum-lib/version.rb
384
381
  - lib/gollum-lib/wiki.rb
385
382
  - licenses/licenses.txt
386
383
  homepage: http://github.com/gollum/gollum-lib