line_containing 0.1.1 → 0.1.2

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: 37bc73226cd2f003c4047ef19c03799162375917
4
- data.tar.gz: 9306e7d8cdc3bc2318dfe74c4526ae6a790c6fa9
2
+ SHA256:
3
+ metadata.gz: b4f37817c7fe7f57766f4e0135e36f8cbb13ebf4a339bd8556d6781f0c0fc0e4
4
+ data.tar.gz: 553b8762a4b59bc9070ca2fda5d1af0affabb675707a9cf8c1a5899572617799
5
5
  SHA512:
6
- metadata.gz: 0e79493eb76682c11c56aaf3bd8c56a2f99269f394e19881af5bf423e95745db0706775f3bb0ce0bf4f3033f349da525fa7969f79515ac86b4b6b8b4df6d5c95
7
- data.tar.gz: c852e018ead196ff2a5cc6ab6ad6f55791b649da9931edc6c6c75fe327475f00a476e603de70f834a2a40549d7c2a85d13e4a0576f85a0116a36531994eb367b
6
+ metadata.gz: 22363de8c135f09459d8eca5a43861e65e607e42b65191702f4cba379a3402bea2dce1b0c99b097adb974a88641f5b09226776f445522b4f55b36910d327602b
7
+ data.tar.gz: 904fad60e88c2f6a7c670312aaa3e7fd6c28042bd77ef5f2710c7cec29d1f85f8577b3d0cb912a7e846afa59fbf154473f4346ed1627ae04f17670c38626d0a1
@@ -4,6 +4,9 @@ AllCops:
4
4
  - tmp/vulnerabilities/spec/*
5
5
  - tmp/vulnerabilities/Rakefile
6
6
 
7
+ Layout/EmptyComment:
8
+ Enabled: false
9
+
7
10
  Metrics/LineLength:
8
11
  Exclude:
9
12
  - line_containing.gemspec
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # LineContaining
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/line_containing.svg)](https://badge.fury.io/rb/line_containing)
4
- [![Build Status](https://travis-ci.org/jhsu802701/line_containing.svg?branch=version_0_0_1)](https://travis-ci.org/jhsu802701/line_containing)
5
- [![Dependency Status](https://gemnasium.com/badges/github.com/jhsu802701/line_containing.svg)](https://gemnasium.com/github.com/jhsu802701/line_containing)
6
- [![Code Climate](https://codeclimate.com/github/jhsu802701/line_containing/badges/gpa.svg)](https://codeclimate.com/github/jhsu802701/line_containing)
7
- [![Test Coverage](https://codeclimate.com/github/jhsu802701/line_containing/badges/coverage.svg)](https://codeclimate.com/github/jhsu802701/line_containing/coverage)
4
+ [![Build Status](https://semaphoreci.com/api/v1/jhsu802701/line_containing/branches/master/badge.svg)](https://semaphoreci.com/jhsu802701/line_containing)
5
+ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/876cf0d94d3541c18e903b0ed4ce574c)](https://www.codacy.com/app/jhsu802701/line_containing?utm_source=jhsu802701@bitbucket.org&utm_medium=referral&utm_content=jhsu802701/line_containing&utm_campaign=Badge_Grade)
6
+ [![codebeat badge](https://codebeat.co/badges/2f5046f6-57ed-448f-8d01-c9942c26c399)](https://codebeat.co/projects/bitbucket-org-jhsu802701-line_containing-master)
7
+ [![codecov](https://codecov.io/bb/jhsu802701/line_containing/branch/master/graph/badge.svg)](https://codecov.io/bb/jhsu802701/line_containing)
8
8
 
9
9
  ## What This Gem Does
10
10
 
data/all.sh ADDED
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+
3
+ sh gem_test.sh
4
+ sh gem_install.sh
5
+ sh code_test.sh
@@ -1,7 +1,5 @@
1
1
  #!/bin/bash
2
2
 
3
- DIR_PARENT="${PWD%/*}"
4
- DIR_TMP="$DIR_PARENT/tmp"
5
3
  mkdir -p log
6
4
  rm -rf tmp
7
5
 
@@ -24,12 +22,12 @@ echo '------------------------'
24
22
  echo 'bundle exec bundle-audit'
25
23
  bundle exec bundle-audit
26
24
 
27
- echo '----------------------------------------------------------'
28
- echo 'bundle exec gemsurance --output log/gemsurance_report.html'
29
- bundle exec gemsurance --output log/gemsurance_report.html
30
- echo 'Gemsurance Report: log/gemsurance_report.html'
31
-
32
25
  echo '------------------------------------------------------------------------'
33
26
  echo 'bundle viz --file=log/diagram-gems --format=svg --requirements --version'
34
27
  bundle viz --file=log/diagram-gems --format=svg --requirements --version
35
28
  echo 'Gem dependency diagram: log/diagram-gems.svg'
29
+
30
+ echo '----------------------------------------------------------'
31
+ echo 'bundle exec gemsurance --output log/gemsurance_report.html'
32
+ bundle exec gemsurance --output log/gemsurance_report.html
33
+ echo 'Gemsurance Report: log/gemsurance_report.html'
@@ -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
@@ -5,7 +5,7 @@ module LineContaining
5
5
  def self.add_before(str_orig, str_add, path)
6
6
  path_old = path
7
7
  path_new = "#{path_old}.new"
8
- file_w = open(path_new, 'w')
8
+ file_w = File.open(path_new, 'w')
9
9
  File.readlines(path_old).each do |line|
10
10
  file_w.write("#{str_add}\n") if line.include? str_orig
11
11
  file_w.write(line)
@@ -18,7 +18,7 @@ module LineContaining
18
18
  def self.add_after(str_orig, str_add, path)
19
19
  path_old = path
20
20
  path_new = "#{path_old}.new"
21
- file_w = open(path_new, 'w')
21
+ file_w = File.open(path_new, 'w')
22
22
  File.readlines(path_old).each do |line|
23
23
  file_w.write(line)
24
24
  if line.include? str_orig
@@ -34,7 +34,7 @@ module LineContaining
34
34
  def self.replace(str_orig, str_new, path)
35
35
  path_old = path
36
36
  path_new = "#{path_old}.new"
37
- file_w = open(path_new, 'w')
37
+ file_w = File.open(path_new, 'w')
38
38
  File.readlines(path_old).each do |line|
39
39
  if line.include? str_orig
40
40
  file_w.write("#{str_new}\n")
@@ -50,7 +50,7 @@ module LineContaining
50
50
  def self.delete(str_orig, path)
51
51
  path_old = path
52
52
  path_new = "#{path_old}.new"
53
- file_w = open(path_new, 'w')
53
+ file_w = File.open(path_new, 'w')
54
54
  File.readlines(path_old).each do |line|
55
55
  if line.include? str_orig
56
56
  # Print NOTHING
@@ -66,7 +66,7 @@ module LineContaining
66
66
  def self.delete_between(str1, str2, path)
67
67
  path_old = path
68
68
  path_new = "#{path_old}.new"
69
- file_w = open(path_new, 'w')
69
+ file_w = File.open(path_new, 'w')
70
70
  to_delete = false
71
71
  File.readlines(path_old).each do |line|
72
72
  if line.include? str1
@@ -1,3 +1,3 @@
1
1
  module LineContaining
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
@@ -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 'line_containing/version'
6
4
 
@@ -12,7 +10,7 @@ Gem::Specification.new do |spec|
12
10
 
13
11
  spec.summary = 'Remove or replace a line from a file based on its content. Look for a line with certain content, and add another line before or after it.'
14
12
  spec.description = 'Remove or replace a line from a file based on its content. Look for a line with certain content, and add another line before or after it.'
15
- spec.homepage = 'https://github.com/jhsu802701/line_containing'
13
+ spec.homepage = 'https://bitbucket.org/jhsu802701/line_containing'
16
14
  spec.license = 'MIT'
17
15
 
18
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -20,14 +18,14 @@ Gem::Specification.new do |spec|
20
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
19
  spec.require_paths = ['lib']
22
20
 
23
- spec.add_development_dependency 'bundler', '~> 1.8'
24
- spec.add_development_dependency 'rake', '~> 10.0'
25
- spec.add_development_dependency 'rspec'
26
- spec.add_development_dependency 'simplecov'
27
- spec.add_development_dependency 'ruby-graphviz'
28
- spec.add_development_dependency 'gemsurance'
29
- spec.add_development_dependency 'bundler-audit'
30
- spec.add_development_dependency 'sandi_meter'
31
- spec.add_development_dependency 'rubocop'
32
- spec.add_development_dependency 'codeclimate-test-reporter'
21
+ spec.add_development_dependency 'bundler', '1.16.3'
22
+ spec.add_development_dependency 'bundler-audit', '0.6.0'
23
+ spec.add_development_dependency 'codecov', '0.1.10'
24
+ spec.add_development_dependency 'gemsurance', '0.9.0'
25
+ spec.add_development_dependency 'rake', '12.3.1'
26
+ spec.add_development_dependency 'rspec', '3.8.0'
27
+ spec.add_development_dependency 'rubocop', '0.58.2'
28
+ spec.add_development_dependency 'ruby-graphviz', '1.2.3'
29
+ spec.add_development_dependency 'sandi_meter', '1.2.0'
30
+ spec.add_development_dependency 'simplecov', '0.16.1'
33
31
  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,155 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: line_containing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
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-04-24 00:00:00.000000000 Z
11
+ date: 2018-08-19 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.8'
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.8'
26
+ version: 1.16.3
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: bundler-audit
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 0.6.0
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: 0.6.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: codecov
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 0.1.10
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: '0'
54
+ version: 0.1.10
55
55
  - !ruby/object:Gem::Dependency
56
- name: simplecov
56
+ name: gemsurance
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 0.9.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: 0.9.0
69
69
  - !ruby/object:Gem::Dependency
70
- name: ruby-graphviz
70
+ name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 12.3.1
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: 12.3.1
83
83
  - !ruby/object:Gem::Dependency
84
- name: gemsurance
84
+ name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: 3.8.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: 3.8.0
97
97
  - !ruby/object:Gem::Dependency
98
- name: bundler-audit
98
+ name: rubocop
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: 0.58.2
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: 0.58.2
111
111
  - !ruby/object:Gem::Dependency
112
- name: sandi_meter
112
+ name: ruby-graphviz
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: '0'
117
+ version: 1.2.3
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: '0'
124
+ version: 1.2.3
125
125
  - !ruby/object:Gem::Dependency
126
- name: rubocop
126
+ name: sandi_meter
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - '='
130
130
  - !ruby/object:Gem::Version
131
- version: '0'
131
+ version: 1.2.0
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - '='
137
137
  - !ruby/object:Gem::Version
138
- version: '0'
138
+ version: 1.2.0
139
139
  - !ruby/object:Gem::Dependency
140
- name: codeclimate-test-reporter
140
+ name: simplecov
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ">="
143
+ - - '='
144
144
  - !ruby/object:Gem::Version
145
- version: '0'
145
+ version: 0.16.1
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ">="
150
+ - - '='
151
151
  - !ruby/object:Gem::Version
152
- version: '0'
152
+ version: 0.16.1
153
153
  description: Remove or replace a line from a file based on its content. Look for
154
154
  a line with certain content, and add another line before or after it.
155
155
  email:
@@ -167,6 +167,7 @@ files:
167
167
  - LICENSE.txt
168
168
  - README.md
169
169
  - Rakefile
170
+ - all.sh
170
171
  - bin/console
171
172
  - bin/setup
172
173
  - code_test.sh
@@ -174,10 +175,12 @@ files:
174
175
  - gem_console.sh
175
176
  - gem_install.sh
176
177
  - gem_test.sh
178
+ - git_check.sh
177
179
  - lib/line_containing.rb
178
180
  - lib/line_containing/version.rb
179
181
  - line_containing.gemspec
180
- homepage: https://github.com/jhsu802701/line_containing
182
+ - upgrade_gems.sh
183
+ homepage: https://bitbucket.org/jhsu802701/line_containing
181
184
  licenses:
182
185
  - MIT
183
186
  metadata: {}
@@ -197,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
200
  version: '0'
198
201
  requirements: []
199
202
  rubyforge_project:
200
- rubygems_version: 2.6.11
203
+ rubygems_version: 2.7.7
201
204
  signing_key:
202
205
  specification_version: 4
203
206
  summary: Remove or replace a line from a file based on its content. Look for a line