lg_pod_plugin 1.0.7 → 1.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/lg +5 -0
- data/lib/command/cache.rb +22 -18
- data/lib/command/command.rb +27 -35
- data/lib/command/install.rb +52 -0
- data/lib/command/update.rb +39 -0
- data/lib/lg_pod_plugin/downloader.rb +12 -17
- data/lib/lg_pod_plugin/git_util.rb +150 -106
- data/lib/lg_pod_plugin/install.rb +74 -88
- data/lib/lg_pod_plugin/l_cache.rb +11 -77
- data/lib/lg_pod_plugin/l_util.rb +6 -2
- data/lib/lg_pod_plugin/request.rb +90 -82
- data/lib/lg_pod_plugin/version.rb +1 -1
- data/lib/lg_pod_plugin.rb +11 -7
- metadata +57 -118
- data/lib/git/author.rb +0 -14
- data/lib/git/base/factory.rb +0 -101
- data/lib/git/base.rb +0 -670
- data/lib/git/branch.rb +0 -126
- data/lib/git/branches.rb +0 -71
- data/lib/git/config.rb +0 -22
- data/lib/git/diff.rb +0 -155
- data/lib/git/encoding_utils.rb +0 -33
- data/lib/git/escaped_path.rb +0 -77
- data/lib/git/index.rb +0 -5
- data/lib/git/lib.rb +0 -1215
- data/lib/git/log.rb +0 -135
- data/lib/git/object.rb +0 -312
- data/lib/git/path.rb +0 -31
- data/lib/git/remote.rb +0 -36
- data/lib/git/repository.rb +0 -6
- data/lib/git/stash.rb +0 -27
- data/lib/git/stashes.rb +0 -55
- data/lib/git/status.rb +0 -199
- data/lib/git/url.rb +0 -127
- data/lib/git/version.rb +0 -5
- data/lib/git/working_directory.rb +0 -4
- data/lib/git/worktree.rb +0 -38
- data/lib/git/worktrees.rb +0 -47
- data/lib/git.rb +0 -326
- data/lib/rchardet/big5freq.rb +0 -927
- data/lib/rchardet/big5prober.rb +0 -42
- data/lib/rchardet/chardistribution.rb +0 -250
- data/lib/rchardet/charsetgroupprober.rb +0 -110
- data/lib/rchardet/charsetprober.rb +0 -70
- data/lib/rchardet/codingstatemachine.rb +0 -67
- data/lib/rchardet/constants.rb +0 -42
- data/lib/rchardet/escprober.rb +0 -90
- data/lib/rchardet/escsm.rb +0 -245
- data/lib/rchardet/eucjpprober.rb +0 -88
- data/lib/rchardet/euckrfreq.rb +0 -597
- data/lib/rchardet/euckrprober.rb +0 -42
- data/lib/rchardet/euctwfreq.rb +0 -431
- data/lib/rchardet/euctwprober.rb +0 -42
- data/lib/rchardet/gb18030freq.rb +0 -474
- data/lib/rchardet/gb18030prober.rb +0 -42
- data/lib/rchardet/hebrewprober.rb +0 -289
- data/lib/rchardet/jisfreq.rb +0 -571
- data/lib/rchardet/jpcntx.rb +0 -229
- data/lib/rchardet/langbulgarianmodel.rb +0 -229
- data/lib/rchardet/langcyrillicmodel.rb +0 -330
- data/lib/rchardet/langgreekmodel.rb +0 -227
- data/lib/rchardet/langhebrewmodel.rb +0 -202
- data/lib/rchardet/langhungarianmodel.rb +0 -226
- data/lib/rchardet/langthaimodel.rb +0 -201
- data/lib/rchardet/latin1prober.rb +0 -147
- data/lib/rchardet/mbcharsetprober.rb +0 -89
- data/lib/rchardet/mbcsgroupprober.rb +0 -47
- data/lib/rchardet/mbcssm.rb +0 -542
- data/lib/rchardet/sbcharsetprober.rb +0 -122
- data/lib/rchardet/sbcsgroupprober.rb +0 -58
- data/lib/rchardet/sjisprober.rb +0 -88
- data/lib/rchardet/universaldetector.rb +0 -179
- data/lib/rchardet/utf8prober.rb +0 -87
- data/lib/rchardet/version.rb +0 -3
- data/lib/rchardet.rb +0 -67
- data/lib/zip/central_directory.rb +0 -212
- data/lib/zip/compressor.rb +0 -9
- data/lib/zip/constants.rb +0 -115
- data/lib/zip/crypto/decrypted_io.rb +0 -40
- data/lib/zip/crypto/encryption.rb +0 -11
- data/lib/zip/crypto/null_encryption.rb +0 -43
- data/lib/zip/crypto/traditional_encryption.rb +0 -99
- data/lib/zip/decompressor.rb +0 -31
- data/lib/zip/deflater.rb +0 -34
- data/lib/zip/dos_time.rb +0 -53
- data/lib/zip/entry.rb +0 -719
- data/lib/zip/entry_set.rb +0 -88
- data/lib/zip/errors.rb +0 -19
- data/lib/zip/extra_field/generic.rb +0 -44
- data/lib/zip/extra_field/ntfs.rb +0 -94
- data/lib/zip/extra_field/old_unix.rb +0 -46
- data/lib/zip/extra_field/universal_time.rb +0 -77
- data/lib/zip/extra_field/unix.rb +0 -39
- data/lib/zip/extra_field/zip64.rb +0 -70
- data/lib/zip/extra_field/zip64_placeholder.rb +0 -15
- data/lib/zip/extra_field.rb +0 -103
- data/lib/zip/file.rb +0 -468
- data/lib/zip/filesystem.rb +0 -643
- data/lib/zip/inflater.rb +0 -54
- data/lib/zip/input_stream.rb +0 -180
- data/lib/zip/ioextras/abstract_input_stream.rb +0 -122
- data/lib/zip/ioextras/abstract_output_stream.rb +0 -43
- data/lib/zip/ioextras.rb +0 -36
- data/lib/zip/null_compressor.rb +0 -15
- data/lib/zip/null_decompressor.rb +0 -19
- data/lib/zip/null_input_stream.rb +0 -10
- data/lib/zip/output_stream.rb +0 -198
- data/lib/zip/pass_thru_compressor.rb +0 -23
- data/lib/zip/pass_thru_decompressor.rb +0 -31
- data/lib/zip/streamable_directory.rb +0 -15
- data/lib/zip/streamable_stream.rb +0 -52
- data/lib/zip/version.rb +0 -3
- data/lib/zip.rb +0 -72
data/lib/git/status.rb
DELETED
@@ -1,199 +0,0 @@
|
|
1
|
-
module Git
|
2
|
-
#
|
3
|
-
# A class for git status
|
4
|
-
#
|
5
|
-
class Status
|
6
|
-
include Enumerable
|
7
|
-
|
8
|
-
def initialize(base)
|
9
|
-
@base = base
|
10
|
-
construct_status
|
11
|
-
end
|
12
|
-
|
13
|
-
#
|
14
|
-
# Returns an Enumerable containing files that have changed from the
|
15
|
-
# git base directory
|
16
|
-
#
|
17
|
-
# @return [Enumerable]
|
18
|
-
def changed
|
19
|
-
@files.select { |_k, f| f.type == 'M' }
|
20
|
-
end
|
21
|
-
|
22
|
-
#
|
23
|
-
# Determines whether the given file has been changed.
|
24
|
-
# File path starts at git base directory
|
25
|
-
#
|
26
|
-
# @param file [String] The name of the file.
|
27
|
-
# @example Check if lib/git.rb has changed.
|
28
|
-
# changed?('lib/git.rb')
|
29
|
-
# @return [Boolean]
|
30
|
-
def changed?(file)
|
31
|
-
changed.member?(file)
|
32
|
-
end
|
33
|
-
|
34
|
-
#
|
35
|
-
# Returns an Enumerable containing files that have been added.
|
36
|
-
# File path starts at git base directory
|
37
|
-
#
|
38
|
-
# @return [Enumerable]
|
39
|
-
def added
|
40
|
-
@files.select { |_k, f| f.type == 'A' }
|
41
|
-
end
|
42
|
-
|
43
|
-
#
|
44
|
-
# Determines whether the given file has been added to the repository
|
45
|
-
# File path starts at git base directory
|
46
|
-
#
|
47
|
-
# @param file [String] The name of the file.
|
48
|
-
# @example Check if lib/git.rb is added.
|
49
|
-
# added?('lib/git.rb')
|
50
|
-
# @return [Boolean]
|
51
|
-
def added?(file)
|
52
|
-
added.member?(file)
|
53
|
-
end
|
54
|
-
|
55
|
-
#
|
56
|
-
# Returns an Enumerable containing files that have been deleted.
|
57
|
-
# File path starts at git base directory
|
58
|
-
#
|
59
|
-
# @return [Enumerable]
|
60
|
-
def deleted
|
61
|
-
@files.select { |_k, f| f.type == 'D' }
|
62
|
-
end
|
63
|
-
|
64
|
-
#
|
65
|
-
# Determines whether the given file has been deleted from the repository
|
66
|
-
# File path starts at git base directory
|
67
|
-
#
|
68
|
-
# @param file [String] The name of the file.
|
69
|
-
# @example Check if lib/git.rb is deleted.
|
70
|
-
# deleted?('lib/git.rb')
|
71
|
-
# @return [Boolean]
|
72
|
-
def deleted?(file)
|
73
|
-
deleted.member?(file)
|
74
|
-
end
|
75
|
-
|
76
|
-
#
|
77
|
-
# Returns an Enumerable containing files that are not tracked in git.
|
78
|
-
# File path starts at git base directory
|
79
|
-
#
|
80
|
-
# @return [Enumerable]
|
81
|
-
def untracked
|
82
|
-
@files.select { |_k, f| f.untracked }
|
83
|
-
end
|
84
|
-
|
85
|
-
#
|
86
|
-
# Determines whether the given file has is tracked by git.
|
87
|
-
# File path starts at git base directory
|
88
|
-
#
|
89
|
-
# @param file [String] The name of the file.
|
90
|
-
# @example Check if lib/git.rb is an untracked file.
|
91
|
-
# untracked?('lib/git.rb')
|
92
|
-
# @return [Boolean]
|
93
|
-
def untracked?(file)
|
94
|
-
untracked.member?(file)
|
95
|
-
end
|
96
|
-
|
97
|
-
def pretty
|
98
|
-
out = ''
|
99
|
-
each do |file|
|
100
|
-
out << pretty_file(file)
|
101
|
-
end
|
102
|
-
out << "\n"
|
103
|
-
out
|
104
|
-
end
|
105
|
-
|
106
|
-
def pretty_file(file)
|
107
|
-
<<~FILE
|
108
|
-
#{file.path}
|
109
|
-
\tsha(r) #{file.sha_repo} #{file.mode_repo}
|
110
|
-
\tsha(i) #{file.sha_index} #{file.mode_index}
|
111
|
-
\ttype #{file.type}
|
112
|
-
\tstage #{file.stage}
|
113
|
-
\tuntrac #{file.untracked}
|
114
|
-
FILE
|
115
|
-
end
|
116
|
-
|
117
|
-
# enumerable method
|
118
|
-
|
119
|
-
def [](file)
|
120
|
-
@files[file]
|
121
|
-
end
|
122
|
-
|
123
|
-
def each(&block)
|
124
|
-
@files.values.each(&block)
|
125
|
-
end
|
126
|
-
|
127
|
-
# subclass that does heavy lifting
|
128
|
-
class StatusFile
|
129
|
-
attr_accessor :path, :type, :stage, :untracked
|
130
|
-
attr_accessor :mode_index, :mode_repo
|
131
|
-
attr_accessor :sha_index, :sha_repo
|
132
|
-
|
133
|
-
def initialize(base, hash)
|
134
|
-
@base = base
|
135
|
-
@path = hash[:path]
|
136
|
-
@type = hash[:type]
|
137
|
-
@stage = hash[:stage]
|
138
|
-
@mode_index = hash[:mode_index]
|
139
|
-
@mode_repo = hash[:mode_repo]
|
140
|
-
@sha_index = hash[:sha_index]
|
141
|
-
@sha_repo = hash[:sha_repo]
|
142
|
-
@untracked = hash[:untracked]
|
143
|
-
end
|
144
|
-
|
145
|
-
def blob(type = :index)
|
146
|
-
if type == :repo
|
147
|
-
@base.object(@sha_repo)
|
148
|
-
else
|
149
|
-
begin
|
150
|
-
@base.object(@sha_index)
|
151
|
-
rescue
|
152
|
-
@base.object(@sha_repo)
|
153
|
-
end
|
154
|
-
end
|
155
|
-
end
|
156
|
-
end
|
157
|
-
|
158
|
-
private
|
159
|
-
|
160
|
-
def construct_status
|
161
|
-
@files = @base.lib.ls_files
|
162
|
-
|
163
|
-
fetch_untracked
|
164
|
-
fetch_modified
|
165
|
-
fetch_added
|
166
|
-
|
167
|
-
@files.each do |k, file_hash|
|
168
|
-
@files[k] = StatusFile.new(@base, file_hash)
|
169
|
-
end
|
170
|
-
end
|
171
|
-
|
172
|
-
def fetch_untracked
|
173
|
-
ignore = @base.lib.ignored_files
|
174
|
-
|
175
|
-
Dir.chdir(@base.dir.path) do
|
176
|
-
Dir.glob('**/*', File::FNM_DOTMATCH) do |file|
|
177
|
-
next if @files[file] || File.directory?(file) ||
|
178
|
-
ignore.include?(file) || file =~ %r{^.git\/.+}
|
179
|
-
|
180
|
-
@files[file] = { path: file, untracked: true }
|
181
|
-
end
|
182
|
-
end
|
183
|
-
end
|
184
|
-
|
185
|
-
def fetch_modified
|
186
|
-
# find modified in tree
|
187
|
-
@base.lib.diff_files.each do |path, data|
|
188
|
-
@files[path] ? @files[path].merge!(data) : @files[path] = data
|
189
|
-
end
|
190
|
-
end
|
191
|
-
|
192
|
-
def fetch_added
|
193
|
-
# find added but not committed - new files
|
194
|
-
@base.lib.diff_index('HEAD').each do |path, data|
|
195
|
-
@files[path] ? @files[path].merge!(data) : @files[path] = data
|
196
|
-
end
|
197
|
-
end
|
198
|
-
end
|
199
|
-
end
|
data/lib/git/url.rb
DELETED
@@ -1,127 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'addressable/uri'
|
4
|
-
|
5
|
-
module Git
|
6
|
-
# Methods for parsing a Git URL
|
7
|
-
#
|
8
|
-
# Any URL that can be passed to `git clone` can be parsed by this class.
|
9
|
-
#
|
10
|
-
# @see https://git-scm.com/docs/git-clone#_git_urls GIT URLs
|
11
|
-
# @see https://github.com/sporkmonger/addressable Addresable::URI
|
12
|
-
#
|
13
|
-
# @api public
|
14
|
-
#
|
15
|
-
class URL
|
16
|
-
# Regexp used to match a Git URL with an alternative SSH syntax
|
17
|
-
# such as `user@host:path`
|
18
|
-
#
|
19
|
-
GIT_ALTERNATIVE_SSH_SYNTAX = %r{
|
20
|
-
^
|
21
|
-
(?:(?<user>[^@/]+)@)? # user or nil
|
22
|
-
(?<host>[^:/]+) # host is required
|
23
|
-
:(?!/) # : serparator is required, but must not be followed by /
|
24
|
-
(?<path>.*?) # path is required
|
25
|
-
$
|
26
|
-
}x.freeze
|
27
|
-
|
28
|
-
# Parse a Git URL and return an Addressable::URI object
|
29
|
-
#
|
30
|
-
# The URI returned can be converted back to a string with 'to_s'. This is
|
31
|
-
# guaranteed to return the same URL string that was parsed.
|
32
|
-
#
|
33
|
-
# @example
|
34
|
-
# uri = Git::URL.parse('https://github.com/ruby-git/ruby-git.git')
|
35
|
-
# #=> #<Addressable::URI:0x44c URI:https://github.com/ruby-git/ruby-git.git>
|
36
|
-
# uri.scheme #=> "https"
|
37
|
-
# uri.host #=> "github.com"
|
38
|
-
# uri.path #=> "/ruby-git/ruby-git.git"
|
39
|
-
#
|
40
|
-
# Git::URL.parse('/Users/James/projects/ruby-git')
|
41
|
-
# #=> #<Addressable::URI:0x438 URI:/Users/James/projects/ruby-git>
|
42
|
-
#
|
43
|
-
# @param url [String] the Git URL to parse
|
44
|
-
#
|
45
|
-
# @return [Addressable::URI] the parsed URI
|
46
|
-
#
|
47
|
-
def self.parse(url)
|
48
|
-
if !url.start_with?('file:') && (m = GIT_ALTERNATIVE_SSH_SYNTAX.match(url))
|
49
|
-
GitAltURI.new(user: m[:user], host: m[:host], path: m[:path])
|
50
|
-
else
|
51
|
-
Addressable::URI.parse(url)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
# The directory `git clone` would use for the repository directory for the given URL
|
56
|
-
#
|
57
|
-
# @example
|
58
|
-
# Git::URL.clone_to('https://github.com/ruby-git/ruby-git.git') #=> 'ruby-git'
|
59
|
-
#
|
60
|
-
# @param url [String] the Git URL containing the repository directory
|
61
|
-
#
|
62
|
-
# @return [String] the name of the repository directory
|
63
|
-
#
|
64
|
-
def self.clone_to(url, bare: false, mirror: false)
|
65
|
-
uri = parse(url)
|
66
|
-
path_parts = uri.path.split('/')
|
67
|
-
path_parts.pop if path_parts.last == '.git'
|
68
|
-
directory = path_parts.last
|
69
|
-
if bare || mirror
|
70
|
-
directory += '.git' unless directory.end_with?('.git')
|
71
|
-
elsif directory.end_with?('.git')
|
72
|
-
directory = directory[0..-5]
|
73
|
-
end
|
74
|
-
directory
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
# The URI for git's alternative scp-like syntax
|
79
|
-
#
|
80
|
-
# This class is necessary to ensure that #to_s returns the same string
|
81
|
-
# that was passed to the initializer.
|
82
|
-
#
|
83
|
-
# @api public
|
84
|
-
#
|
85
|
-
class GitAltURI < Addressable::URI
|
86
|
-
# Create a new GitAltURI object
|
87
|
-
#
|
88
|
-
# @example
|
89
|
-
# uri = Git::GitAltURI.new(user: 'james', host: 'github.com', path: 'james/ruby-git')
|
90
|
-
# uri.to_s #=> 'james@github.com/james/ruby-git'
|
91
|
-
#
|
92
|
-
# @param user [String, nil] the user from the URL or nil
|
93
|
-
# @param host [String] the host from the URL
|
94
|
-
# @param path [String] the path from the URL
|
95
|
-
#
|
96
|
-
def initialize(user:, host:, path:)
|
97
|
-
super(scheme: 'git-alt', user: user, host: host, path: path)
|
98
|
-
end
|
99
|
-
|
100
|
-
# Convert the URI to a String
|
101
|
-
#
|
102
|
-
# Addressible::URI forces path to be absolute by prepending a '/' to the
|
103
|
-
# path. This method removes the '/' when converting back to a string
|
104
|
-
# since that is what is expected by git. The following is a valid git URL:
|
105
|
-
#
|
106
|
-
# `james@github.com:ruby-git/ruby-git.git`
|
107
|
-
#
|
108
|
-
# and the following (with the initial '/'' in the path) is NOT a valid git URL:
|
109
|
-
#
|
110
|
-
# `james@github.com:/ruby-git/ruby-git.git`
|
111
|
-
#
|
112
|
-
# @example
|
113
|
-
# uri = Git::GitAltURI.new(user: 'james', host: 'github.com', path: 'james/ruby-git')
|
114
|
-
# uri.path #=> '/james/ruby-git'
|
115
|
-
# uri.to_s #=> 'james@github.com:james/ruby-git'
|
116
|
-
#
|
117
|
-
# @return [String] the URI as a String
|
118
|
-
#
|
119
|
-
def to_s
|
120
|
-
if user
|
121
|
-
"#{user}@#{host}:#{path[1..-1]}"
|
122
|
-
else
|
123
|
-
"#{host}:#{path[1..-1]}"
|
124
|
-
end
|
125
|
-
end
|
126
|
-
end
|
127
|
-
end
|
data/lib/git/version.rb
DELETED
data/lib/git/worktree.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'git/path'
|
2
|
-
|
3
|
-
module Git
|
4
|
-
|
5
|
-
class Worktree < Path
|
6
|
-
|
7
|
-
attr_accessor :full, :dir, :gcommit
|
8
|
-
|
9
|
-
def initialize(base, dir, gcommit = nil)
|
10
|
-
@full = dir
|
11
|
-
@full += ' ' + gcommit if !gcommit.nil?
|
12
|
-
@base = base
|
13
|
-
@dir = dir
|
14
|
-
@gcommit = gcommit
|
15
|
-
end
|
16
|
-
|
17
|
-
def gcommit
|
18
|
-
@gcommit ||= @base.gcommit(@full)
|
19
|
-
@gcommit
|
20
|
-
end
|
21
|
-
|
22
|
-
def add
|
23
|
-
@base.lib.worktree_add(@dir, @gcommit)
|
24
|
-
end
|
25
|
-
|
26
|
-
def remove
|
27
|
-
@base.lib.worktree_remove(@dir)
|
28
|
-
end
|
29
|
-
|
30
|
-
def to_a
|
31
|
-
[@full]
|
32
|
-
end
|
33
|
-
|
34
|
-
def to_s
|
35
|
-
@full
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
data/lib/git/worktrees.rb
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
module Git
|
2
|
-
# object that holds all the available worktrees
|
3
|
-
class Worktrees
|
4
|
-
|
5
|
-
include Enumerable
|
6
|
-
|
7
|
-
def initialize(base)
|
8
|
-
@worktrees = {}
|
9
|
-
|
10
|
-
@base = base
|
11
|
-
|
12
|
-
# Array contains [dir, git_hash]
|
13
|
-
@base.lib.worktrees_all.each do |w|
|
14
|
-
@worktrees[w[0]] = Git::Worktree.new(@base, w[0], w[1])
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
# array like methods
|
19
|
-
|
20
|
-
def size
|
21
|
-
@worktrees.size
|
22
|
-
end
|
23
|
-
|
24
|
-
def each(&block)
|
25
|
-
@worktrees.values.each(&block)
|
26
|
-
end
|
27
|
-
|
28
|
-
def [](worktree_name)
|
29
|
-
@worktrees.values.inject(@worktrees) do |worktrees, worktree|
|
30
|
-
worktrees[worktree.full] ||= worktree
|
31
|
-
worktrees
|
32
|
-
end[worktree_name.to_s]
|
33
|
-
end
|
34
|
-
|
35
|
-
def to_s
|
36
|
-
out = ''
|
37
|
-
@worktrees.each do |k, b|
|
38
|
-
out << b.to_s << "\n"
|
39
|
-
end
|
40
|
-
out
|
41
|
-
end
|
42
|
-
|
43
|
-
def prune
|
44
|
-
@base.lib.worktree_prune
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|