spec_views 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42a03f1d324852c51d56e4afdadadcc00e6449954917f396599df6c4568176d0
4
- data.tar.gz: 466b8bddc2f1c78bed3bbe57370b26bc87f71ecf38e2476ccc46fa4237a5410a
3
+ metadata.gz: af819d4fc2aa2487c81eb455030288533b00153f6fde05a5152211734c1625c1
4
+ data.tar.gz: c3b653db474cd69198cf0ccdd9be78a9c224be98a8802bcb0d4941553081e20c
5
5
  SHA512:
6
- metadata.gz: 48a9730de38ccc7927d852015fcb7c051e783a8a603cb665df17095a45799e882a1cc276d09b31177a2bc7ee93c8c86a455e5d0f24314e80ad19b77adcb36860
7
- data.tar.gz: a837bcd14d1e95707830291dbd621c41bef508c3fc858854bc22c6142aee2170b24d29f991c055b457da173db0b6a94e0920aaeef87cca13b5d4f13724393238
6
+ metadata.gz: d5e1a78b8fe0cea35ab90985f35eeb512e12c262171a3279c1aead04f754aef40c29adf9e236d58d844a59f36f05fd8fea1f4ec16c6809b97e7f051dc15e978b
7
+ data.tar.gz: 296860d1ef38ce4136d7a5a61229aa5ece286c9aeaef409d0688eaf801e7e631fe0019bfd91370ebf077a029ecf2d63564d32a08e871ff17f837b2eb5560cb92
@@ -14,7 +14,7 @@ module SpecViews
14
14
  @directory = SpecViews::Directory.for_description(description, content_type: content_type)
15
15
  @extractor_failure = @extractor.extractor_failure?
16
16
  @match = !extractor_failure? && match_challenger
17
- directory.write_meta(description, run_time, type, content_type) if champion_html
17
+ directory.write_last_run(run_time) if champion_html
18
18
  return if match?
19
19
 
20
20
  if extractor_failure?
@@ -25,7 +25,8 @@ module SpecViews
25
25
  @failure_message = "#{subject_name} has changed."
26
26
  @failure_message = "#{subject_name} has been added." if champion_html.nil?
27
27
 
28
- directory.write_meta(description, run_time, type, content_type)
28
+ directory.write_last_run(run_time)
29
+ directory.write_meta(description, type, content_type)
29
30
  @directory.write_challenger(challenger_body)
30
31
  end
31
32
 
@@ -69,11 +69,11 @@ module SpecViews
69
69
  path.join('meta.txt')
70
70
  end
71
71
 
72
- def write_meta(description, run_time, spec_type, content_type)
72
+ def write_meta(description, spec_type, content_type)
73
73
  FileUtils.mkdir_p(path)
74
74
  lines = [
75
75
  description.to_s.gsub("\n", ' '),
76
- run_time.to_s,
76
+ '',
77
77
  spec_type.to_s,
78
78
  content_type.to_s
79
79
  ]
@@ -90,12 +90,6 @@ module SpecViews
90
90
  name
91
91
  end
92
92
 
93
- def last_run
94
- Time.zone.parse(meta[1])
95
- rescue Errno::ENOENT
96
- Time.zone.at(0)
97
- end
98
-
99
93
  def spec_type
100
94
  ActiveSupport::StringInquirer.new(meta[2])
101
95
  rescue Errno::ENOENT
@@ -114,6 +108,21 @@ module SpecViews
114
108
  content_type.pdf?
115
109
  end
116
110
 
111
+ def last_run_path
112
+ path.join('last_run.txt')
113
+ end
114
+
115
+ def write_last_run(run_time)
116
+ FileUtils.mkdir_p(path)
117
+ File.write(last_run_path, run_time.to_s)
118
+ end
119
+
120
+ def last_run
121
+ Time.zone.parse(File.read(last_run_path).strip)
122
+ rescue Errno::ENOENT
123
+ Time.zone.at(0)
124
+ end
125
+
117
126
  private
118
127
 
119
128
  def splitted_description
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SpecViews
4
- VERSION = '3.0.0'
4
+ VERSION = '3.1.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spec_views
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Gaul