word_counter 0.0.1 → 0.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
  SHA1:
3
- metadata.gz: 95867ff9818214b5df3ff16612478e0eb6486488
4
- data.tar.gz: 5184bffd7a37d26afb7b9d4d49fe76fe3047a85e
3
+ metadata.gz: 5c147e993b823171dd15fde073ea9b756e90f9f2
4
+ data.tar.gz: ac1b7049265125eecc4e8bc2ba0667aa240480be
5
5
  SHA512:
6
- metadata.gz: 9ec9744709d1b8adf0a92955626cb18174311c646af7d72c9ef42c2518a2f4ca6d1c002353e162cc397af36fc769c12b94feed180e56fafce629ed15843d6f41
7
- data.tar.gz: 31923b381313a371ef1d78b26633a629f8226f00b164a84d3192bbb81454c91d6687308d94af474fa0b71a9d31b86ac5a433aed0289640e118e3da594acc24ee
6
+ metadata.gz: 08f066c3857a101ef68d26ff4d83a80ca0cf3857a38761abc5c9b862debddd31d0771293ef4b08a80ac84a540254f125c5c3792aaa0030dfa159645ae3c00ebd
7
+ data.tar.gz: 4dffa4cf7ff6ccc62df4b4181ff142555b780fbe5a02dc175a29358790bbefdfca99800ce0023a9efff271f76c7a29b3c51a854c6a5546b55a555c305313dbbc
data/bin/word_counter CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'word_counter'
4
4
 
5
- show_sentences = ARGV[1] == '-s'
5
+ i = ARGV.index('-s') || -1
6
+ show_sentences = ARGV.delete_at i if i >= 0
6
7
  wc = WordCounter.new ARGV[0], show_sentences
7
8
  wc.report
data/lib/word_counter.rb CHANGED
@@ -10,6 +10,7 @@ class WordCounter
10
10
  ##
11
11
  # @param filename [String] The path and filename of the file to analyze
12
12
  def initialize arg, show_sentences = false
13
+ raise ArgumentError, "Please supply a URL or file path." unless arg
13
14
  @show_sentences = true if show_sentences
14
15
 
15
16
  begin
@@ -1,3 +1,3 @@
1
1
  class WordCounter
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: word_counter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - trevor bortins