git-gsub 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/git-gsub.gemspec +7 -4
- data/lib/git/gsub/version.rb +1 -1
- data/spec/git_gsub_spec.rb +73 -61
- metadata +17 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdbaa36daf4b1b651664f8e2c6249c926b7da18813a523e5acef6ba9110298ea
|
4
|
+
data.tar.gz: ab255f1a554458c5f4725714015630b154fc9483a278fc246ffce967b4175837
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3808ba02a0ed1ad307f657e566fb1bb2b2bb94653097f091280af21dae04bd795a1da01062285cd66ea1435272bb8d2aa091c838db2a14f74fc46d8c0ddc1d67
|
7
|
+
data.tar.gz: 32254b23f90248771eb31fca3c440c532fd2fce80668baba104e06ad0a4c85fb53e49fb52a04fb57d77bb0d2443fb86e58ff1d42eed13af5d7e00700fe2cc803
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## [0.0.11]
|
5
|
+
### Changed
|
6
|
+
- Support newer and safer activesupport ([#13](https://github.com/fujimura/git-gsub/pull/13))
|
7
|
+
- Add deprecation message on installation ([#13](https://github.com/fujimura/git-gsub/pull/13))
|
8
|
+
|
4
9
|
## [0.0.10]
|
5
10
|
### Changed
|
6
11
|
- Support activesupport >= 4 & < 6 ([#12](https://github.com/fujimura/git-gsub/pull/12)) Thanks @hanachin!
|
data/git-gsub.gemspec
CHANGED
@@ -3,23 +3,26 @@ lib = File.expand_path('../lib', __FILE__)
|
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
4
|
require 'git/gsub/version'
|
5
5
|
|
6
|
+
GIT_GSUB_RUBY_IS_DEPRECATED = %q{git-gsub: Newer version is written in Go and Ruby implementation is deprecated. See https://github.com/fujimura/git-gsub}
|
7
|
+
|
6
8
|
Gem::Specification.new do |spec|
|
7
9
|
spec.name = "git-gsub"
|
8
10
|
spec.version = Git::Gsub::VERSION
|
9
11
|
spec.authors = ["Fujimura Daisuke"]
|
10
12
|
spec.email = ["me@fujimuradaisuke.com"]
|
11
|
-
spec.summary =
|
12
|
-
spec.description =
|
13
|
+
spec.summary = GIT_GSUB_RUBY_IS_DEPRECATED
|
14
|
+
spec.description = GIT_GSUB_RUBY_IS_DEPRECATED
|
13
15
|
spec.homepage = "https://github.com/fujimura/git-gsub"
|
14
16
|
spec.license = "MIT"
|
17
|
+
spec.post_install_message = GIT_GSUB_RUBY_IS_DEPRECATED
|
15
18
|
|
16
19
|
spec.files = `git ls-files -z`.split("\x0")
|
17
20
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
21
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.add_dependency "activesupport", ">=
|
22
|
+
spec.add_dependency "activesupport", ">= 6.0.3.1"
|
20
23
|
spec.require_paths = ["lib"]
|
21
24
|
|
22
|
-
spec.add_development_dependency "bundler"
|
25
|
+
spec.add_development_dependency "bundler"
|
23
26
|
spec.add_development_dependency "rake"
|
24
27
|
spec.add_development_dependency "rspec"
|
25
28
|
spec.add_development_dependency "pry"
|
data/lib/git/gsub/version.rb
CHANGED
data/spec/git_gsub_spec.rb
CHANGED
@@ -29,97 +29,109 @@ describe 'git-gsub' do
|
|
29
29
|
`git commit -m 'Add #{name}'`
|
30
30
|
end
|
31
31
|
|
32
|
+
let!(:git_gsub_path) {
|
33
|
+
if ENV['USE_RUBY']
|
34
|
+
File.expand_path("../../bin/git-gsub-ruby", __FILE__)
|
35
|
+
else
|
36
|
+
File.expand_path("../../bin/git-gsub", __FILE__)
|
37
|
+
end
|
38
|
+
}
|
39
|
+
|
32
40
|
around do |example|
|
33
41
|
run_in_tmp_repo do
|
34
42
|
example.run
|
35
43
|
end
|
36
44
|
end
|
37
45
|
|
38
|
-
|
39
|
-
|
40
|
-
|
46
|
+
describe 'Substituting' do
|
47
|
+
it 'should substitute files' do
|
48
|
+
commit_file 'README.md', 'Git Subversion Bzr'
|
49
|
+
`#{git_gsub_path} Bzr Mercurial`
|
41
50
|
|
42
|
-
|
43
|
-
|
51
|
+
expect(File.read('README.md')).to eq 'Git Subversion Mercurial'
|
52
|
+
end
|
44
53
|
|
45
|
-
|
46
|
-
|
47
|
-
|
54
|
+
it 'should substitute files with case conversion' do
|
55
|
+
commit_file 'README.md', 'GitGsub git_gsub git-gsub'
|
56
|
+
`#{git_gsub_path} GitGsub SvnGsub --camel --kebab --snake`
|
48
57
|
|
49
|
-
|
50
|
-
|
58
|
+
expect(File.read('README.md')).to eq 'SvnGsub svn_gsub svn-gsub'
|
59
|
+
end
|
51
60
|
|
52
|
-
|
53
|
-
|
54
|
-
|
61
|
+
it 'should escape well' do
|
62
|
+
commit_file 'README.md', %(<h1 class="foo">)
|
63
|
+
`#{git_gsub_path} '<h1 class="foo">' '<h1 class="bar">'`
|
55
64
|
|
56
|
-
|
57
|
-
|
65
|
+
expect(File.read('README.md')).to eq %(<h1 class="bar">)
|
66
|
+
end
|
58
67
|
|
59
|
-
|
60
|
-
|
61
|
-
|
68
|
+
it 'should substutute @' do
|
69
|
+
commit_file 'README.md', %(foo@example.com)
|
70
|
+
`#{git_gsub_path} @example bar@example`
|
62
71
|
|
63
|
-
|
64
|
-
|
72
|
+
expect(File.read('README.md')).to eq %(foobar@example.com)
|
73
|
+
end
|
65
74
|
|
66
|
-
|
67
|
-
|
68
|
-
|
75
|
+
it 'should substitute consequenting @' do
|
76
|
+
commit_file 'README.md', %(Hello this is @git)
|
77
|
+
`#{git_gsub_path} @git @@svn`
|
69
78
|
|
70
|
-
|
71
|
-
|
79
|
+
expect(File.read('README.md')).to eq %(Hello this is @@svn)
|
80
|
+
end
|
72
81
|
|
73
|
-
|
74
|
-
|
75
|
-
|
82
|
+
it %(should substitute " to ') do
|
83
|
+
commit_file 'README.md', %(Hello this is "git")
|
84
|
+
`#{git_gsub_path} '"git"' "'svn'"`
|
76
85
|
|
77
|
-
|
78
|
-
|
86
|
+
expect(File.read('README.md')).to eq %(Hello this is 'svn')
|
87
|
+
end
|
79
88
|
|
80
|
-
|
81
|
-
|
82
|
-
|
89
|
+
it %(should substitute ' to ") do
|
90
|
+
commit_file 'README.md', %(Hello this is 'git')
|
91
|
+
`#{git_gsub_path} "'git'" '"svn"'`
|
83
92
|
|
84
|
-
|
85
|
-
|
93
|
+
expect(File.read('README.md')).to eq %(Hello this is "svn")
|
94
|
+
end
|
86
95
|
|
87
|
-
|
88
|
-
|
89
|
-
|
96
|
+
it 'should substitute text including { and }'do
|
97
|
+
commit_file 'README.md', %({git{svn})
|
98
|
+
`#{git_gsub_path} {git{svn} {hg{svn}}`
|
90
99
|
|
91
|
-
|
92
|
-
|
100
|
+
expect(File.read('README.md')).to eq %({hg{svn}})
|
101
|
+
end
|
93
102
|
|
94
|
-
|
95
|
-
|
96
|
-
|
103
|
+
it 'should not create backup file' do
|
104
|
+
commit_file 'README.md', 'Git Subversion Bzr'
|
105
|
+
`#{git_gsub_path} Bzr Darcs`
|
97
106
|
|
98
|
-
|
107
|
+
expect(`ls`).to eql "README.md\n"
|
108
|
+
end
|
99
109
|
end
|
100
110
|
|
101
|
-
|
102
|
-
|
103
|
-
|
111
|
+
describe 'Renaming' do
|
112
|
+
it 'should rename with --rename' do
|
113
|
+
commit_file 'README-git_gsub.md', 'GitGsub git_gsub git-gsub'
|
114
|
+
`#{git_gsub_path} GitGsub SvnGsub --snake --rename`
|
104
115
|
|
105
|
-
|
106
|
-
|
107
|
-
|
116
|
+
expect(`ls`).to eql "README-svn_gsub.md\n"
|
117
|
+
expect(File.read('README-svn_gsub.md')).to eq 'SvnGsub svn_gsub git-gsub'
|
118
|
+
end
|
108
119
|
|
109
|
-
|
110
|
-
|
111
|
-
|
120
|
+
it 'should rename with --rename' do
|
121
|
+
commit_file 'lib/git.rb', 'puts "Git"'
|
122
|
+
`#{git_gsub_path} git svn --camel --rename`
|
112
123
|
|
113
|
-
|
114
|
-
|
115
|
-
|
124
|
+
expect(`ls lib`).to eql "svn.rb\n"
|
125
|
+
expect(File.read('lib/svn.rb')).to eq 'puts "Svn"'
|
126
|
+
end
|
116
127
|
|
117
|
-
|
118
|
-
|
128
|
+
it 'should do nothing if no file found' do
|
129
|
+
commit_file 'README-git_gsub.md', 'GitGsub git_gsub git-gsub'
|
119
130
|
|
120
|
-
|
121
|
-
|
122
|
-
|
131
|
+
expect {
|
132
|
+
`#{git_gsub_path} Atlanta Chicago --snake --rename`
|
133
|
+
}.not_to raise_error
|
134
|
+
end
|
123
135
|
end
|
124
136
|
|
125
137
|
it 'should output command with dry-run' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-gsub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fujimura Daisuke
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,34 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '6'
|
19
|
+
version: 6.0.3.1
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '6'
|
26
|
+
version: 6.0.3.1
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: bundler
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
|
-
- - "
|
31
|
+
- - ">="
|
38
32
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
33
|
+
version: '0'
|
40
34
|
type: :development
|
41
35
|
prerelease: false
|
42
36
|
version_requirements: !ruby/object:Gem::Requirement
|
43
37
|
requirements:
|
44
|
-
- - "
|
38
|
+
- - ">="
|
45
39
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
40
|
+
version: '0'
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
42
|
name: rake
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,7 +80,8 @@ dependencies:
|
|
86
80
|
- - ">="
|
87
81
|
- !ruby/object:Gem::Version
|
88
82
|
version: '0'
|
89
|
-
description:
|
83
|
+
description: 'git-gsub: Newer version is written in Go and Ruby implementation is
|
84
|
+
deprecated. See https://github.com/fujimura/git-gsub'
|
90
85
|
email:
|
91
86
|
- me@fujimuradaisuke.com
|
92
87
|
executables:
|
@@ -110,7 +105,8 @@ homepage: https://github.com/fujimura/git-gsub
|
|
110
105
|
licenses:
|
111
106
|
- MIT
|
112
107
|
metadata: {}
|
113
|
-
post_install_message:
|
108
|
+
post_install_message: 'git-gsub: Newer version is written in Go and Ruby implementation
|
109
|
+
is deprecated. See https://github.com/fujimura/git-gsub'
|
114
110
|
rdoc_options: []
|
115
111
|
require_paths:
|
116
112
|
- lib
|
@@ -125,10 +121,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
121
|
- !ruby/object:Gem::Version
|
126
122
|
version: '0'
|
127
123
|
requirements: []
|
128
|
-
|
129
|
-
|
130
|
-
signing_key:
|
124
|
+
rubygems_version: 3.0.3
|
125
|
+
signing_key:
|
131
126
|
specification_version: 4
|
132
|
-
summary:
|
127
|
+
summary: 'git-gsub: Newer version is written in Go and Ruby implementation is deprecated.
|
128
|
+
See https://github.com/fujimura/git-gsub'
|
133
129
|
test_files:
|
134
130
|
- spec/git_gsub_spec.rb
|