Skip to content

Commit b4043f8

Browse files
committed
Rename Scm modules to OhlohScm
1 parent 528b35b commit b4043f8

File tree

79 files changed

+234
-234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+234
-234
lines changed

lib/ohloh_scm/adapters/svn/commits.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def deepen_diff(diff, rev)
9696
if (diff.action == 'D' or diff.action == 'A') && is_directory?(diff.path, recurse_rev)
9797
# Deleting or adding a directory. Expand it out to show every file.
9898
recurse_files(diff.path, recurse_rev).collect do |f|
99-
Scm::Diff.new(:action => diff.action, :path => File.join(diff.path, f))
99+
OhlohScm::Diff.new(:action => diff.action, :path => File.join(diff.path, f))
100100
end
101101
else
102102
# An ordinary file action. Just return the diff.

lib/ohloh_scm/commit.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Scm
1+
module OhlohScm
22
# A commit is a collection of diffs united by a single timestamp, author, and
33
# message.
44
#

lib/ohloh_scm/diff.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
module Scm
1+
module OhlohScm
22
# A +Diff+ represents a change to a single file. It can represent the addition or
33
# deletion of a file, or it can represent a modification of the file contents.
4-
#
4+
#
55
# Ohloh does not track filename changes. If a file is renamed, Ohloh treats this
66
# as the deletion of one file and the creation of another.
7-
#
7+
#
88
# Ohloh does not track directories, only the files within directories.
99
#
1010
# Don't confuse our use of the word "Diff" with a patch file or the output of the
@@ -22,7 +22,7 @@ class Diff
2222
# 'M' modified
2323
# 'D' deleted
2424
attr_accessor :action
25-
25+
2626
# The SHA1 hash of the file contents both before and after the change.
2727
# These must be computed using the same method as Git.
2828
attr_accessor :parent_sha1, :sha1

lib/ohloh_scm/parsers/bzr_parser.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def self.internal_parse(buffer, opts)
3030
e.diffs = remove_dupes(e.diffs)
3131
yield e
3232
end
33-
e = Scm::Commit.new
33+
e = OhlohScm::Commit.new
3434
e.diffs = []
3535
next_state = :data
3636
when /^#{indent}revno:\s+(\d+)$/
@@ -98,10 +98,10 @@ def self.parse_diffs(action, line)
9898
# Note that is possible to be renamed to the empty string!
9999
# This happens when a subdirectory is moved to become the root.
100100
before, after = line.scan(/(.+) => ?(.*)/).first
101-
[ Scm::Diff.new(:action => 'D', :path => before),
102-
Scm::Diff.new(:action => 'A', :path => after || '' )]
101+
[ OhlohScm::Diff.new(:action => 'D', :path => before),
102+
OhlohScm::Diff.new(:action => 'A', :path => after || '' )]
103103
else
104-
[Scm::Diff.new(:action => action, :path => line)]
104+
[OhlohScm::Diff.new(:action => action, :path => line)]
105105
end.each do |d|
106106
d.path = strip_trailing_asterisk(d.path)
107107
end

lib/ohloh_scm/parsers/bzr_xml_parser.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def initialize(callback)
1818
def tag_start(name, attrs)
1919
case name
2020
when 'log'
21-
@commit = Scm::Commit.new
21+
@commit = OhlohScm::Commit.new
2222
@commit.diffs = []
2323
when 'affected-files'
2424
@diffs = []
@@ -87,18 +87,18 @@ def parse_diff(action, path, before_path)
8787
case action
8888
# A rename action requires two diffs: one to remove the old filename,
8989
# another to add the new filename.
90-
#
90+
#
9191
# Note that is possible to be renamed to the empty string!
9292
# This happens when a subdirectory is moved to become the root.
9393
when 'renamed'
94-
diffs = [ Scm::Diff.new(:action => 'D', :path => before_path),
95-
Scm::Diff.new(:action => 'A', :path => path || '')]
94+
diffs = [ OhlohScm::Diff.new(:action => 'D', :path => before_path),
95+
OhlohScm::Diff.new(:action => 'A', :path => path || '')]
9696
when 'added'
97-
diffs = [Scm::Diff.new(:action => 'A', :path => path)]
97+
diffs = [OhlohScm::Diff.new(:action => 'A', :path => path)]
9898
when 'modified'
99-
diffs = [Scm::Diff.new(:action => 'M', :path => path)]
99+
diffs = [OhlohScm::Diff.new(:action => 'M', :path => path)]
100100
when 'removed'
101-
diffs = [Scm::Diff.new(:action => 'D', :path => path)]
101+
diffs = [OhlohScm::Diff.new(:action => 'D', :path => path)]
102102
end
103103
diffs.each do |d|
104104
d.path = strip_trailing_asterisk(d.path)
@@ -108,11 +108,11 @@ def parse_diff(action, path, before_path)
108108

109109
def strip_trailing_asterisk(path)
110110
path[-1..-1] == '*' ? path[0..-2] : path
111-
end
111+
end
112112

113113
def remove_dupes(diffs)
114114
BzrXmlParser.remove_dupes(diffs)
115-
end
115+
end
116116

117117
end
118118

@@ -133,14 +133,14 @@ def self.scm
133133
def self.remove_dupes(diffs)
134134
# Bazaar may report that a file was added and modified in a single commit.
135135
# Reduce these cases to a single 'A' action.
136-
diffs.delete_if do |d|
136+
diffs.delete_if do |d|
137137
d.action == 'M' && diffs.select { |x| x.path == d.path && x.action == 'A' }.any?
138-
end
138+
end
139139

140140
# Bazaar may report that a file was both deleted and added in a single commit.
141141
# Reduce these cases to a single 'M' action.
142-
diffs.each do |d|
143-
d.action = 'M' if diffs.select { |x| x.path == d.path }.size > 1
142+
diffs.each do |d|
143+
d.action = 'M' if diffs.select { |x| x.path == d.path }.size > 1
144144
end.uniq
145145
end
146146

lib/ohloh_scm/parsers/cvs_parser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def self.read_commit(io, filename, commit_number, should_yield)
139139
should_yield = false if commit_number == '1.1' and state == 'dead'
140140
message = read_message(io)
141141
if should_yield
142-
commit = Scm::Commit.new
142+
commit = OhlohScm::Commit.new
143143
commit.token = committer_date[0..18]
144144
commit.committer_date = Time.parse(committer_date[0..18] + ' +0000').utc
145145
commit.committer_name = committer_name

lib/ohloh_scm/parsers/git_parser.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def self.internal_parse(io, opts)
2727
when /^commit ([a-z0-9]{40,40})$/
2828
sha1 = $1
2929
yield e if e
30-
e = Scm::Commit.new
30+
e = OhlohScm::Commit.new
3131
e.diffs = []
3232
e.token = sha1
3333
e.author_name = ANONYMOUS
@@ -53,7 +53,7 @@ def self.internal_parse(io, opts)
5353

5454
elsif state == :diffs
5555
if line =~ /^([ADM])\t(.+)$/
56-
e.diffs << Scm::Diff.new( :action => $1, :path => $2)
56+
e.diffs << OhlohScm::Diff.new( :action => $1, :path => $2)
5757
end
5858

5959
else

lib/ohloh_scm/parsers/git_styled_parser.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def self.internal_parse(io, opts)
3535
if line =~ /^Commit: ([a-z0-9]+)$/
3636
sha1 = $1
3737
yield e if e
38-
e = Scm::Commit.new
38+
e = OhlohScm::Commit.new
3939
e.diffs = []
4040
e.token = sha1
4141
e.author_name = ANONYMOUS
@@ -70,7 +70,7 @@ def self.internal_parse(io, opts)
7070
elsif line =~ /:([0-9]+) ([0-9]+) ([a-z0-9]+) ([a-z0-9]+) ([A-Z])\t"?(.+[^"])"?$/
7171
# Submodules have a file mode of '160000', which indicates a "gitlink"
7272
# We ignore submodules completely.
73-
e.diffs << Scm::Diff.new( :action => $5, :path => $6, :sha1 => $4, :parent_sha1 => $3 ) unless $1=='160000' || $2=='160000'
73+
e.diffs << OhlohScm::Diff.new( :action => $5, :path => $6, :sha1 => $4, :parent_sha1 => $3 ) unless $1=='160000' || $2=='160000'
7474
end
7575

7676
else

lib/ohloh_scm/parsers/hg_parser.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def self.internal_parse(buffer, opts)
1717
case l
1818
when /^changeset:\s+\d+:([0-9a-f]+)/
1919
yield e if e && block_given?
20-
e = Scm::Commit.new
20+
e = OhlohScm::Commit.new
2121
e.diffs = []
2222
e.token = $1
2323
when /^user:\s+(.+?)(\s+<(.+)>)?$/
@@ -27,7 +27,7 @@ def self.internal_parse(buffer, opts)
2727
e.committer_date = Time.parse($1).utc
2828
when /^files:\s+(.+)/
2929
($1 || '').split(' ').each do |file|
30-
e.diffs << Scm::Diff.new(:action => '?', :path => file)
30+
e.diffs << OhlohScm::Diff.new(:action => '?', :path => file)
3131
end
3232
when /^summary:\s+(.+)/
3333
e.message = $1

lib/ohloh_scm/parsers/hg_styled_parser.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def self.internal_parse(buffer, opts)
2525
if state == :data
2626
case l
2727
when /^changeset:\s+([0-9a-f]+)/
28-
e = Scm::Commit.new
28+
e = OhlohScm::Commit.new
2929
e.diffs = []
3030
e.token = $1
3131
when /^user:\s+(.+?)(\s+<(.+)>)?$/
@@ -46,7 +46,7 @@ def self.internal_parse(buffer, opts)
4646
if l == "__END_FILES__\n"
4747
next_state = :data
4848
elsif l =~ /^([MAD]) (.+)$/
49-
e.diffs << Scm::Diff.new(:action => $1, :path => $2)
49+
e.diffs << OhlohScm::Diff.new(:action => $1, :path => $2)
5050
end
5151

5252
elsif state == :long_comment

0 commit comments

Comments
 (0)