sugarcube 0.18.6 → 0.18.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -304,7 +304,7 @@ recurring events)
304
304
  => [2012, 9, 13, 9, 19, 6]
305
305
 
306
306
  (main)> now.string_with_style
307
- => "Tuesday, January 29, 2013"
307
+ => "January 29, 2013"
308
308
  (main)> now.string_with_style(NSDateFormatterShortStyle)
309
309
  => "1/29/13"
310
310
  (main)> now.string_with_style(:short)
@@ -424,8 +424,8 @@ on.
424
424
  (main)> mar_10_2013 = NSDate.from_components
425
425
 
426
426
  # unfortunately you will, in the edge cases, end up with stuff like this:
427
- (main)> feb_28_2012 == feb_28_2012.delta(days:1, months:12).delta(months:-12)
428
- => true
427
+ (main)> feb_28_2012 == feb_28_2012.delta(days:1, months:12).delta(days: -1, months:-12)
428
+ => 2012-02-29 00:00:00 -0700
429
429
  ```
430
430
 
431
431
  NSError
@@ -42,14 +42,13 @@ module SugarCube
42
42
  def do_next
43
43
  return nil if @block_index >= @blocks.length
44
44
 
45
- options, _ = @blocks[@block_index]
45
+ options, block = @blocks[@block_index]
46
46
  @after_block = ->(completed){
47
47
  self.do_next || AnimationChain.stop_chain(self)
48
48
  }
49
49
  options[:after] = @after_block
50
50
 
51
51
  UIView.animate(options) {
52
- _, block = @blocks[@block_index]
53
52
  block.call
54
53
  @block_index += 1
55
54
  }
@@ -9,7 +9,7 @@ class NSDate
9
9
  return calendar.dateFromComponents(date_components)
10
10
  end
11
11
 
12
- def string_with_style(style)
12
+ def string_with_style(style=NSDateFormatterMediumStyle)
13
13
  date_formatter = NSDateFormatter.new
14
14
  if style.is_a? Symbol
15
15
  style = style.nsdatestyle
@@ -89,7 +89,6 @@ class Numeric
89
89
  end
90
90
  alias exabyte exabytes
91
91
 
92
-
93
92
  def string_with_style(style=NSNumberFormatterDecimalStyle)
94
93
  if style.is_a? Symbol
95
94
  style = style.nsnumberstyle
@@ -1,3 +1,3 @@
1
1
  module SugarCube
2
- Version = '0.18.6'
2
+ Version = '0.18.7'
3
3
  end
data/spec/nsdate_spec.rb CHANGED
@@ -15,6 +15,10 @@ describe "NSDate" do
15
15
  @date.string_with_style(:medium).should == 'Jan 2, 2013'
16
16
  end
17
17
 
18
+ it "should have an NSDate#string_with_style(style) method that has default" do
19
+ @date.string_with_style.should == 'Jan 2, 2013'
20
+ end
21
+
18
22
  it "should have an NSDate#string_with_style(style) method that accepts NSDateStyle constants" do
19
23
  @date.string_with_style(NSDateFormatterShortStyle).should == '1/2/13'
20
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sugarcube
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.6
4
+ version: 0.18.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2013-02-18 00:00:00.000000000 Z
16
+ date: 2013-02-19 00:00:00.000000000 Z
17
17
  dependencies: []
18
18
  description: ! '== Description
19
19