sycersion 0.2.0 → 0.2.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: a54667ff7333cf94be1029c004996ebe09cd95b15f52be646865f4f125ef70e9
4
- data.tar.gz: 6b90f19b743df4dc36c404a09476091478631c85399fedeb970d629710004b19
3
+ metadata.gz: 74fca173531567bcc02f1e07e07fbed00441208001ccf5efc9e2329a3a530036
4
+ data.tar.gz: 7ecae7f75bcbbfc67b8837956900a7c2dbb37c5a4daf7cbaec9ebf58006b57e0
5
5
  SHA512:
6
- metadata.gz: 144148c74b05c6c51391e9b56309506248f1d931349a34d7246cd295c375ce0525e2e71b1ea3f36215da0e1b29b21c3c32f9cad78e0e6d512137b92271352bd6
7
- data.tar.gz: 9ed2ee35d692a339ba5b044f381f0cbbcd082d0e2b362b4bdfbdeb727e5c0403a1bd5255864b24d7354856665859a84907b7691c8ba06c7d4572c43b44345d71
6
+ metadata.gz: a30908c13e1ee3701e4b234506b2b2a89289e5aeef11b108beabc2690f5b3dac691b09006a86aa169ef8a0d01b8a837b0981f6324ec240a7ca72836aa9dc9a41
7
+ data.tar.gz: 6a06dba6e6ca65fcd8558a1b9a89f91e0d214c82e7ff8351803d3bdc6b6d1beba34d3ce0f8685f2026c436250323da8eb8915ee0a615328653b21ab549062789
@@ -1,3 +1,5 @@
1
1
  ---
2
2
  - ".sycersion/version"
3
- - 0.2.0
3
+ - 0.2.1
4
+ -
5
+ -
@@ -0,0 +1 @@
1
+ 0.2.1
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sycersion
4
- VERSION = File.exist?('.sycersion/version') ? File.read('.sycersion/version') : '0.1.0'
4
+ VERSION = File.exist?('.sycersion/version') ? File.read('.sycersion/version') : '0.2.1'
5
5
  end
@@ -53,16 +53,28 @@ module Sycersion
53
53
  def determine_version_and_version_file
54
54
  files = Dir.glob('**/*version*')
55
55
  files.each do |file|
56
- File.readlines(file, chomp: true).each do |line|
57
- scan_result = line.scan(Sycersion::SEMVER_LAX_REGEX)
58
- if scan_result[0]
59
- @version_files[file] = [scan_result[0], line]
60
- break
61
- end
56
+ next if File.directory?(file)
57
+
58
+ retrieve_version_files(file)
59
+ end
60
+ end
61
+
62
+ def retrieve_version_files(file)
63
+ File.readlines(file, chomp: true).each do |line|
64
+ scan_result = scan_for_version(line)
65
+ if scan_result
66
+ @version_files[file] = [scan_result, line]
67
+ break
62
68
  end
63
69
  end
64
70
  end
65
71
 
72
+ def scan_for_version(line)
73
+ line.scan(Sycersion::SEMVER_LAX_REGEX)[0]
74
+ rescue ArgumentError
75
+ []
76
+ end
77
+
66
78
  def prompt_version_and_version_file
67
79
  if File.exist?(SYCERSION_VER)
68
80
  resume_version_and_version_file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sycersion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Sugar
@@ -79,6 +79,7 @@ files:
79
79
  - ".rspec"
80
80
  - ".ruby-version"
81
81
  - ".sycersion/environment.yml"
82
+ - ".sycersion/version"
82
83
  - ".travis.yml"
83
84
  - CODE_OF_CONDUCT.md
84
85
  - Gemfile