Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd3f3a9d

Browse files
committed
chore: add frozen_string_literal: true magic comment
1 parent81932be commitd3f3a9d

File tree

79 files changed

+171
-102
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

+171
-102
lines changed

‎lib/git.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require'active_support'
24
require'active_support/deprecation'
35

‎lib/git/author.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
# frozen_string_literal: true
2+
13
moduleGit
24
classAuthor
35
attr_accessor:name,:email,:date
4-
6+
57
definitialize(author_string)
68
ifm=/(.*?) <(.*?)> (\d+) (.*)/.match(author_string)
79
@name=m[1]
810
@email=m[2]
911
@date=Time.at(m[3].to_i)
1012
end
1113
end
12-
1314
end
1415
end

‎lib/git/base.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require'logger'
24
require'open3'
35

‎lib/git/branch.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require'git/path'
24

35
moduleGit

‎lib/git/branches.rb

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1+
# frozen_string_literal: true
2+
13
moduleGit
2-
4+
35
# object that holds all the available branches
46
classBranches
57

68
includeEnumerable
7-
9+
810
definitialize(base)
911
@branches={}
10-
12+
1113
@base=base
12-
14+
1315
@base.lib.branches_all.eachdo |b|
1416
@branches[b[0]]=Git::Branch.new(@base,b[0])
1517
end
@@ -18,21 +20,21 @@ def initialize(base)
1820
deflocal
1921
self.select{ |b| !b.remote}
2022
end
21-
23+
2224
defremote
2325
self.select{ |b|b.remote}
2426
end
25-
27+
2628
# array like methods
2729

2830
defsize
2931
@branches.size
30-
end
31-
32+
end
33+
3234
defeach(&block)
3335
@branches.values.each(&block)
3436
end
35-
37+
3638
# Returns the target branch
3739
#
3840
# Example:
@@ -50,22 +52,21 @@ def [](branch_name)
5052
@branches.values.inject(@branches)do |branches,branch|
5153
branches[branch.full] ||=branch
5254

53-
# This is how Git (version 1.7.9.5) works.
54-
# Lets you ignore the 'remotes' if its at the beginning of the branch full name (even if is not a real remote branch).
55+
# This is how Git (version 1.7.9.5) works.
56+
# Lets you ignore the 'remotes' if its at the beginning of the branch full name (even if is not a real remote branch).
5557
branches[branch.full.sub('remotes/','')] ||=branchifbranch.full =~/^remotes\/.+/
56-
58+
5759
branches
5860
end[branch_name.to_s]
5961
end
60-
62+
6163
defto_s
6264
out=''
6365
@branches.eachdo |k,b|
6466
out <<(b.current ?'* ' :' ') <<b.to_s <<"\n"
6567
end
6668
out
6769
end
68-
6970
end
7071

7172
end

‎lib/git/config.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
moduleGit
24

35
classConfig

‎lib/git/diff.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
moduleGit
24

35
# object that holds the last X commits on given branch

‎lib/git/index.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
# frozen_string_literal: true
2+
13
moduleGit
24
classIndex <Git::Path
3-
45
end
56
end

‎lib/git/lib.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require'git/command_line'
24
require'git/errors'
35
require'logger'
@@ -570,7 +572,7 @@ def process_commit_log_data(data)
570572
casekey
571573
when'commit'
572574
hsh_array <<hshifhsh
573-
hsh={'sha'=>value,'message'=>'','parent'=>[]}
575+
hsh={'sha'=>value,'message'=>+'','parent'=>[]}
574576
when'parent'
575577
hsh['parent'] <<value
576578
else

‎lib/git/log.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
moduleGit
24

35
# Return the last n commits that match the specified criteria

‎lib/git/object.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require'git/author'
24
require'git/diff'
35
require'git/errors'

‎lib/git/path.rb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
1+
# frozen_string_literal: true
2+
13
moduleGit
2-
4+
35
classPath
4-
6+
57
attr_accessor:path
6-
8+
79
definitialize(path,check_path=true)
810
path=File.expand_path(path)
9-
11+
1012
ifcheck_path && !File.exist?(path)
1113
raiseArgumentError,'path does not exist',[path]
1214
end
13-
15+
1416
@path=path
1517
end
16-
18+
1719
defreadable?
1820
File.readable?(@path)
1921
end
2022

2123
defwritable?
2224
File.writable?(@path)
2325
end
24-
26+
2527
defto_s
2628
@path
2729
end
28-
2930
end
3031

3132
end

‎lib/git/remote.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
moduleGit
24
classRemote <Path
35

‎lib/git/repository.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
moduleGit
24

35
classRepository <Path

‎lib/git/stash.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1+
# frozen_string_literal: true
2+
13
moduleGit
24
classStash
3-
5+
46
definitialize(base,message,existing=false)
57
@base=base
68
@message=message
79
saveunlessexisting
810
end
9-
11+
1012
defsave
1113
@saved=@base.lib.stash_save(@message)
1214
end
13-
15+
1416
defsaved?
1517
@saved
1618
end
17-
19+
1820
defmessage
1921
@message
2022
end
21-
23+
2224
defto_s
2325
message
2426
end
25-
2627
end
2728
end

‎lib/git/stashes.rb

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
# frozen_string_literal: true
2+
13
moduleGit
2-
4+
35
# object that holds all the available stashes
46
classStashes
57
includeEnumerable
6-
8+
79
definitialize(base)
810
@stashes=[]
9-
11+
1012
@base=base
11-
13+
1214
@base.lib.stashes_all.eachdo |id,message|
1315
@stashes.unshift(Git::Stash.new(@base,message,true))
1416
end
@@ -24,16 +26,16 @@ def initialize(base)
2426
defall
2527
@base.lib.stashes_all
2628
end
27-
29+
2830
defsave(message)
2931
s=Git::Stash.new(@base,message)
3032
@stashes.unshift(s)ifs.saved?
3133
end
32-
34+
3335
defapply(index=nil)
3436
@base.lib.stash_apply(index)
3537
end
36-
38+
3739
defclear
3840
@base.lib.stash_clear
3941
@stashes=[]
@@ -42,14 +44,13 @@ def clear
4244
defsize
4345
@stashes.size
4446
end
45-
47+
4648
defeach(&block)
4749
@stashes.each(&block)
4850
end
49-
51+
5052
def [](index)
5153
@stashes[index.to_i]
5254
end
53-
5455
end
5556
end

‎lib/git/status.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
moduleGit
24
# The status class gets the status of a git repository
35
#
@@ -100,7 +102,7 @@ def untracked?(file)
100102
end
101103

102104
defpretty
103-
out=''
105+
out=+''
104106
eachdo |file|
105107
out <<pretty_file(file)
106108
end

‎lib/git/version.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
moduleGit
24
# The current gem version
35
# @return [String] the current gem version.

‎lib/git/working_directory.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
moduleGit
24
classWorkingDirectory <Git::Path
35
end

‎lib/git/worktree.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require'git/path'
24

35
moduleGit

‎lib/git/worktrees.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
moduleGit
24
# object that holds all the available worktrees
35
classWorktrees

‎tests/test_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require'date'
24
require'fileutils'
35
require'minitar'

‎tests/units/test_archive.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env ruby
1+
# frozen_string_literal: true
22

33
require'test_helper'
44

‎tests/units/test_bare.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env ruby
1+
# frozen_string_literal: true
22

33
require'test_helper'
44

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp