string_in_file 1.0.0 → 1.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 97b5839e8b5461de4c4fe16da3078a5058c09885
4
- data.tar.gz: 95b71c9e268b268961d3d224ba3702a1751d838f
2
+ SHA256:
3
+ metadata.gz: 20ebf87050c3302e76f96a305ec968be5ef53590cf651d5d4594144be1393cd8
4
+ data.tar.gz: bc279573aa594cedce6190cc04e70d0336b20d791742d0f0357efc38f20843a4
5
5
  SHA512:
6
- metadata.gz: 3892a47c5011860c2fc004673767fa3e84451e8027b06a2da35e11ea9a8ef64c2147fe67453d2378e3f8535571b3bf7c11e809b79cef8dfa7dc2ff26bbd73054
7
- data.tar.gz: a74c562fa6aaad0818581de14b9273915611f877b3e0900aa6fe6c6ed5507bffe4166885ce357125163cf120faf5231da4bfdbae6e0a174dc4c7b5fcde089ea8
6
+ metadata.gz: 4493a3a9cf5825eb023f14cb1e8fb82030157e89fbf4b0f99fee8ed6f3249810ee0edfedea6e163990b81c6c936b6152811428f010c058f6e2dea32016624919
7
+ data.tar.gz: c8d0cb1d389be25f1c657efad11a0a05fb582ef3d0acfca8f1284ae97394cef4bebcb18c05cd654f01f1bd0ba9bfa6244d0b249394302ec46414356bb9c75dd5
data/.gitignore CHANGED
@@ -4,7 +4,6 @@
4
4
 
5
5
  /.bundle/
6
6
  /.yardoc
7
- /Gemfile.lock
8
7
  /_yardoc/
9
8
  /coverage/
10
9
  /doc/
data/.rubocop.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  Metrics/LineLength:
2
2
  Exclude:
3
3
  - string_in_file.gemspec
4
+ - spec/spec_helper.rb
4
5
  - spec/string_in_file_spec.rb
5
6
 
6
7
  Metrics/BlockLength:
@@ -25,3 +26,9 @@ Lint/UselessAssignment:
25
26
  Style/RedundantBegin:
26
27
  Exclude:
27
28
  - lib/string_in_file.rb
29
+
30
+ Layout/EmptyComment:
31
+ Enabled: false
32
+
33
+ Style/RescueStandardError:
34
+ Enabled: false
data/Gemfile.lock ADDED
@@ -0,0 +1,81 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ string_in_file (1.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.0)
10
+ bundler-audit (0.6.0)
11
+ bundler (~> 1.2)
12
+ thor (~> 0.18)
13
+ codecov (0.1.10)
14
+ json
15
+ simplecov
16
+ url
17
+ diff-lcs (1.3)
18
+ docile (1.3.1)
19
+ gems (0.8.3)
20
+ gemsurance (0.9.0)
21
+ bundler (~> 1.2)
22
+ gems (~> 0.8)
23
+ git (~> 1.2)
24
+ git (1.5.0)
25
+ jaro_winkler (1.5.1)
26
+ json (2.1.0)
27
+ parallel (1.12.1)
28
+ parser (2.5.1.2)
29
+ ast (~> 2.4.0)
30
+ powerpack (0.1.2)
31
+ rainbow (3.0.0)
32
+ rake (12.3.1)
33
+ rspec (3.8.0)
34
+ rspec-core (~> 3.8.0)
35
+ rspec-expectations (~> 3.8.0)
36
+ rspec-mocks (~> 3.8.0)
37
+ rspec-core (3.8.0)
38
+ rspec-support (~> 3.8.0)
39
+ rspec-expectations (3.8.1)
40
+ diff-lcs (>= 1.2.0, < 2.0)
41
+ rspec-support (~> 3.8.0)
42
+ rspec-mocks (3.8.0)
43
+ diff-lcs (>= 1.2.0, < 2.0)
44
+ rspec-support (~> 3.8.0)
45
+ rspec-support (3.8.0)
46
+ rubocop (0.58.2)
47
+ jaro_winkler (~> 1.5.1)
48
+ parallel (~> 1.10)
49
+ parser (>= 2.5, != 2.5.1.1)
50
+ powerpack (~> 0.1)
51
+ rainbow (>= 2.2.2, < 4.0)
52
+ ruby-progressbar (~> 1.7)
53
+ unicode-display_width (~> 1.0, >= 1.0.1)
54
+ ruby-graphviz (1.2.3)
55
+ ruby-progressbar (1.10.0)
56
+ simplecov (0.16.1)
57
+ docile (~> 1.1)
58
+ json (>= 1.8, < 3)
59
+ simplecov-html (~> 0.10.0)
60
+ simplecov-html (0.10.2)
61
+ thor (0.20.0)
62
+ unicode-display_width (1.4.0)
63
+ url (0.3.2)
64
+
65
+ PLATFORMS
66
+ ruby
67
+
68
+ DEPENDENCIES
69
+ bundler (= 1.16.3)
70
+ bundler-audit (= 0.6.0)
71
+ codecov (= 0.1.10)
72
+ gemsurance (= 0.9.0)
73
+ rake (= 12.3.1)
74
+ rspec (= 3.8.0)
75
+ rubocop (= 0.58.2)
76
+ ruby-graphviz (= 1.2.3)
77
+ simplecov (= 0.16.1)
78
+ string_in_file!
79
+
80
+ BUNDLED WITH
81
+ 1.16.3
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
- [![CircleCI](https://circleci.com/gh/jhsu802701/string_in_file.svg?style=svg)](https://circleci.com/gh/jhsu802701/string_in_file)
2
- [![Dependency Status](https://gemnasium.com/badges/github.com/jhsu802701/string_in_file.svg)](https://gemnasium.com/github.com/jhsu802701/string_in_file)
3
- [![security](https://hakiri.io/github/jhsu802701/string_in_file/master.svg)](https://hakiri.io/github/jhsu802701/string_in_file/master)
4
- [![Code Climate](https://codeclimate.com/github/jhsu802701/string_in_file/badges/gpa.svg)](https://codeclimate.com/github/jhsu802701/string_in_file)
5
- <a href="https://codeclimate.com/github/jhsu802701/string_in_file/coverage"><img src="https://codeclimate.com/github/jhsu802701/string_in_file/badges/coverage.svg" /></a>
6
-
7
1
  # StringInFile
8
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/string_in_file.svg)](https://badge.fury.io/rb/string_in_file)
4
+ [![Build Status](https://semaphoreci.com/api/v1/jhsu802701/string_in_file/branches/master/badge.svg)](https://semaphoreci.com/jhsu802701/string_in_file)
5
+ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/a819811f15d4406ab94cbd1d50c5a11a)](https://www.codacy.com/project/jhsu802701/string_in_file/dashboard?utm_source=jhsu802701@bitbucket.org&amp;utm_medium=referral&amp;utm_content=jhsu802701/string_in_file&amp;utm_campaign=Badge_Grade_Dashboard)
6
+ [![codebeat badge](https://codebeat.co/badges/b20c8e08-a6f7-46fd-9222-e6536b23277e)](https://codebeat.co/projects/bitbucket-org-jhsu802701-string_in_file-master)
7
+ [![codecov](https://codecov.io/bb/jhsu802701/string_in_file/branch/master/graph/badge.svg)](https://codecov.io/bb/jhsu802701/string_in_file)
8
+
9
9
  This gem allows you to store a string value in a file. It's the ultimate global variable. This gem can also be used to replace a string in a file with another string, determine if a string is present in a file, or add a string to the beginning or end of a file.
10
10
 
11
11
  ## Installation
@@ -26,23 +26,35 @@ Or install it yourself as:
26
26
 
27
27
  ## Usage
28
28
 
29
- ### Store the string "Doppler Value Investing" at /home/wbuffett/test.txt:
30
- StringInFile.write("Doppler Value Investing", "/home/wbuffett/test.txt")
29
+ * Store the string "Doppler Value Investing" at /home/wbuffett/test.txt:
30
+ ```
31
+ StringInFile.write('Doppler Value Investing', '/home/wbuffett/test.txt')
32
+ ```
31
33
 
32
- ### Read the string stored at /home/wbuffett/test.txt:
33
- StringInFile.read("/home/wbuffett/test.txt")
34
+ * Read the string stored at /home/wbuffett/test.txt:
35
+ ```
36
+ StringInFile.read('/home/wbuffett/test.txt')
37
+ ```
34
38
 
35
- ### Replace "Doppler" with "Next Generation" in the string stored at /home/wbuffett/test.txt:
36
- StringInFile.replace("Doppler", "Next Generation", "/home/wbuffett/test.txt")
39
+ * Replace "Doppler" with "Next Generation" in the string stored at /home/wbuffett/test.txt:
40
+ ```
41
+ StringInFile.replace('Doppler', 'Next Generation', '/home/wbuffett/test.txt')
42
+ ```
37
43
 
38
- ### Check to see if the string "Doppler" is present at /home/wbuffett/test.txt:
39
- StringInFile.present("Doppler", "/home/wbuffett/test.txt")
44
+ * Check to see if the string "Doppler" is present at /home/wbuffett/test.txt:
45
+ ```
46
+ StringInFile.present('Doppler', '/home/wbuffett/test.txt')
47
+ ```
40
48
 
41
- ### Add a string to the beginning of a file
49
+ * Add a string to the beginning of a file:
50
+ ```
42
51
  StringInFile.add_beginning("one two three\n", 'numbers.txt')
52
+ ```
43
53
 
44
- ### Add a string to the end of a file
54
+ * Add a string to the end of a file
55
+ ```
45
56
  StringInFile.add_end("four five six\n", 'numbers.txt')
57
+ ```
46
58
 
47
59
  ## Development
48
60
 
@@ -55,7 +67,7 @@ StringInFile.add_end("four five six\n", 'numbers.txt')
55
67
 
56
68
  ## Contributing
57
69
 
58
- Bug reports and pull requests are welcome on GitHub at https://github.com/jhsu802701/string_in_file. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
70
+ Bug reports and pull requests are welcome on BitBucket at https://bitbucket.org/jhsu802701/string_in_file. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
59
71
 
60
72
  ## License
61
73
 
@@ -63,4 +75,4 @@ The gem is available as open source under the terms of the [MIT License](http://
63
75
 
64
76
  ## Code of Conduct
65
77
 
66
- Everyone interacting in the StringInFile project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/jhsu802701/string_in_file/blob/master/CODE_OF_CONDUCT.md).
78
+ Everyone interacting in the StringInFile project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://bitbucket.org/jhsu802701/string_in_file/src/master/CODE_OF_CONDUCT.md).
@@ -1,3 +1,3 @@
1
1
  module StringInFile
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.1'.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 'string_in_file/version'
6
4
 
@@ -12,7 +10,7 @@ Gem::Specification.new do |spec|
12
10
 
13
11
  spec.summary = 'Write string values to files and read file contents into strings.'
14
12
  spec.description = 'Write string values to files and read file contents into strings.'
15
- spec.homepage = 'https://github.com/jhsu802701/string_in_file'
13
+ spec.homepage = 'https://bitbucket.org/jhsu802701/string_in_file'
16
14
  spec.license = 'MIT'
17
15
 
18
16
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -22,13 +20,15 @@ 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.15'
26
- spec.add_development_dependency 'rake', '~> 10.0'
27
- spec.add_development_dependency 'rspec', '~> 3.0'
28
- spec.add_development_dependency 'rubocop'
29
- spec.add_development_dependency 'bundler-audit'
30
- spec.add_development_dependency 'gemsurance'
31
- spec.add_development_dependency 'ruby-graphviz'
32
- spec.add_development_dependency 'simplecov'
33
- spec.add_development_dependency 'codeclimate-test-reporter'
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
34
  end
data/upgrade_gems.sh ADDED
@@ -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,141 +1,141 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: string_in_file
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
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-08-26 00:00:00.000000000 Z
11
+ date: 2018-08-15 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.15'
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.15'
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: rubocop
56
+ name: bundler-audit
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 0.6.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.6.0
69
69
  - !ruby/object:Gem::Dependency
70
- name: bundler-audit
70
+ name: gemsurance
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 0.9.0
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: 0.9.0
83
83
  - !ruby/object:Gem::Dependency
84
- name: gemsurance
84
+ name: rubocop
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: 0.58.2
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: 0.58.2
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: ruby-graphviz
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: 1.2.3
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: 1.2.3
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: simplecov
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: '0'
117
+ version: 0.16.1
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: 0.16.1
125
125
  - !ruby/object:Gem::Dependency
126
- name: codeclimate-test-reporter
126
+ name: codecov
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - '='
130
130
  - !ruby/object:Gem::Version
131
- version: '0'
131
+ version: 0.1.10
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: 0.1.10
139
139
  description: Write string values to files and read file contents into strings.
140
140
  email:
141
141
  - rubyist@jasonhsu.com
@@ -148,6 +148,7 @@ files:
148
148
  - ".rubocop.yml"
149
149
  - CODE_OF_CONDUCT.md
150
150
  - Gemfile
151
+ - Gemfile.lock
151
152
  - LICENSE.txt
152
153
  - README.md
153
154
  - Rakefile
@@ -163,7 +164,8 @@ files:
163
164
  - lib/string_in_file.rb
164
165
  - lib/string_in_file/version.rb
165
166
  - string_in_file.gemspec
166
- homepage: https://github.com/jhsu802701/string_in_file
167
+ - upgrade_gems.sh
168
+ homepage: https://bitbucket.org/jhsu802701/string_in_file
167
169
  licenses:
168
170
  - MIT
169
171
  metadata: {}
@@ -183,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
185
  version: '0'
184
186
  requirements: []
185
187
  rubyforge_project:
186
- rubygems_version: 2.6.12
188
+ rubygems_version: 2.7.7
187
189
  signing_key:
188
190
  specification_version: 4
189
191
  summary: Write string values to files and read file contents into strings.