insert_from_file 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4162ccc4f31905bc2174adad0abcd9a3e4883020
4
- data.tar.gz: 46be56f2287346a623d51847a7b098d4f9268dde
2
+ SHA256:
3
+ metadata.gz: 757bc088888af33f08b0e91769b80a4bbc71e3bfa3bee93ae90afdaa4ec9fd66
4
+ data.tar.gz: bdc8b3121363725767234ec3184346adcd2b0a4caddac74f53810c8aee67bfa4
5
5
  SHA512:
6
- metadata.gz: aa90f5bdcc29c383f05d1c6b7ca79386556a60689353b5b530ba6f3eaa2b88151d6b0678f7e651651df12e6122a7cfa754f99b803075529cddab4d06e02020c5
7
- data.tar.gz: 1959edc0d6ae282c526d783b5579cf15404defc58b118b6ae35a5b645b04e91ee84a5926c0e40802b28c642601c406d3c0e91f5658610e7519896b169b69ecee
6
+ metadata.gz: 59459a351b472890d291d7e5dd006fe1aed6fe264ceceab00c3b84a5c5dd2c6797ad294d1b4bcf4c6ae578ef6312e374ef0d0053e9111a1a43ed733d94f62004
7
+ data.tar.gz: 2490d0a48cd9a5dfb2a818e7628a47a53f497f5a9f30ec0ec4290f7a8d98e3942343cf2fa2721c7cd44b568789c256a59ebbdeb42d794f42e416dc6973a6accd
@@ -1,3 +1,6 @@
1
+ Layout/EmptyComment:
2
+ Enabled: false
3
+
1
4
  Metrics/AbcSize:
2
5
  Exclude:
3
6
  - lib/insert_from_file.rb
data/README.md CHANGED
@@ -1,11 +1,9 @@
1
1
  # InsertFromFile
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/insert_from_file.svg)](https://badge.fury.io/rb/insert_from_file)
4
- [![Build Status](https://travis-ci.org/jhsu802701/insert_from_file.svg?branch=master)](https://travis-ci.org/jhsu802701/insert_from_file)
5
- [![security](https://hakiri.io/github/jhsu802701/insert_from_file/master.svg)](https://hakiri.io/github/jhsu802701/insert_from_file/master)
6
- [![Dependency Status](https://gemnasium.com/badges/github.com/jhsu802701/insert_from_file.svg)](https://gemnasium.com/github.com/jhsu802701/insert_from_file)
7
- [![Code Climate](https://codeclimate.com/github/jhsu802701/insert_from_file/badges/gpa.svg)](https://codeclimate.com/github/jhsu802701/insert_from_file)
8
- [![Test Coverage](https://codeclimate.com/github/jhsu802701/insert_from_file/badges/coverage.svg)](https://codeclimate.com/github/jhsu802701/insert_from_file/coverage)
4
+ [![Build Status](https://semaphoreci.com/api/v1/jhsu802701/insert_from_file/branches/master/badge.svg)](https://semaphoreci.com/jhsu802701/insert_from_file)
5
+ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/ad95b790c84c46bca9a19456a838377a)](https://www.codacy.com/app/jhsu802701/insert_from_file?utm_source=jhsu802701@bitbucket.org&utm_medium=referral&utm_content=jhsu802701/insert_from_file&utm_campaign=Badge_Grade)
6
+ [![codecov](https://codecov.io/bb/jhsu802701/insert_from_file/branch/master/graph/badge.svg)](https://codecov.io/bb/jhsu802701/insert_from_file)
9
7
 
10
8
  ## What This Gem Does
11
9
 
data/all.sh CHANGED
@@ -1,17 +1,5 @@
1
1
  #!/bin/bash
2
2
 
3
- mkdir -p log
4
- FILE_TEST_GEM='log/1-test-gem.log'
5
- FILE_TEST_CODE='log/2-test-code.log'
6
- FILE_INSTALL_GEM='log/3-install-gem.log'
7
- sh gem_test.sh 2>&1 | tee $FILE_TEST_GEM
8
- sh code_test.sh 2>&1 | tee $FILE_TEST_CODE
9
- sh gem_install.sh 2>&1 | tee $FILE_INSTALL_GEM
10
-
11
- echo 'Results are logged in:'
12
- echo $FILE_TEST_GEM
13
- echo $FILE_TEST_CODE
14
- echo $FILE_INSTALL_GEM
15
- echo
16
- echo 'Gemsurance Report: log/gemsurance_report.html'
17
- echo 'Gem dependency diagram: log/diagram-gems.svg'
3
+ sh gem_test.sh
4
+ sh gem_install.sh
5
+ sh code_test.sh
@@ -14,22 +14,22 @@ echo '----------------------'
14
14
  echo 'bundle exec rubocop -D'
15
15
  bundle exec rubocop -D
16
16
 
17
- echo
18
- echo '-----------------------'
19
- echo 'bundle exec sandi_meter'
20
- bundle exec sandi_meter
17
+ # Update the local ruby-advisory-db advisory database
18
+ echo '-------------------------------'
19
+ echo 'bundle exec bundle-audit update'
20
+ bundle exec bundle-audit update
21
21
 
22
- echo
22
+ # Audit the gems listed in Gemfile.lock for vulnerabilities
23
23
  echo '------------------------'
24
24
  echo 'bundle exec bundle-audit'
25
25
  bundle exec bundle-audit
26
26
 
27
+ echo '------------------------------------------------------------------------'
28
+ echo 'bundle viz --file=log/diagram-gems --format=svg --requirements --version'
29
+ bundle viz --file=log/diagram-gems --format=jpg --requirements --version
30
+ echo 'Gem dependency diagram: log/diagram-gems.jpg'
31
+
27
32
  echo '----------------------------------------------------------'
28
33
  echo 'bundle exec gemsurance --output log/gemsurance_report.html'
29
34
  bundle exec gemsurance --output log/gemsurance_report.html
30
35
  echo 'Gemsurance Report: log/gemsurance_report.html'
31
-
32
- echo '------------------------------------------------------------------------'
33
- echo 'bundle viz --file=log/diagram-gems --format=svg --requirements --version'
34
- bundle viz --file=log/diagram-gems --format=svg --requirements --version
35
- echo 'Gem dependency diagram: log/diagram-gems.svg'
@@ -0,0 +1,13 @@
1
+ #!/bin/bash
2
+
3
+ # Run this script before entering "git add" and "git commit".
4
+
5
+ sh gem_test.sh
6
+
7
+ echo '----------------------'
8
+ echo 'bundle exec rubocop -D'
9
+ bundle exec rubocop -D
10
+
11
+ echo '----------'
12
+ echo 'git status'
13
+ git status
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
4
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
3
  require 'insert_from_file/version'
6
4
 
@@ -12,7 +10,7 @@ Gem::Specification.new do |spec|
12
10
 
13
11
  spec.summary = 'Insert the contents of one file into another file.'
14
12
  spec.description = 'Insert the contents of the source file into the destination file. Look for a line with certain content in the destination file, and add the contents of the source file before or after this point. You can also look for two lines with certain content in the destination file and replace everything in between with the contents of the source file.'
15
- spec.homepage = 'https://github.com/jhsu802701/insert_from_file'
13
+ spec.homepage = 'https://bitbucket.org/jhsu802701/insert_from_file'
16
14
  spec.license = 'MIT'
17
15
 
18
16
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -22,16 +20,18 @@ Gem::Specification.new do |spec|
22
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
21
  spec.require_paths = ['lib']
24
22
 
25
- spec.add_development_dependency 'bundler', '~> 1.14'
26
- spec.add_development_dependency 'rake', '~> 10.0'
27
- spec.add_development_dependency 'rspec', '~> 3.0'
28
- spec.add_development_dependency 'simplecov'
29
- spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0.0'
30
- spec.add_development_dependency 'ruby-graphviz'
31
- spec.add_development_dependency 'gemsurance'
32
- spec.add_development_dependency 'bundler-audit'
33
- spec.add_development_dependency 'sandi_meter'
34
- spec.add_development_dependency 'rubocop'
23
+ spec.add_development_dependency 'bundler', '1.16.3'
24
+ spec.add_development_dependency 'rake', '12.3.1'
25
+ spec.add_development_dependency 'rspec', '3.8.0'
26
+
27
+ spec.add_development_dependency 'bundler-audit', '0.6.0'
28
+ spec.add_development_dependency 'gemsurance', '0.9.0'
29
+ spec.add_development_dependency 'rubocop', '0.58.2'
30
+ spec.add_development_dependency 'ruby-graphviz', '1.2.3'
31
+ spec.add_development_dependency 'simplecov', '0.16.1'
32
+
33
+ spec.add_development_dependency 'codecov', '0.1.10'
34
+
35
35
  spec.add_runtime_dependency 'line_containing'
36
36
  spec.add_runtime_dependency 'string_in_file'
37
37
  end
@@ -8,7 +8,7 @@ module InsertFromFile
8
8
  def self.add_before(file_source, file_dest, str_dest)
9
9
  path_old = file_dest
10
10
  path_new = "#{path_old}.new"
11
- file_w = open(path_new, 'w')
11
+ file_w = File.open(path_new, 'w')
12
12
  File.readlines(path_old).each do |line|
13
13
  if line.include? str_dest
14
14
  File.readlines(file_source).each do |line_s|
@@ -25,7 +25,7 @@ module InsertFromFile
25
25
  def self.add_after(file_source, file_dest, str_dest)
26
26
  path_old = file_dest
27
27
  path_new = "#{path_old}.new"
28
- file_w = open(path_new, 'w')
28
+ file_w = File.open(path_new, 'w')
29
29
  File.readlines(path_old).each do |line|
30
30
  file_w.write(line)
31
31
  # rubocop:disable Style/Next
@@ -44,7 +44,7 @@ module InsertFromFile
44
44
  def self.replace(file_source, file_dest, str_dest)
45
45
  path_old = file_dest
46
46
  path_new = "#{path_old}.new"
47
- file_w = open(path_new, 'w')
47
+ file_w = File.open(path_new, 'w')
48
48
  File.readlines(path_old).each do |line|
49
49
  if line.include? str_dest
50
50
  File.readlines(file_source).each do |line_s|
@@ -63,7 +63,7 @@ module InsertFromFile
63
63
  LineContaining.delete_between(str1, str2, file_dest)
64
64
  path_old = file_dest
65
65
  path_new = "#{path_old}.new"
66
- file_w = open(path_new, 'w')
66
+ file_w = File.open(path_new, 'w')
67
67
  is_before = true
68
68
  is_after = false
69
69
  File.readlines(path_old).each do |line|
@@ -89,7 +89,7 @@ module InsertFromFile
89
89
  def self.add_beginning(file_source, file_dest)
90
90
  path_old = file_dest
91
91
  path_new = "#{path_old}.new"
92
- file_w = open(path_new, 'w')
92
+ file_w = File.open(path_new, 'w')
93
93
  File.readlines(file_source).each do |line|
94
94
  file_w.write(line)
95
95
  end
@@ -104,7 +104,7 @@ module InsertFromFile
104
104
  def self.add_end(file_source, file_dest)
105
105
  path_old = file_dest
106
106
  path_new = "#{path_old}.new"
107
- file_w = open(path_new, 'w')
107
+ file_w = File.open(path_new, 'w')
108
108
  File.readlines(path_old).each do |line|
109
109
  file_w.write(line)
110
110
  end
@@ -1,4 +1,4 @@
1
1
  #
2
2
  module InsertFromFile
3
- VERSION = '0.0.4'.freeze
3
+ VERSION = '0.0.5'.freeze
4
4
  end
@@ -0,0 +1,17 @@
1
+ #!/bin/bash
2
+
3
+ # Use this script for upgrading gems.
4
+
5
+ # If the version of a gem is pinned in the Gemfile, you must update
6
+ # the version number specified in that file.
7
+
8
+ echo '-------------'
9
+ echo 'bundle update'
10
+ bundle update
11
+
12
+ sh git_check.sh
13
+
14
+ echo '----------------------------------------------------------'
15
+ echo 'bundle exec gemsurance --output log/gemsurance_report.html'
16
+ bundle exec gemsurance --output log/gemsurance_report.html
17
+ echo 'The Gemsurance Report is at log/gemsurance_report.html .'
metadata CHANGED
@@ -1,155 +1,141 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: insert_from_file
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Hsu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-26 00:00:00.000000000 Z
11
+ date: 2018-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: '1.14'
19
+ version: 1.16.3
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: '1.14'
26
+ version: 1.16.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 12.3.1
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: 12.3.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: 3.8.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
54
+ version: 3.8.0
55
55
  - !ruby/object:Gem::Dependency
56
- name: simplecov
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: codeclimate-test-reporter
56
+ name: bundler-audit
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
- - - "~>"
59
+ - - '='
74
60
  - !ruby/object:Gem::Version
75
- version: 1.0.0
61
+ version: 0.6.0
76
62
  type: :development
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
- - - "~>"
66
+ - - '='
81
67
  - !ruby/object:Gem::Version
82
- version: 1.0.0
68
+ version: 0.6.0
83
69
  - !ruby/object:Gem::Dependency
84
- name: ruby-graphviz
70
+ name: gemsurance
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
- - - ">="
73
+ - - '='
88
74
  - !ruby/object:Gem::Version
89
- version: '0'
75
+ version: 0.9.0
90
76
  type: :development
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
- - - ">="
80
+ - - '='
95
81
  - !ruby/object:Gem::Version
96
- version: '0'
82
+ version: 0.9.0
97
83
  - !ruby/object:Gem::Dependency
98
- name: gemsurance
84
+ name: rubocop
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
- - - ">="
87
+ - - '='
102
88
  - !ruby/object:Gem::Version
103
- version: '0'
89
+ version: 0.58.2
104
90
  type: :development
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
- - - ">="
94
+ - - '='
109
95
  - !ruby/object:Gem::Version
110
- version: '0'
96
+ version: 0.58.2
111
97
  - !ruby/object:Gem::Dependency
112
- name: bundler-audit
98
+ name: ruby-graphviz
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
- - - ">="
101
+ - - '='
116
102
  - !ruby/object:Gem::Version
117
- version: '0'
103
+ version: 1.2.3
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
- - - ">="
108
+ - - '='
123
109
  - !ruby/object:Gem::Version
124
- version: '0'
110
+ version: 1.2.3
125
111
  - !ruby/object:Gem::Dependency
126
- name: sandi_meter
112
+ name: simplecov
127
113
  requirement: !ruby/object:Gem::Requirement
128
114
  requirements:
129
- - - ">="
115
+ - - '='
130
116
  - !ruby/object:Gem::Version
131
- version: '0'
117
+ version: 0.16.1
132
118
  type: :development
133
119
  prerelease: false
134
120
  version_requirements: !ruby/object:Gem::Requirement
135
121
  requirements:
136
- - - ">="
122
+ - - '='
137
123
  - !ruby/object:Gem::Version
138
- version: '0'
124
+ version: 0.16.1
139
125
  - !ruby/object:Gem::Dependency
140
- name: rubocop
126
+ name: codecov
141
127
  requirement: !ruby/object:Gem::Requirement
142
128
  requirements:
143
- - - ">="
129
+ - - '='
144
130
  - !ruby/object:Gem::Version
145
- version: '0'
131
+ version: 0.1.10
146
132
  type: :development
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
- - - ">="
136
+ - - '='
151
137
  - !ruby/object:Gem::Version
152
- version: '0'
138
+ version: 0.1.10
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: line_containing
155
141
  requirement: !ruby/object:Gem::Requirement
@@ -207,10 +193,12 @@ files:
207
193
  - gem_console.sh
208
194
  - gem_install.sh
209
195
  - gem_test.sh
196
+ - git_check.sh
210
197
  - insert_from_file.gemspec
211
198
  - lib/insert_from_file.rb
212
199
  - lib/insert_from_file/version.rb
213
- homepage: https://github.com/jhsu802701/insert_from_file
200
+ - upgrade_gems.sh
201
+ homepage: https://bitbucket.org/jhsu802701/insert_from_file
214
202
  licenses:
215
203
  - MIT
216
204
  metadata: {}
@@ -230,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
218
  version: '0'
231
219
  requirements: []
232
220
  rubyforge_project:
233
- rubygems_version: 2.6.12
221
+ rubygems_version: 2.7.7
234
222
  signing_key:
235
223
  specification_version: 4
236
224
  summary: Insert the contents of one file into another file.