sbs 0.1.7 → 0.1.8

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sbs.rb +18 -11
  3. data/lib/sbs/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53d2077ffd1c5eaafaf76e60a1f28e0cf0a132ee989e431e118363d3b9f09e3b
4
- data.tar.gz: e950679120088dab1023b37331cb3bd9748bc00c193b3d0fc8c08c5324df2d52
3
+ metadata.gz: 340b41d2f5261cc5de537a531b504aa9ee46ea6d64600e4ded3c71e559f48e75
4
+ data.tar.gz: 194677c4d885261179553f16561ebab982e8b8c6a6e4bf4d61b13efae3e6829d
5
5
  SHA512:
6
- metadata.gz: e59869e79d0021cef536f728cde7d59b06e87abe94d4e34046a40dead0122891ac4b216186d5ecdea372d802096b56e5930c169ff27dca4d2005486611beb9bb
7
- data.tar.gz: 5213cb923293e5e08d72d3ad49b1e6e01c1130b640828d825688eb0ab6b7e26a0990d08c01a3f20dd2939d1ddf0cda0e9a18b06db28e2ac8445383602b930b12
6
+ metadata.gz: 11a3c8c3c68183246ab0c9dd5e8571967436f5ca7a6606b820088bb2c0dce414c12ae032b367015016bf77bb69d8c679c1b0d6e3bd8530c48efe2b2565334836
7
+ data.tar.gz: 16ada5cd9150bcef611225cfd06a6638471fe73054a592c40162f82bcacf231001b8dd44c0d8755c7ff20ea49f29c50421420c97cdbf71a774f9b77b93258c00
data/lib/sbs.rb CHANGED
@@ -199,22 +199,27 @@ module Sbs
199
199
  puts "*** Customizing '#{chain_name}' ..."
200
200
  Find.find(".") do |path|
201
201
  if not File.directory? path
202
- content = `sed "s/Substrate Node Template/#{chain_name.titleize} Node/g" "#{path}"`
203
- File.open(path, "w") do |f| f.write(content) end
204
202
 
205
- content = `sed "s/Substrate Node/#{chain_name.titleize} Node/g" "#{path}"`
206
- File.open(path, "w") do |f| f.write(content) end
203
+ if path.end_with?('README.md')
204
+ content = `sed "s/Substrate Node Template/#{chain_name.titleize} Node/g" "#{path}"`
205
+ File.open(path, "w") do |f| f.write(content) end
206
+
207
+ content = `sed "s/Substrate node/#{chain_name.titleize} node/g" "#{path}"`
208
+ File.open(path, "w") do |f| f.write(content) end
209
+ end
207
210
 
208
- content = `sed "s/Substrate node/#{chain_name.titleize} node/g" "#{path}"`
209
- File.open(path, "w") do |f| f.write(content) end
211
+ if path.end_with?('main.rs')
212
+ content = `sed "s/Substrate Node/#{chain_name.titleize} Node/g" "#{path}"`
213
+ File.open(path, "w") do |f| f.write(content) end
214
+ end
210
215
 
211
- content = `sed "s/node_template/#{chain_name.titleize.gsub(" ", "").underscore}/g" "#{path}"`
212
- File.open(path, "w") do |f| f.write(content) end
216
+ # content = `sed "s/node_template/#{chain_name.titleize.gsub(" ", "").underscore}/g" "#{path}"`
217
+ # File.open(path, "w") do |f| f.write(content) end
213
218
 
214
- content = `sed "s/node-template/#{chain_name.titleize.downcase.gsub(" ", "-")}/g" "#{path}"`
215
- File.open(path, "w") do |f| f.write(content) end
219
+ if path.end_with?('Cargo.toml')
220
+ content = `sed "s/node-template/#{chain_name.titleize.downcase.gsub(" ", "-")}/g" "#{path}"`
221
+ File.open(path, "w") do |f| f.write(content) end
216
222
 
217
- if path.end_with?("toml")
218
223
  if not author.nil?
219
224
  content = `sed "s/Anonymous/#{author}/g" "#{path}"`
220
225
  File.open(path, "w") do |f| f.write(content) end
@@ -223,11 +228,13 @@ module Sbs
223
228
  if is_branch
224
229
  sed = "sed \"s/path = \\\"\\\.\\\.\\\/.*\\\"/git = 'https:\\\/\\\/github.com\\\/paritytech\\\/substrate.git', branch='#{branch_or_commit}'/g\" #{path}"
225
230
  else
231
+ puts "fuck............"
226
232
  sed = "sed \"s/path = \\\"\\\.\\\.\\\/.*\\\"/git = 'https:\\\/\\\/github.com\\\/paritytech\\\/substrate.git', rev='#{branch_or_commit}'/g\" #{path}"
227
233
  end
228
234
  content = `#{sed}`
229
235
  File.open(path, "w") do |f| f.write(content) end
230
236
  end
237
+
231
238
  end
232
239
  end
233
240
 
@@ -1,3 +1,3 @@
1
1
  module Sbs
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - wuminzhe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-12 00:00:00.000000000 Z
11
+ date: 2019-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler