wb 1.0.3 → 1.1.0

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
2
  SHA256:
3
- metadata.gz: 3b583dcf6a81601e083bc5704f5064b338c60fec473516a064547fe92bf8571b
4
- data.tar.gz: 70fe6117eee8d951884076b0dee946467d59b1ac8937c0797c410c9b5ddcad6b
3
+ metadata.gz: 515543e7f633d277090c39e9e3550ae629c55c60df3eabeaa6d6c6a97a2e2f59
4
+ data.tar.gz: 81f7efb415eebbf7b79abaed702b3968782ded4284bc38aa861f6e5d0ae0abe1
5
5
  SHA512:
6
- metadata.gz: 9ef3adb65d7040b87527b4d3c474baf748d2f806e5f4f075c405c93460f98b34c4944bc480948cba6c4cfd2ed3f889a64321ee385f5a42dfd8e056c9940a7c41
7
- data.tar.gz: 492de8b7a98e0d9b24eaf6ebb0ac379f59ca40a95f7cca2cb8ddaa73630bd1920434b88fc92fa830ced6cc4645535a64da6262f7bfedf97cd0359b309f6b5277
6
+ metadata.gz: c5faff9fe23dafe8e0acbcb079b68ef6049415c73f79a4caa17c8ddc239971cc8fbb308293a583486d6d107be6c5c80bccbbe8e8d39e2c7f53859c57bb7ae730
7
+ data.tar.gz: 73b18d63b64b8c29eb15282d51d67817b37df9f322cc851af1616615e649e35353571716be3517792a806d5991960fe0c5b9ea3cb2cae2dcc4de4605f262126b
@@ -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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wb (1.0.3)
4
+ wb (1.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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)
@@ -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
- directory = File.dirname(path)
13
+ directories = File.dirname(path)
12
14
  filename = File.basename(path)
13
- unless File.exist?(directory)
14
- FileUtils.mkdir_p(directory)
15
+ unless File.exist?(directories)
16
+ FileUtils.mkdir_p(directories)
15
17
  end
16
- FileUtils.touch(filename)
18
+ FileUtils.touch(path)
17
19
  $stdout.puts "#{path} created"
18
20
  end
19
21
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WB
4
- VERSION = "1.0.3"
4
+ VERSION = "1.1.0"
5
5
  end
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.3
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-09-25 00:00:00.000000000 Z
11
+ date: 2018-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler