tmin 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tmin (0.2.1)
4
+ tmin (0.2.4)
5
5
  dm-aggregates (~> 1.2.0)
6
6
  dm-core (~> 1.2.0)
7
7
  dm-migrations (~> 1.2.0)
@@ -15,6 +15,7 @@ GEM
15
15
  remote: http://rubygems.org/
16
16
  specs:
17
17
  addressable (2.2.7)
18
+ backports (3.6.0)
18
19
  data_objects (0.10.8)
19
20
  addressable (~> 2.1)
20
21
  database_cleaner (0.6.7)
@@ -53,8 +54,9 @@ GEM
53
54
  rspec-expectations (2.5.0)
54
55
  diff-lcs (~> 1.1.2)
55
56
  rspec-mocks (2.5.0)
56
- sinatra (1.2.8)
57
- rack (~> 1.1)
57
+ sinatra (1.2.9)
58
+ backports
59
+ rack (~> 1.1, < 1.5)
58
60
  tilt (>= 1.2.2, < 2.0)
59
61
  tilt (1.4.1)
60
62
 
data/lib/tmin/server.rb CHANGED
@@ -297,27 +297,31 @@ end
297
297
  @url = Firefly::Url.first(:code => params[:code])
298
298
 
299
299
 
300
-
300
+ #The string saved by tminus app.
301
301
  string = @url.url
302
302
 
303
+ #Time builds an array from the tminus string that stores the time, countdown name, and all other information about the countdown
303
304
  @time = []
304
305
  @time = array_builder(string)
305
306
 
307
+
308
+ #The color is indicated within the 6 spot of the array
306
309
  @color = @time[6].to_i
307
310
 
311
+
312
+ #font_color sends the color number and in return gets what color the font is.
308
313
  @font_color = font_builder(@color)
309
314
 
315
+ #Indicates if the alert is set within the string
310
316
  @alert = alert_on(@time[2].to_i)
311
317
 
318
+
319
+ #Date gets passed to the javascript in the redirect.haml that indicates the countdown date. Insert adds 20 to complete the year.
312
320
  @date = @time[4].to_s.insert(6, '20')
313
321
 
314
322
  #Array containing the number relating to the image number of default backgorunds.
315
323
  @num = (1..39).to_a
316
324
 
317
- # @expired = date_expired(@date)
318
-
319
- # @parsed_time = Date.parse(@time[4]).strftime("%FT%T")
320
-
321
325
 
322
326
  if @url.nil?
323
327
  status 404
@@ -439,13 +443,6 @@ end
439
443
  end
440
444
 
441
445
 
442
- def date_expired(time)
443
-
444
- # expired = DateTime.parse(time) < DateTime.now
445
- return expired
446
-
447
- end
448
-
449
446
  end
450
447
  end
451
448
 
data/lib/tmin/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # encoding: UTF-8
2
2
  module Tminus
3
- VERSION = "0.2.4"
3
+ VERSION = "0.2.5"
4
4
  end
data/views/redirect.haml CHANGED
@@ -11,15 +11,6 @@
11
11
  #countdown
12
12
  </div>
13
13
 
14
- %h2.text-center
15
-
16
- <div class="#{@font_color}">
17
- -#- if @expired == true
18
- -# Since
19
- -#- else
20
- -# Until
21
- Until
22
- </div>
23
14
  %h2.text-center
24
15
  <div class="#{@font_color}">
25
16
  = URI.unescape(@time[8])
@@ -62,7 +53,7 @@
62
53
  var neg_days = Math.abs(days)
63
54
  var neg_hours = Math.abs(hours)
64
55
  var neg_minutes = Math.abs(minutes)
65
- var net_seconds = Math.abs(seconds)
56
+ var neg_seconds = Math.abs(seconds)
66
57
 
67
58
  if (iOS == true) {
68
59
  document.getElementById('device').innerHTML = ' <a href="#{@url.url}">Open in Tminus</a> ';
@@ -71,7 +62,8 @@
71
62
  document.getElementById('countdown').innerHTML = neg_days + ' Days <br> ';
72
63
  document.getElementById('countdown').innerHTML += neg_hours + ' Hours <br>';
73
64
  document.getElementById('countdown').innerHTML += neg_minutes + ' Minutes <br>';
74
- document.getElementById('countdown').innerHTML += neg_seconds + ' Seconds';
65
+ document.getElementById('countdown').innerHTML += neg_seconds + ' Seconds <br>';
66
+ document.getElementById('countdown').innerHTML += ' <h2><div class="#{@font_color}">since </div></h2>';
75
67
 
76
68
 
77
69
 
@@ -85,7 +77,8 @@
85
77
  document.getElementById('countdown').innerHTML = days + ' Days <br> ';
86
78
  document.getElementById('countdown').innerHTML += hours + ' Hours <br>';
87
79
  document.getElementById('countdown').innerHTML += minutes + ' Minutes <br>';
88
- document.getElementById('countdown').innerHTML += seconds + ' Seconds';
80
+ document.getElementById('countdown').innerHTML += seconds + ' Seconds <br>';
81
+ document.getElementById('countdown').innerHTML += '<h2><div class="#{@font_color}"> until </div></h2>';
89
82
 
90
83
  if (iOS == true) {
91
84
  document.getElementById('device').innerHTML = ' <a href="#{@url.url}">Open in Tminus</a> ';
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tmin
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 4
10
- version: 0.2.4
9
+ - 5
10
+ version: 0.2.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - drobs