wcr 0.1.0 → 0.1.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
  SHA1:
3
- metadata.gz: e93bdfebe8a4efee71ea30a5bd18fe51905232dd
4
- data.tar.gz: b61c9f61a4201552f5a39ed550c7a9780f3a1c5e
3
+ metadata.gz: bec05f739eb92b8fbd916e69c4ed14f81a92487f
4
+ data.tar.gz: 4125d8ea9543444527bc936ac438c71c5500e0db
5
5
  SHA512:
6
- metadata.gz: 59a944dfa02f448d85133737bbeb31c324851bbf54aa8a0da2f2498a8ab06572068d107acc158179bc71d458c8524e915c1eef4d7bb84194731b1ebcbb582296
7
- data.tar.gz: 9d86ddf880da421945e00e4db1aedcfa4b54fce4a31b7b713a4662367bcfb54637f5e150be0650702508ad433523eb34700b7ce0f2de32dd331f4489bde9ea54
6
+ metadata.gz: 724a2b5fb950c1b2910ed9319a7c8a3ce9c5611f6df469adf711f25ab1b4a6887d5a5ec2deb7519137d38efc84b886655296f6cc25759223beac06c1b6d3aa0b
7
+ data.tar.gz: 8afbb5fc8ce8a16e532d5cec96fdffe798726262a458a440082c6e0d1bade30dccb3ba7634725b42ecb58cca03ea50985a1aaf73f7f69afc51aea7ef8be07692
data/lib/wcr.rb CHANGED
@@ -1 +1,3 @@
1
- require 'wcr/command'
1
+ require "wcr/version.rb"
2
+ require "wcr/arguments_parser.rb"
3
+ require "wcr/command.rb"
@@ -27,6 +27,10 @@ module WordCountRecursive
27
27
  opts.on("-w") do |w|
28
28
  options[:command_opts] += " -w"
29
29
  end
30
+
31
+ opts.on("-v", "--version") do |v|
32
+ options[:version] = "wcr - v#{::WordCountRecursive::VERSION}"
33
+ end
30
34
  end
31
35
  begin
32
36
  o.parse!
@@ -1,9 +1,13 @@
1
- require 'wcr/arguments_parser'
2
-
3
1
  module WordCountRecursive
4
2
  class Command
5
3
  def initialize
6
4
  @paths, @options = ::WordCountRecursive::ArgumentsParser.new.parse
5
+
6
+ if @options.include? :version
7
+ puts @options[:version]
8
+ exit(1)
9
+ end
10
+
7
11
  @command = `wc #{@options[:command_opts]} #{"\`find #{@paths || '.'} -type f #{@options[:hidden_files]}\`"}`
8
12
  @command = @command.split('\n').grep(/^[^\.]/)
9
13
  end
@@ -0,0 +1,3 @@
1
+ module WordCountRecursive
2
+ VERSION = "0.1.1"
3
+ end
@@ -1,7 +1,11 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib)
3
+ require "wcr"
4
+
1
5
  Gem::Specification.new do |s|
2
6
  s.name = 'wcr'
3
- s.version = '0.1.0'
4
- s.date = '2014-11-18'
7
+ s.version = WordCountRecursive::VERSION
8
+ s.date = Time.now.strftime("%F")
5
9
  s.summary = "wc-recursive"
6
10
  s.description = "A wrapper on wc command. Permit to execute wc recursively with a more flexible argument parser."
7
11
  s.homepage = 'https://github.com/mehdi-farsi/wcr'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wcr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mehdi Farsi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-18 00:00:00.000000000 Z
11
+ date: 2015-11-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A wrapper on wc command. Permit to execute wc recursively with a more
14
14
  flexible argument parser.
@@ -25,6 +25,7 @@ files:
25
25
  - lib/wcr.rb
26
26
  - lib/wcr/arguments_parser.rb
27
27
  - lib/wcr/command.rb
28
+ - lib/wcr/version.rb
28
29
  - wcr.gemspec
29
30
  homepage: https://github.com/mehdi-farsi/wcr
30
31
  licenses:
@@ -46,7 +47,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
47
  version: '0'
47
48
  requirements: []
48
49
  rubyforge_project:
49
- rubygems_version: 2.2.2
50
+ rubygems_version: 2.4.5.1
50
51
  signing_key:
51
52
  specification_version: 4
52
53
  summary: wc-recursive