fossil 0.3.37 → 0.3.38

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.37
1
+ 0.3.38
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fossil}
8
- s.version = "0.3.37"
8
+ s.version = "0.3.38"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Patrick Lardin, Daniel Sudol"]
12
- s.date = %q{2010-04-14}
12
+ s.date = %q{2010-04-16}
13
13
  s.description = %q{Access FOS/betrieve db with this Sequel based orm wrapper}
14
14
  s.email = %q{plardin@xojet.com}
15
15
  s.files = [
@@ -78,4 +78,14 @@ class DateTime
78
78
  minutes = 0 unless minutes
79
79
  Date.from_fos_days(days).to_datetime.advance(:minutes=>minutes)
80
80
  end
81
+
82
+ def view
83
+ to_s
84
+ end
85
+
86
+ # This is a view that be parsed directly by javascript ie. in javascript
87
+ # you can say: Date.parse( "this to long view" ) and you will get a date object
88
+ def long_view
89
+ to_s(:long)
90
+ end
81
91
  end
@@ -180,7 +180,7 @@ class Sequel::Model
180
180
  # paid_boolean => which returns a string ("False" / "True") for values ( 0 / 1 )
181
181
  #
182
182
  def column_view(column_name, type, custom_method_name=nil)
183
- raise(StandardError,"Expect the type to be either :date, :time, :currency, :precision or :boolean") unless [:date, :time, :currency, :precision, :boolean].include? type
183
+ raise(StandardError,"Expect the type to be either :date, :datetime, :time, :currency, :precision or :boolean") unless [:date, :time, :datetime, :currency, :precision, :boolean].include? type
184
184
  # will get value from old_column_name
185
185
  method_name = custom_method_name || "#{column_name}_#{type.to_s}"
186
186
 
@@ -94,6 +94,6 @@ describe TripLeg do
94
94
  it "method total_trip_statute_miles returns a value" do
95
95
  @t = Trip.new(:total_statute_miles=>100)
96
96
  tl = TripLeg.new(:trip_number=>100,:leg_number=>3, :trip=>@t)
97
- p tl.total_trip_statute_miles
97
+ tl.total_trip_statute_miles.should == 10.0
98
98
  end
99
99
  end
@@ -2,11 +2,7 @@ require File.dirname(__FILE__) + '/../spec_helper'
2
2
 
3
3
  describe "fos_dates" do
4
4
 
5
- it "Time and DateTime have proper class methods included from TimeFunctions" do
6
- Time.should respond_to(:from_fos_time)
7
- end
8
-
9
- it "Time and DateTime have proper class methods included from TimeFunctions" do
5
+ it "Time and DateTime have instance methods included from TimeFunctions" do
10
6
  Time.new.should respond_to(:as_minutes)
11
7
  DateTime.new.should respond_to(:as_minutes)
12
8
  end
@@ -35,4 +31,8 @@ describe "fos_dates" do
35
31
  Time.parse('Sept 9, 2009 07:10').to_s.should == "07:10"
36
32
  end
37
33
 
34
+ it "DateTime has long_view method that makes long formatted string" do
35
+ tl = TripLeg.new(:dept_date_gmt=>40209, :etd_gmt=>100)
36
+ tl.planned_departure_date_time_gmt__long_view.should == "February 01, 2010 01:40"
37
+ end
38
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fossil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.37
4
+ version: 0.3.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Lardin, Daniel Sudol
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-04-14 00:00:00 -07:00
12
+ date: 2010-04-16 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency