gollum-rjgit_adapter 0.3-java → 0.3.1-java

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: 2c80a16a8cb97691a2e46f3cafcc97af770d4686
4
- data.tar.gz: f0c49e526ddf49198ddc9fc93dc0364a3e4035ff
3
+ metadata.gz: f3a21acbd10b51b8aad6230fc39d3a513d4a6f85
4
+ data.tar.gz: c1646122b695f65950a3ea752ea556ad8c7ae15b
5
5
  SHA512:
6
- metadata.gz: 4a3c80b9970631ea65e1f53bac1c609079a389d88f03655b6a9ec123368e9b5a90f64597a1a8c043eda15f993c2b238a570b004027fa9163f3dca06b96fbda45
7
- data.tar.gz: 2bdb2bf5d6085dd3c6f0407b1b082eec1b4b8f72a9df4da20426b2afd0c4dcc53d505e43eb79f3cde18bf44a123e48bd845a219e12e6fd543d9d852ed4417ad2
6
+ metadata.gz: d17ef9d3f0c8dcf0fbc44b1ac7e39d08091e893470254faecd849e22aa039800d6a306257db48a108ce093f9b0003f74801c073c889373e18ac75c6b1a5349dc
7
+ data.tar.gz: 0d431216ba4c27bb68a6155979efedd548c14983b1df727d586110ccf1a111c056d39c1474ae3aec83ddcd7cbf32b3b1d205a8a96799f29af351daf12b338fa6
data/LICENSE ADDED
File without changes
data/Rakefile ADDED
@@ -0,0 +1,127 @@
1
+ require 'rubygems'
2
+
3
+ task :default => :rspec
4
+
5
+ require 'rspec/core/rake_task'
6
+
7
+ def name
8
+ "rjgit_adapter"
9
+ end
10
+
11
+ def version
12
+ line = File.read("lib/rjgit_adapter/version.rb")[/^\s*VERSION\s*=\s*.*/]
13
+ line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
14
+ end
15
+
16
+ # assumes x.y.z all digit version
17
+ def next_version
18
+ # x.y.z
19
+ v = version.split '.'
20
+ # bump z
21
+ v[-1] = v[-1].to_i + 1
22
+ v.join '.'
23
+ end
24
+
25
+ def bump_version
26
+ old_file = File.read("lib/rjgit_adapter/version.rb")
27
+ old_version_line = old_file[/^\s*VERSION\s*=\s*.*/]
28
+ new_version = next_version
29
+ # replace first match of old version with new version
30
+ old_file.sub!(old_version_line, " VERSION = '#{new_version}'")
31
+
32
+ File.write("lib/rjgit_adapter/version.rb", old_file)
33
+
34
+ new_version
35
+ end
36
+
37
+ def date
38
+ Date.today.to_s
39
+ end
40
+
41
+ def gemspec
42
+ "gollum-rjgit_adapter.gemspec"
43
+ end
44
+
45
+ def gem_file
46
+ "gollum-#{name}-#{version}-java.gem"
47
+ end
48
+
49
+ def replace_header(head, header_name)
50
+ head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"}
51
+ end
52
+
53
+ desc "Run specs."
54
+ RSpec::Core::RakeTask.new(:rspec) do |spec|
55
+ ruby_opts = "-w"
56
+ spec.pattern = 'spec/**/*_spec.rb'
57
+ spec.rspec_opts = ['--backtrace --color']
58
+ end
59
+
60
+ desc "Update version number and gemspec"
61
+ task :bump do
62
+ puts "Updated version to #{bump_version}"
63
+ # Execute does not invoke dependencies.
64
+ # Manually invoke gemspec then validate.
65
+ Rake::Task[:gemspec].execute
66
+ Rake::Task[:validate].execute
67
+ end
68
+
69
+ desc 'Create a release build'
70
+ task :release => :build do
71
+ unless `git branch` =~ /^\* master$/
72
+ puts "You must be on the master branch to release!"
73
+ exit!
74
+ end
75
+ sh "git commit --allow-empty -a -m 'Release #{version}'"
76
+ sh "git pull --rebase origin master"
77
+ sh "git tag v#{version}"
78
+ sh "git push origin master"
79
+ sh "git push origin v#{version}"
80
+ sh "gem push pkg/#{name}-#{version}.gem"
81
+ sh "gem push pkg/#{name}-#{version}-java.gem"
82
+ end
83
+
84
+ desc 'Publish to rubygems. Same as release'
85
+ task :publish => :release
86
+
87
+ desc 'Build gem'
88
+ task :build => :gemspec do
89
+ sh "mkdir -p pkg"
90
+ sh "gem build #{gemspec}"
91
+ sh "mv #{gem_file} pkg"
92
+ end
93
+
94
+ desc 'Update gemspec'
95
+ task :gemspec => :validate do
96
+ # read spec file and split out manifest section
97
+ spec = File.read(gemspec)
98
+ head, manifest, tail = spec.split(" # = MANIFEST =\n")
99
+
100
+ # replace name version and date
101
+ replace_header(head, :name)
102
+ replace_header(head, :date)
103
+
104
+ # determine file list from git ls-files
105
+ files = `git ls-files`.
106
+ split("\n").
107
+ sort.
108
+ reject { |file| file =~ /^\./ }.
109
+ reject { |file| file =~ /^(rdoc|pkg|spec|\.gitattributes|Guardfile)/ }.
110
+ map { |file| " #{file}" }.
111
+ join("\n")
112
+
113
+ # piece file back together and write
114
+ manifest = " s.files = %w(\n#{files}\n )\n"
115
+ spec = [head, manifest, tail].join(" # = MANIFEST =\n")
116
+ File.open(gemspec, 'w') { |io| io.write(spec) }
117
+ puts "Updated #{gemspec}"
118
+ end
119
+
120
+ desc 'Validate lib files and version file'
121
+ task :validate do
122
+ libfiles = Dir['lib/*'] - ["lib/#{name}.rb", "lib/#{name}"]
123
+ unless libfiles.empty?
124
+ puts "Directory `lib` should only contain a `#{name}.rb` file and `#{name}` dir."
125
+ exit!
126
+ end
127
+ end
@@ -0,0 +1,33 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "rjgit_adapter/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "gollum-rjgit_adapter"
7
+ s.version = Gollum::Lib::Git::VERSION
8
+ s.platform = "java"
9
+ s.authors = ["Bart Kamphorst, Dawa Ometto"]
10
+ s.email = ["repotag-dev@googlegroups.com"]
11
+ s.homepage = "https://github.com/repotag/gollum-lib_rjgit_adapter"
12
+ s.summary = %q{Adapter for Gollum to use RJGit at the backend.}
13
+ s.description = %q{Adapter for Gollum to use RJGit at the backend.}
14
+
15
+ s.add_runtime_dependency "rjgit", "~> 0.3"
16
+ s.add_development_dependency "rspec", "2.13.0"
17
+
18
+ s.files = Dir['lib/**/*.rb'] + ["README.md", "Gemfile"]
19
+ s.require_paths = ["lib"]
20
+
21
+ # = MANIFEST =
22
+ s.files = %w(
23
+ Gemfile
24
+ LICENSE
25
+ README.md
26
+ Rakefile
27
+ gollum-rjgit_adapter.gemspec
28
+ lib/rjgit_adapter.rb
29
+ lib/rjgit_adapter/git_layer_rjgit.rb
30
+ lib/rjgit_adapter/version.rb
31
+ )
32
+ # = MANIFEST =
33
+ end
@@ -186,7 +186,7 @@ module Gollum
186
186
 
187
187
  def ls_files(query, options = {})
188
188
  ref = Gollum::Git.canonicalize(options[:ref])
189
- result = RJGit::Porcelain.ls_tree(@git.jrepo, nil, {:ref => ref, :recursive => true, :file_path => options[:path]}).select {|object| object[:type] == "blob" && object[:path].split("/").last.scan(/#{query}/i) }
189
+ result = RJGit::Porcelain.ls_tree(@git.jrepo, nil, {:ref => ref, :recursive => true, :file_path => options[:path]}).select {|object| object[:type] == "blob" && !!(::File.basename(object[:path]) =~ /#{query}/i) }
190
190
  result.map do |r|
191
191
  r[:path]
192
192
  end
@@ -1,7 +1,7 @@
1
1
  module Gollum
2
2
  module Lib
3
3
  module Git
4
- VERSION = '0.3'
4
+ VERSION = '0.3.1'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gollum-rjgit_adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: 0.3.1
5
5
  platform: java
6
6
  authors:
7
7
  - Bart Kamphorst, Dawa Ometto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-24 00:00:00.000000000 Z
11
+ date: 2015-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rjgit
@@ -46,7 +46,10 @@ extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
48
  - Gemfile
49
+ - LICENSE
49
50
  - README.md
51
+ - Rakefile
52
+ - gollum-rjgit_adapter.gemspec
50
53
  - lib/rjgit_adapter.rb
51
54
  - lib/rjgit_adapter/git_layer_rjgit.rb
52
55
  - lib/rjgit_adapter/version.rb