mercurial-ruby 0.7.7 → 0.7.8

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -3,10 +3,8 @@ source "http://rubygems.org"
3
3
  gem "open4", "~>1.3.0"
4
4
 
5
5
  group :development do
6
- gem "minitest", ">= 0"
7
- gem "bundler", "~> 1.0.0"
8
- gem "jeweler", "~> 1.6.4"
9
- gem "rcov", ">= 0"
10
- gem "mocha", "~>0.9"
11
- gem "ruby-debug", "~>0.10"
6
+ gem "minitest"
7
+ gem "bundler"
8
+ gem "jeweler"
9
+ gem "mocha"
12
10
  end
@@ -1,34 +1,26 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- columnize (0.3.4)
5
4
  git (1.2.5)
6
- jeweler (1.6.4)
5
+ jeweler (1.8.4)
7
6
  bundler (~> 1.0)
8
7
  git (>= 1.2.5)
9
8
  rake
10
- linecache (0.46)
11
- rbx-require-relative (> 0.0.4)
12
- minitest (2.3.1)
13
- mocha (0.9.12)
9
+ rdoc
10
+ metaclass (0.0.1)
11
+ minitest (4.7.0)
12
+ mocha (0.13.3)
13
+ metaclass (~> 0.0.1)
14
14
  open4 (1.3.0)
15
- rake (0.9.2)
16
- rbx-require-relative (0.0.5)
17
- rcov (0.9.9)
18
- ruby-debug (0.10.4)
19
- columnize (>= 0.1)
20
- ruby-debug-base (~> 0.10.4.0)
21
- ruby-debug-base (0.10.4)
22
- linecache (>= 0.3)
15
+ rake (10.0.4)
16
+ rdoc (4.0.0)
23
17
 
24
18
  PLATFORMS
25
19
  ruby
26
20
 
27
21
  DEPENDENCIES
28
- bundler (~> 1.0.0)
29
- jeweler (~> 1.6.4)
22
+ bundler
23
+ jeweler
30
24
  minitest
31
- mocha (~> 0.9)
25
+ mocha
32
26
  open4 (~> 1.3.0)
33
- rcov
34
- ruby-debug (~> 0.10)
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011 Ilya Sabanin
1
+ Copyright (c) 2013 Ilya Sabanin
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -16,11 +16,11 @@ Github doesn't support some YARd-specific syntax so this README can look broken.
16
16
 
17
17
  == Compatibility
18
18
 
19
- Tested with Mercurial versions 1.9, 1.9.1 and 2.1; Ruby version 1.8.7.
19
+ Tested with Mercurial versions 1.9, 1.9.1, 2.1, 2.5.2; Ruby versions 1.8.7, 1.9.3 and 2.0.0.
20
20
 
21
21
  == Configuration
22
22
 
23
- There are several settings you can configure. Do it like this:
23
+ There are several settings you can configure:
24
24
 
25
25
  Mercurial.configure do |conf|
26
26
  conf.hg_binary_path = "/usr/bin/hg"
@@ -70,7 +70,7 @@ weren't added to the gem as first-class citizens yet.
70
70
 
71
71
  === Built-in Caching
72
72
 
73
- There's a simple caching mechanism built into the gem. If you pass Rails CacheStore compatible
73
+ There's a simple caching mechanism built into the gem. If you pass Rails CacheStore-compatible
74
74
  caching store to the Configuration block, mercurial-ruby will cache output of all hg commands
75
75
  it's executing. Then if you execute same method again and it will run the same command,
76
76
  the gem will return the output from cache.
@@ -92,6 +92,6 @@ You can provide a timeout for pretty much any command you are running. Do it lik
92
92
 
93
93
  == Copyright
94
94
 
95
- Copyright (c) 2012 Ilya Sabanin. See LICENSE.txt for
95
+ Copyright (c) 2013 Ilya Sabanin. See LICENSE.txt for
96
96
  further details.
97
97
 
data/Rakefile CHANGED
@@ -32,22 +32,4 @@ Rake::TestTask.new(:test) do |test|
32
32
  test.verbose = true
33
33
  end
34
34
 
35
- require 'rcov/rcovtask'
36
- Rcov::RcovTask.new do |test|
37
- test.libs << 'test'
38
- test.pattern = 'test/**/test_*.rb'
39
- test.verbose = true
40
- test.rcov_opts << '--exclude "gems/*"'
41
- end
42
-
43
35
  task :default => :test
44
-
45
- require 'rake/rdoctask'
46
- Rake::RDocTask.new do |rdoc|
47
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
48
-
49
- rdoc.rdoc_dir = 'rdoc'
50
- rdoc.title = "mercurial-ruby #{version}"
51
- rdoc.rdoc_files.include('README*')
52
- rdoc.rdoc_files.include('lib/**/*.rb')
53
- end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.7
1
+ 0.7.8
@@ -6,7 +6,7 @@ require 'time'
6
6
  #
7
7
  module Mercurial
8
8
 
9
- VERSION = '0.7.7'
9
+ VERSION = '0.7.8'
10
10
 
11
11
  class Error < RuntimeError; end
12
12
 
@@ -41,7 +41,7 @@ module Mercurial
41
41
  #
42
42
  def lines
43
43
  [].tap do |result|
44
- contents.each do |line|
44
+ contents.each_line do |line|
45
45
  author, revision, linenum, text = line.scan(METADATA_AND_CODE_RE).first
46
46
  result << BlameLine.new(
47
47
  :author => author,
@@ -114,7 +114,7 @@ module Mercurial
114
114
  def to_hash
115
115
  {
116
116
  'id' => hash_id,
117
- 'parents' => parents_ids.map { |p| { 'id' => p.id } },
117
+ 'parents' => parents_ids,
118
118
  'branch' => branch_name,
119
119
  'tags' => tags_names,
120
120
  'message' => message,
@@ -110,7 +110,7 @@ module Mercurial
110
110
  return [] if array.empty?
111
111
 
112
112
  args = array.map{|hash| " -r#{ hash }"}
113
- hg_to_array ["log#{ args } --style ?", style], {:separator => changeset_separator}, cmd_options do |line|
113
+ hg_to_array ["log#{ args.join('') } --style ?", style], {:separator => changeset_separator}, cmd_options do |line|
114
114
  build(line)
115
115
  end
116
116
  end
@@ -64,30 +64,28 @@ module Mercurial
64
64
  #
65
65
  def entries_for(path, revision=nil, parent=nil)
66
66
  revision ||= 'tip'
67
- entries = []
68
- manifest_entries = repository.manifest.scan_for_path(path, revision)
69
- manifest_entries.each do |me|
70
- path_without_source = me[3].gsub(/^#{ Regexp.escape(path.without_trailing_slash) }\//, '')
71
- entry_name = path_without_source.split('/').first
72
- entry_path = File.join(path, entry_name).gsub(/^\//, '')
73
- dir = me[3].scan(/^(#{ Regexp.escape(entry_path) }\/)/).flatten.first ? true : false
74
- entry_name << '/' if dir
75
-
76
- entries << build(
77
- :path => entry_path,
78
- :name => entry_name,
79
- :revision => revision,
80
- :nodeid => (me[0] unless dir),
81
- :fmode => dir ? nil : me[1],
82
- :exec => dir ? nil : me[2],
83
- :parent => parent
84
- )
67
+ [].tap do |entries|
68
+ manifest_entries = repository.manifest.scan_for_path(path, revision)
69
+ manifest_entries.each do |me|
70
+ path_without_source = me[3].gsub(/^#{ Regexp.escape(path.without_trailing_slash) }\//, '')
71
+ entry_name = path_without_source.split('/').first
72
+ entry_path = File.join(path, entry_name).gsub(/^\//, '')
73
+ dir = me[3].scan(/^(#{ Regexp.escape(entry_path) }\/)/).flatten.first ? true : false
74
+ entry_name << '/' if dir
75
+
76
+ if entries.select{|item| item.name == entry_name}.size == 0
77
+ entries << build(
78
+ :path => entry_path,
79
+ :name => entry_name,
80
+ :revision => revision,
81
+ :nodeid => (me[0] unless dir),
82
+ :fmode => dir ? nil : me[1],
83
+ :exec => dir ? nil : me[2],
84
+ :parent => parent
85
+ )
86
+ end
87
+ end
85
88
  end
86
-
87
- entries = entries.inject({}) do |hash,item|
88
- hash[item.name] ||= item
89
- hash
90
- end.values
91
89
  end
92
90
 
93
91
  private
@@ -161,7 +161,7 @@ module Mercurial
161
161
  #
162
162
  def paths
163
163
  {}.tap do |result|
164
- shell.hg('paths').each do |line|
164
+ shell.hg('paths').each_line do |line|
165
165
  path, url = *line.strip.split(" = ")
166
166
  result[path] = url
167
167
  end
@@ -209,6 +209,7 @@ module Mercurial
209
209
  def no_cache
210
210
  @cache_disabled_by_override = true
211
211
  yield
212
+ ensure
212
213
  @cache_disabled_by_override = false
213
214
  end
214
215
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mercurial-ruby}
8
- s.version = "0.7.7"
8
+ s.version = "0.7.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ilya Sabanin"]
12
- s.date = %q{2013-01-22}
12
+ s.date = %q{2013-03-26}
13
13
  s.description = %q{Ruby API for Mercurial DVCS.}
14
14
  s.email = %q{ilya.sabanin@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -84,38 +84,31 @@ Gem::Specification.new do |s|
84
84
  s.homepage = %q{http://github.com/iSabanin/mercurial-ruby}
85
85
  s.licenses = ["MIT"]
86
86
  s.require_paths = ["lib"]
87
- s.rubygems_version = %q{1.3.7}
87
+ s.rubygems_version = %q{1.6.2}
88
88
  s.summary = %q{Ruby API for Mercurial DVCS.}
89
89
 
90
90
  if s.respond_to? :specification_version then
91
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
92
91
  s.specification_version = 3
93
92
 
94
93
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
95
94
  s.add_runtime_dependency(%q<open4>, ["~> 1.3.0"])
96
95
  s.add_development_dependency(%q<minitest>, [">= 0"])
97
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
98
- s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
99
- s.add_development_dependency(%q<rcov>, [">= 0"])
100
- s.add_development_dependency(%q<mocha>, ["~> 0.9"])
101
- s.add_development_dependency(%q<ruby-debug>, ["~> 0.10"])
96
+ s.add_development_dependency(%q<bundler>, [">= 0"])
97
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
98
+ s.add_development_dependency(%q<mocha>, [">= 0"])
102
99
  else
103
100
  s.add_dependency(%q<open4>, ["~> 1.3.0"])
104
101
  s.add_dependency(%q<minitest>, [">= 0"])
105
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
106
- s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
107
- s.add_dependency(%q<rcov>, [">= 0"])
108
- s.add_dependency(%q<mocha>, ["~> 0.9"])
109
- s.add_dependency(%q<ruby-debug>, ["~> 0.10"])
102
+ s.add_dependency(%q<bundler>, [">= 0"])
103
+ s.add_dependency(%q<jeweler>, [">= 0"])
104
+ s.add_dependency(%q<mocha>, [">= 0"])
110
105
  end
111
106
  else
112
107
  s.add_dependency(%q<open4>, ["~> 1.3.0"])
113
108
  s.add_dependency(%q<minitest>, [">= 0"])
114
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
115
- s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
116
- s.add_dependency(%q<rcov>, [">= 0"])
117
- s.add_dependency(%q<mocha>, ["~> 0.9"])
118
- s.add_dependency(%q<ruby-debug>, ["~> 0.10"])
109
+ s.add_dependency(%q<bundler>, [">= 0"])
110
+ s.add_dependency(%q<jeweler>, [">= 0"])
111
+ s.add_dependency(%q<mocha>, [">= 0"])
119
112
  end
120
113
  end
121
114
 
@@ -1,6 +1,5 @@
1
1
  require 'rubygems'
2
2
  require 'bundler'
3
- require 'ruby-debug'
4
3
 
5
4
  begin
6
5
  Bundler.setup(:default, :development)
@@ -14,8 +14,8 @@ describe Mercurial::HookFactory do
14
14
  it "should find all hooks" do
15
15
  hooks = @repository.hooks.all
16
16
  hooks.size.must_equal 2
17
- hooks.map(&:name).must_equal ['commit', 'changegroup']
18
- hooks.map(&:value).must_equal ['/Users/ilya/work/beanstalk/script/mercurial/commit.rb', '/Users/ilya/work/beanstalk/script/mercurial/changegroup.rb']
17
+ hooks.map(&:name).sort.must_equal ['commit', 'changegroup'].sort
18
+ hooks.map(&:value).sort.must_equal ['/Users/ilya/work/beanstalk/script/mercurial/commit.rb', '/Users/ilya/work/beanstalk/script/mercurial/changegroup.rb'].sort
19
19
  hooks.first.must_be_kind_of Mercurial::Hook
20
20
  end
21
21
 
@@ -67,14 +67,14 @@ describe Mercurial::NodeFactory do
67
67
  entries.map(&:name).sort.must_equal %w(another-boring-file something.csv subdirectory/).sort
68
68
  entries.map(&:parent).uniq.must_equal [node]
69
69
 
70
- entries[0].directory?.must_equal true
71
- entries[0].file?.must_equal false
72
-
70
+ entries[0].file?.must_equal true
71
+ entries[0].directory?.must_equal false
72
+
73
73
  entries[1].file?.must_equal true
74
74
  entries[1].directory?.must_equal false
75
75
 
76
- entries[2].file?.must_equal true
77
- entries[2].directory?.must_equal false
76
+ entries[2].directory?.must_equal true
77
+ entries[2].file?.must_equal false
78
78
  end
79
79
 
80
80
  it "should find entries for tip revision" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mercurial-ruby
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
5
- prerelease: false
4
+ hash: 19
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 7
10
- version: 0.7.7
9
+ - 8
10
+ version: 0.7.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ilya Sabanin
@@ -15,14 +15,11 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-01-22 00:00:00 -05:00
18
+ date: 2013-03-26 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- type: :runtime
23
- prerelease: false
24
- name: open4
25
- version_requirements: &id001 !ruby/object:Gem::Requirement
22
+ requirement: &id001 !ruby/object:Gem::Requirement
26
23
  none: false
27
24
  requirements:
28
25
  - - ~>
@@ -33,12 +30,12 @@ dependencies:
33
30
  - 3
34
31
  - 0
35
32
  version: 1.3.0
36
- requirement: *id001
37
- - !ruby/object:Gem::Dependency
38
- type: :development
33
+ type: :runtime
34
+ name: open4
35
+ version_requirements: *id001
39
36
  prerelease: false
40
- name: minitest
41
- version_requirements: &id002 !ruby/object:Gem::Requirement
37
+ - !ruby/object:Gem::Dependency
38
+ requirement: &id002 !ruby/object:Gem::Requirement
42
39
  none: false
43
40
  requirements:
44
41
  - - ">="
@@ -47,44 +44,26 @@ dependencies:
47
44
  segments:
48
45
  - 0
49
46
  version: "0"
50
- requirement: *id002
51
- - !ruby/object:Gem::Dependency
52
47
  type: :development
48
+ name: minitest
49
+ version_requirements: *id002
53
50
  prerelease: false
54
- name: bundler
55
- version_requirements: &id003 !ruby/object:Gem::Requirement
51
+ - !ruby/object:Gem::Dependency
52
+ requirement: &id003 !ruby/object:Gem::Requirement
56
53
  none: false
57
54
  requirements:
58
- - - ~>
55
+ - - ">="
59
56
  - !ruby/object:Gem::Version
60
- hash: 23
57
+ hash: 3
61
58
  segments:
62
- - 1
63
- - 0
64
59
  - 0
65
- version: 1.0.0
66
- requirement: *id003
67
- - !ruby/object:Gem::Dependency
60
+ version: "0"
68
61
  type: :development
62
+ name: bundler
63
+ version_requirements: *id003
69
64
  prerelease: false
70
- name: jeweler
71
- version_requirements: &id004 !ruby/object:Gem::Requirement
72
- none: false
73
- requirements:
74
- - - ~>
75
- - !ruby/object:Gem::Version
76
- hash: 7
77
- segments:
78
- - 1
79
- - 6
80
- - 4
81
- version: 1.6.4
82
- requirement: *id004
83
65
  - !ruby/object:Gem::Dependency
84
- type: :development
85
- prerelease: false
86
- name: rcov
87
- version_requirements: &id005 !ruby/object:Gem::Requirement
66
+ requirement: &id004 !ruby/object:Gem::Requirement
88
67
  none: false
89
68
  requirements:
90
69
  - - ">="
@@ -93,37 +72,24 @@ dependencies:
93
72
  segments:
94
73
  - 0
95
74
  version: "0"
96
- requirement: *id005
97
- - !ruby/object:Gem::Dependency
98
75
  type: :development
76
+ name: jeweler
77
+ version_requirements: *id004
99
78
  prerelease: false
100
- name: mocha
101
- version_requirements: &id006 !ruby/object:Gem::Requirement
79
+ - !ruby/object:Gem::Dependency
80
+ requirement: &id005 !ruby/object:Gem::Requirement
102
81
  none: false
103
82
  requirements:
104
- - - ~>
83
+ - - ">="
105
84
  - !ruby/object:Gem::Version
106
- hash: 25
85
+ hash: 3
107
86
  segments:
108
87
  - 0
109
- - 9
110
- version: "0.9"
111
- requirement: *id006
112
- - !ruby/object:Gem::Dependency
88
+ version: "0"
113
89
  type: :development
90
+ name: mocha
91
+ version_requirements: *id005
114
92
  prerelease: false
115
- name: ruby-debug
116
- version_requirements: &id007 !ruby/object:Gem::Requirement
117
- none: false
118
- requirements:
119
- - - ~>
120
- - !ruby/object:Gem::Version
121
- hash: 31
122
- segments:
123
- - 0
124
- - 10
125
- version: "0.10"
126
- requirement: *id007
127
93
  description: Ruby API for Mercurial DVCS.
128
94
  email: ilya.sabanin@gmail.com
129
95
  executables: []
@@ -227,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
193
  requirements: []
228
194
 
229
195
  rubyforge_project:
230
- rubygems_version: 1.3.7
196
+ rubygems_version: 1.6.2
231
197
  signing_key:
232
198
  specification_version: 3
233
199
  summary: Ruby API for Mercurial DVCS.