inertia 0.1.3 → 0.1.4

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: 54049003ac9e8b0859fbc55f00a09f7d0b7ea85b79f194e0b1bd789baac28495
4
- data.tar.gz: 492cf75dd2dc7260c504e2ab05588e798faf9b5a42e07b1a5d1c533c80cdca71
3
+ metadata.gz: 9f8b81973d732449c9ab5c237d0535d50188f9a008106497ac1e8a199692fa54
4
+ data.tar.gz: 586aa0b5554c730735b1ff73e1b9ce2884702a2a521962ddd30aa686581016fc
5
5
  SHA512:
6
- metadata.gz: bf0e36f7dacbec8aef79f5eef24a23dc5c11d1e03331099e66f7b163189d14bf9ba0254960d38f387dbe44c75843a89a4b1ae5ec22826932d05026ed3acf6097
7
- data.tar.gz: 8e523e7db241e6a7227d5490d37f0fb9fa107b63bdaeb7eccbe5b56b8e6c25c925a67054e6b362384bed0e71f6393879caa3f3f73f5e05e360770b80a32af5ba
6
+ metadata.gz: 19229279bcd3629b89045d3252ee0d3acd87efb3f5d05220bc4da0dd4fc0c41b01e1a2823a3f4dd6a1e7997bc07cfe74794a7baa5d5f53e952aa029384aaa6f9
7
+ data.tar.gz: aa0ba64caaea83a03c8fed07a6afbb4ab590857fc97d1f6c972c695558df56ede4158b9bf487e9939b2c9425888338ebc94052a18ce28a30d9d9a892efb11b81
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- inertia (0.1.3)
4
+ inertia (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/History.md ADDED
@@ -0,0 +1,4 @@
1
+ 0.1.4 / 2018-10-21
2
+ ==================
3
+
4
+ * Ignore non text files
data/lib/inertia/mass.rb CHANGED
@@ -7,7 +7,13 @@ module Inertia
7
7
  end
8
8
  attr_reader :path
9
9
 
10
+ def text?
11
+ @text ||= `file -b --mime #{path}`.match?('text')
12
+ end
13
+
10
14
  def lines
15
+ return 0 unless text?
16
+
11
17
  @lines ||= `wc -l "#{path}" | awk '{print $1}'`.chomp.to_i
12
18
  end
13
19
 
@@ -1,3 +1,3 @@
1
1
  module Inertia
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inertia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Hood
@@ -80,6 +80,7 @@ files:
80
80
  - CODE_OF_CONDUCT.md
81
81
  - Gemfile
82
82
  - Gemfile.lock
83
+ - History.md
83
84
  - LICENSE.txt
84
85
  - README.md
85
86
  - Rakefile