wb 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +1 -1
- data/exe/wb +11 -2
- data/lib/wb/shell.rb +6 -4
- data/lib/wb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 515543e7f633d277090c39e9e3550ae629c55c60df3eabeaa6d6c6a97a2e2f59
|
4
|
+
data.tar.gz: 81f7efb415eebbf7b79abaed702b3968782ded4284bc38aa861f6e5d0ae0abe1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5faff9fe23dafe8e0acbcb079b68ef6049415c73f79a4caa17c8ddc239971cc8fbb308293a583486d6d107be6c5c80bccbbe8e8d39e2c7f53859c57bb7ae730
|
7
|
+
data.tar.gz: 73b18d63b64b8c29eb15282d51d67817b37df9f322cc851af1616615e649e35353571716be3517792a806d5991960fe0c5b9ea3cb2cae2dcc4de4605f262126b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## Unrelease
|
4
|
+
|
5
|
+
## 1.1.0
|
6
|
+
|
7
|
+
- Fixed `LoadError` from executable by adding `lib` to load paths
|
8
|
+
- Fixed missing require of FileUtils in shell.rb
|
9
|
+
- Fixed Shell.mkdir_p_touch
|
10
|
+
- Improve wb new when pass in a path contains slash
|
11
|
+
|
3
12
|
## 1.0.3
|
4
13
|
|
5
14
|
- Fixed `LoadError` from executable
|
data/Gemfile.lock
CHANGED
data/exe/wb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
$:.unshift File.expand_path("../lib", __dir__)
|
2
5
|
|
3
|
-
require "bundler"
|
4
6
|
require "wb"
|
5
7
|
|
6
8
|
# Exit cleanly from an early interrupt
|
@@ -164,12 +166,18 @@ class NewCommand
|
|
164
166
|
end
|
165
167
|
|
166
168
|
def run(name)
|
167
|
-
filename = WB::Project.new_note(name)
|
169
|
+
filename = WB::Project.new_note sanitize_filename(name)
|
170
|
+
|
168
171
|
unless File.exist?(filename)
|
169
172
|
WB::Shell.create_file(filename)
|
170
173
|
end
|
174
|
+
|
171
175
|
WB::Shell.open_file(filename)
|
172
176
|
end
|
177
|
+
|
178
|
+
def sanitize_filename(name)
|
179
|
+
name.tr("/", "-")
|
180
|
+
end
|
173
181
|
end
|
174
182
|
|
175
183
|
class ConfigCommand
|
@@ -195,4 +203,5 @@ commands = [
|
|
195
203
|
NewCommand,
|
196
204
|
ConfigCommand,
|
197
205
|
]
|
206
|
+
|
198
207
|
WB::CLI.new(commands).run(arguments: ARGV)
|
data/lib/wb/shell.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "fileutils"
|
4
|
+
|
3
5
|
module WB
|
4
6
|
class Shell
|
5
7
|
def self.run(*commands)
|
@@ -8,12 +10,12 @@ module WB
|
|
8
10
|
end
|
9
11
|
|
10
12
|
def self.mkdir_p_touch(path)
|
11
|
-
|
13
|
+
directories = File.dirname(path)
|
12
14
|
filename = File.basename(path)
|
13
|
-
unless File.exist?(
|
14
|
-
FileUtils.mkdir_p(
|
15
|
+
unless File.exist?(directories)
|
16
|
+
FileUtils.mkdir_p(directories)
|
15
17
|
end
|
16
|
-
FileUtils.touch(
|
18
|
+
FileUtils.touch(path)
|
17
19
|
$stdout.puts "#{path} created"
|
18
20
|
end
|
19
21
|
|
data/lib/wb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juanito Fatas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|