glibrary 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
2
  SHA256:
3
- metadata.gz: 37866c9371442b9ffcb049d2d1346a8ec55ef8c5f58e6e352dafef16c6eb2cf9
4
- data.tar.gz: b254f1c6fae7d1693d6b3b2fdea5a329e0536e921ca1f61c03877f0b2ed83871
3
+ metadata.gz: 55ce83446d6daacc5d6f6091297bb24052103e5069c82a99aa5d3bf99b48abfd
4
+ data.tar.gz: a4f28c9a651a3bf86910810657828d850460682c602dcb37e13c1b6aee818776
5
5
  SHA512:
6
- metadata.gz: 912694223219d7f92c6af52edfdb9c1ea81f471b4679a6c8f186e8ef0f8352b9b505e7170c73447c1c77a49da750bbfa304259b90e266a3ceae931f70da1f3a5
7
- data.tar.gz: 6adfe47c48b082edf19311a52c180cd226cf1cacc9f4adff6cc3b8c0be3463da3dfde2849dc24e7b9af948e0d86911888a99274ef6ec4288c60ee79ad5c6a0f3
6
+ metadata.gz: bac4fc64f4a08fbe330471f501b0000662eba38886503c324404cf2caafe5e9bb6095d16a34e719755baab43d9ef05d333c3f5c845f52898c144d0777c94acf6
7
+ data.tar.gz: 5293efc330c583482c989c904ab6adf70321e6f832cb10dacf2477624c38b8fb37f2a8fdb826aa28126b6531b1c84328ea4c0c15b3b4075fa692de703367cc10
data/bin/glibrary CHANGED
@@ -26,11 +26,11 @@ process_args!
26
26
 
27
27
  @options = {}
28
28
  @filename = DEFAULT_FILENAME
29
- command_line_parse!
29
+ command_line_parse! #this function processes @filename and fills the @options hash.
30
30
 
31
31
  prepare_filename_for_os!
32
32
 
33
- if @options.nil?
33
+ if library_mode?
34
34
 
35
35
  with_library_mode_error_handling do
36
36
  (@library = UserLibrary.new(filename: @filename)).pretty_print
@@ -38,7 +38,7 @@ module CommandLineParse
38
38
  handle_nonexistent_file if ARGV.include?("-l") && !File.exist?(@filename)
39
39
  end
40
40
 
41
- opts.on("-l", "--library", "See your library; ignores all search options") do
41
+ opts.on("-l", "--library", "See your reading list; ignores all search options") do
42
42
  @options = nil
43
43
  return
44
44
  end
@@ -8,6 +8,10 @@ module ExecHelper
8
8
  args << args.delete("-l") if args.include?("-l")
9
9
  end
10
10
 
11
+ def library_mode?
12
+ @options.nil?
13
+ end
14
+
11
15
  def prepare_filename_for_os!
12
16
  @filename.gsub!(/\//, '\\') if ENV.values.any? { |v| v =~ /[A-Z]:\\Windows/i }
13
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glibrary
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
  - Peter Engelbert