sugarcube 0.9 → 0.9.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.
@@ -1,7 +1,7 @@
1
1
  class NSString
2
2
 
3
3
  def post_notification(object=nil, user_info=nil)
4
- if user_info and not Hash === user_info
4
+ if user_info and not user_info.is_a? Hash
5
5
  raise TypeError("Invalid argument #{user_info.class.name} sent to String.post_notification")
6
6
  end
7
7
 
@@ -8,7 +8,7 @@ class NSDate
8
8
  return self.timezone.secondsFromGMT
9
9
  end
10
10
 
11
- def leap?
11
+ def leap_year?
12
12
  self.year % 4 == 0 and self.year % 100 != 0 or self.year % 400 == 0
13
13
  end
14
14
 
@@ -1,12 +1,5 @@
1
1
  class NSDate
2
2
 
3
- def +(val)
4
- if val.is_a?(Hash)
5
- return self.delta(val)
6
- end
7
- super
8
- end
9
-
10
3
  def delta(_components)
11
4
  components = {}.update(_components)
12
5
  is_very_specific = components.has_key?(:seconds)
@@ -15,10 +15,13 @@ class UIControl
15
15
  # button.on(:touchupoutside, :touchcancel) { my_code }
16
16
  def on(*events, &block)
17
17
  events.each do |event|
18
- event = event.uicontrolevent unless Fixnum === event
18
+ event = event.uicontrolevent unless event.is_a? Fixnum
19
19
 
20
20
  sugarcube_callbacks[event].push block
21
21
  addTarget(block, action: :call, forControlEvents:event)
22
+ puts("=============== uicontrol.rb at line 22 ===============
23
+ block: #{block.inspect}
24
+ event: #{event.inspect}")
22
25
  end
23
26
 
24
27
  self
@@ -31,7 +34,7 @@ class UIControl
31
34
  # button.off(:touchupoutside, :touchcancel)
32
35
  def off(*events)
33
36
  events.each do |event|
34
- event = event.uicontrolevent unless Fixnum === event
37
+ event = event.uicontrolevent unless event.is_a? Fixnum
35
38
 
36
39
  sugarcube_callbacks[event].each do |block|
37
40
  self.removeTarget(block, action: :call, forControlEvents:event)
@@ -1,3 +1,3 @@
1
1
  module SugarCube
2
- Version = '0.9'
2
+ Version = '0.9.1'
3
3
  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.9'
4
+ version: 0.9.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-09-14 00:00:00.000000000 Z
13
+ date: 2012-09-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
17
- requirement: &70323060274480 !ruby/object:Gem::Requirement
17
+ requirement: &70199437323400 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70323060274480
25
+ version_requirements: *70199437323400
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rspec
28
- requirement: &70323060273940 !ruby/object:Gem::Requirement
28
+ requirement: &70199437338580 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *70323060273940
36
+ version_requirements: *70199437338580
37
37
  description: ! '== Description
38
38
 
39
39