sugarcube 3.0.2 → 3.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9aaf20dd0e772b47482d112bfb0131e6cfe44410
4
- data.tar.gz: 6bd4d9153cdf28966eee328052bf624b43651227
3
+ metadata.gz: d1067f47fc67be82d7046dc78515ef6fac971020
4
+ data.tar.gz: d185f9866b31546c35b581f2523d1d0896b3bb36
5
5
  SHA512:
6
- metadata.gz: 49f32218fe441b022c377be7b976c671b215ef6836b96c5f7ccd5eb58e7f0af85bfb25ae82f89c2a087f218c48b0f583d0b886146242bfaafa8fca63557dd871
7
- data.tar.gz: 17721bd1e7e82e06bb1692e68b409c5493b33e2160ea6a95818bbfd2f285cebd2fe6c61fe5395905729385b34c0ed75fb59e1806e1fff0019f4ff0a282917699
6
+ metadata.gz: 72d3f842b4b70296268fffff91ba543982343e5ca157acae580b4f80c18054873b66f700778413c4567da7dab8a71aa3e1ca5d198243029764a9ebbcf9a7f6b0
7
+ data.tar.gz: fe627d4d69c511a1567bcc776c7d6d54a8f7bc7e4a620b9cacd35adbc773cceb64a2124150a4453e4d195f75c6ad4558be13d17688eaf1b71a9b53797375ee5c
@@ -163,7 +163,7 @@ module SugarCube
163
163
  return ret if @collapsed_items && @collapsed_items.include?(item)
164
164
 
165
165
  index = 0
166
- items.each do |subitem, index|
166
+ items.each do |subitem|
167
167
  ret.concat build_tree(subitem)
168
168
  index += 1
169
169
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module SugarCube
2
- Version = '3.0.2'
2
+ Version = '3.0.3'
3
3
  end
@@ -0,0 +1,139 @@
1
+ describe "Numeric" do
2
+
3
+ it "should have a #percent method" do
4
+ 0.percent.should == 0
5
+ 50.percent.should == 0.50
6
+ 100.percent.should == 1
7
+ 200.percent.should == 2.0
8
+ end
9
+
10
+ it "should have a #g method" do
11
+ 0.g.should == 0
12
+ 1.g.should == 9.78033
13
+ end
14
+
15
+ it "should have an #in_g method" do
16
+ 0.in_g.should == 0
17
+ 9.78033.in_g.should == 1
18
+ end
19
+
20
+ it "should have a #radian(s) method" do
21
+ 0.radians.should == 0
22
+ 1.radian.should == 1
23
+ 1.5.radians.should == 1.5
24
+ end
25
+
26
+ it "should have a #in_radians method" do
27
+ 0.radians.in_radians.should == 0
28
+ 1.radian.in_radians.should == 1
29
+ 1.5.radians.in_radians.should == 1.5
30
+ end
31
+
32
+ it "should have a #degree(s) method" do
33
+ 0.degrees.should == 0
34
+ (1.degree).round(2).should == (Math::PI / 180).round(2)
35
+ (180.degrees).round(2).should == (Math::PI).round(2)
36
+ (45.degrees).round(2).should == (Math::PI / 4).round(2)
37
+ end
38
+
39
+ it "should have a #degree(s) method" do
40
+ 0.degrees.should == 0
41
+ 1.degree.in_degrees.round.should == 1
42
+ 180.degrees.in_degrees.round.should == 180
43
+ 45.degrees.in_degrees.round.should == 45
44
+ end
45
+
46
+ it "should have a #pi method" do
47
+ 0.pi.should == 0
48
+ 1.pi.should == Math::PI
49
+ 2.pi.should == Math::PI * 2
50
+ end
51
+
52
+ it "should have a #meter(s) method" do
53
+ 0.meters.should == 0
54
+ 1.meter.should == 1
55
+ 2.meters.should == 2
56
+ end
57
+
58
+ it "should have an #in_meters method" do
59
+ 0.in_meters.should == 0
60
+ 1.in_meters.should == 1
61
+ 2.in_meters.should == 2
62
+ end
63
+
64
+ it "should have a #kilometer(s) method" do
65
+ 0.kilometers.should == 0
66
+ 1.kilometer.should == 1000.meters
67
+ 0.5.kilometers.should == 500.meters
68
+ end
69
+
70
+ it "should have an #in_kilometers method" do
71
+ 0.in_kilometers.should == 0
72
+ 1000.meters.in_kilometers.should == 1
73
+ 500.meters.in_kilometers.should == 0.5
74
+ end
75
+
76
+ it "should have a #mile(s) method" do
77
+ 0.miles.should == 0.meters
78
+ 1.mile.round.should == 1609.meters
79
+ 2.miles.round.should == 3219.meters
80
+ end
81
+
82
+ it "should have an #in_miles method" do
83
+ 0.meters.in_miles.should == 0
84
+ 1609.meters.in_miles.round.should == 1
85
+ 3219.meters.in_miles.round.should == 2
86
+ end
87
+
88
+ it "should have a #feet(foot) method" do
89
+ 0.feet.should == 0
90
+ 3.foot.round.should == 1
91
+ 7.feet.round.should == 2
92
+ end
93
+
94
+ it "should have an #in_feet method" do
95
+ 0.meters.in_feet.should == 0
96
+ 1.meters.in_feet.round.should == 3
97
+ 2.meters.in_feet.round.should == 7
98
+ end
99
+
100
+ it "should have a #byte method" do
101
+ 1.byte.should == 1
102
+ 2.bytes.should == 2
103
+ end
104
+
105
+ it "should have a #kilobyte method" do
106
+ 1.kilobyte.should == 1 * 1024**1
107
+ 2.kilobytes.should == 2 * 1024**1
108
+ end
109
+
110
+ it "should have a #megabyte method" do
111
+ 1.megabyte.should == 1 * 1024**2
112
+ 2.megabytes.should == 2 * 1024**2
113
+ end
114
+
115
+ it "should have a #gigabyte method" do
116
+ 1.gigabyte.should == 1 * 1024**3
117
+ 2.gigabytes.should == 2 * 1024**3
118
+ end
119
+
120
+ it "should have a #terabyte method" do
121
+ 1.terabyte.should == 1 * 1024**4
122
+ 2.terabytes.should == 2 * 1024**4
123
+ end
124
+
125
+ it "should have a #petabyte method" do
126
+ 1.petabyte.should == 1 * 1024**5
127
+ 2.petabytes.should == 2 * 1024**5
128
+ end
129
+
130
+ it "should have a #exabyte method" do
131
+ 1.exabyte.should == 1 * 1024**6
132
+ 2.exabytes.should == 2 * 1024**6
133
+ end
134
+
135
+ it 'should have a #to_bool method' do
136
+ 0.to_bool.should == false
137
+ 1.to_bool.should == true
138
+ end
139
+ end
@@ -1,146 +1,9 @@
1
1
  describe "Numeric" do
2
2
 
3
- it "should have a #percent method" do
4
- 0.percent.should == 0
5
- 50.percent.should == 0.50
6
- 100.percent.should == 1
7
- 200.percent.should == 2.0
8
- end
9
-
10
- it "should have a #g method" do
11
- 0.g.should == 0
12
- 1.g.should == 9.78033
13
- end
14
-
15
- it "should have an #in_g method" do
16
- 0.in_g.should == 0
17
- 9.78033.in_g.should == 1
18
- end
19
-
20
- it "should have a #radian(s) method" do
21
- 0.radians.should == 0
22
- 1.radian.should == 1
23
- 1.5.radians.should == 1.5
24
- end
25
-
26
- it "should have a #in_radians method" do
27
- 0.radians.in_radians.should == 0
28
- 1.radian.in_radians.should == 1
29
- 1.5.radians.in_radians.should == 1.5
30
- end
31
-
32
- it "should have a #degree(s) method" do
33
- 0.degrees.should == 0
34
- 1.degree.should == Math::PI / 180
35
- 180.degrees.should == Math::PI
36
- 45.degrees.should == Math::PI / 4
37
- end
38
-
39
- it "should have a #degree(s) method" do
40
- 0.degrees.should == 0
41
- 1.degree.in_degrees.round.should == 1
42
- 180.degrees.in_degrees.round.should == 180
43
- 45.degrees.in_degrees.round.should == 45
44
- end
45
-
46
- it "should have a #pi method" do
47
- 0.pi.should == 0
48
- 1.pi.should == Math::PI
49
- 2.pi.should == Math::PI * 2
50
- end
51
-
52
- it "should have a #meter(s) method" do
53
- 0.meters.should == 0
54
- 1.meter.should == 1
55
- 2.meters.should == 2
56
- end
57
-
58
- it "should have an #in_meters method" do
59
- 0.in_meters.should == 0
60
- 1.in_meters.should == 1
61
- 2.in_meters.should == 2
62
- end
63
-
64
- it "should have a #kilometer(s) method" do
65
- 0.kilometers.should == 0
66
- 1.kilometer.should == 1000.meters
67
- 0.5.kilometers.should == 500.meters
68
- end
69
-
70
- it "should have an #in_kilometers method" do
71
- 0.in_kilometers.should == 0
72
- 1000.meters.in_kilometers.should == 1
73
- 500.meters.in_kilometers.should == 0.5
74
- end
75
-
76
- it "should have a #mile(s) method" do
77
- 0.miles.should == 0.meters
78
- 1.mile.round.should == 1609.meters
79
- 2.miles.round.should == 3219.meters
80
- end
81
-
82
- it "should have an #in_miles method" do
83
- 0.meters.in_miles.should == 0
84
- 1609.meters.in_miles.round.should == 1
85
- 3219.meters.in_miles.round.should == 2
86
- end
87
-
88
- it "should have a #feet(foot) method" do
89
- 0.feet.should == 0
90
- 3.foot.round.should == 1
91
- 7.feet.round.should == 2
92
- end
93
-
94
- it "should have an #in_feet method" do
95
- 0.meters.in_feet.should == 0
96
- 1.meters.in_feet.round.should == 3
97
- 2.meters.in_feet.round.should == 7
98
- end
99
-
100
- it "should have a #byte method" do
101
- 1.byte.should == 1
102
- 2.bytes.should == 2
103
- end
104
-
105
- it "should have a #kilobyte method" do
106
- 1.kilobyte.should == 1 * 1024**1
107
- 2.kilobytes.should == 2 * 1024**1
108
- end
109
-
110
- it "should have a #megabyte method" do
111
- 1.megabyte.should == 1 * 1024**2
112
- 2.megabytes.should == 2 * 1024**2
113
- end
114
-
115
- it "should have a #gigabyte method" do
116
- 1.gigabyte.should == 1 * 1024**3
117
- 2.gigabytes.should == 2 * 1024**3
118
- end
119
-
120
- it "should have a #terabyte method" do
121
- 1.terabyte.should == 1 * 1024**4
122
- 2.terabytes.should == 2 * 1024**4
123
- end
124
-
125
- it "should have a #petabyte method" do
126
- 1.petabyte.should == 1 * 1024**5
127
- 2.petabytes.should == 2 * 1024**5
128
- end
129
-
130
- it "should have a #exabyte method" do
131
- 1.exabyte.should == 1 * 1024**6
132
- 2.exabytes.should == 2 * 1024**6
133
- end
134
-
135
-
136
3
  it "should have a #string_with_style method" do
137
4
  1000.string_with_style.should == NSNumberFormatter.localizedStringFromNumber(1000, numberStyle:NSNumberFormatterDecimalStyle)
138
5
  1000.string_with_style(:decimal).should == NSNumberFormatter.localizedStringFromNumber(1000, numberStyle:NSNumberFormatterDecimalStyle)
139
6
  1000.string_with_style(:currency).should == NSNumberFormatter.localizedStringFromNumber(1000, numberStyle:NSNumberFormatterCurrencyStyle)
140
7
  end
141
8
 
142
- it 'should have a #to_bool method' do
143
- 0.to_bool.should == false
144
- 1.to_bool.should == true
145
- end
146
9
  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: 3.0.2
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin T.A. Gray
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-12-12 00:00:00.000000000 Z
14
+ date: 2014-12-18 00:00:00.000000000 Z
15
15
  dependencies: []
16
16
  description: |
17
17
  == Description
@@ -217,6 +217,7 @@ files:
217
217
  - lib/version.rb
218
218
  - README.md
219
219
  - spec/all/anonymous_spec.rb
220
+ - spec/all/numeric_spec.rb
220
221
  - spec/cocoa/caanimation_spec.rb
221
222
  - spec/cocoa/calayer_spec.rb
222
223
  - spec/cocoa/nsarray_files_spec.rb
@@ -316,6 +317,7 @@ summary: Extensions for Ruby to make Rubymotion development more enjoyable, and
316
317
  more rubyesque!
317
318
  test_files:
318
319
  - spec/all/anonymous_spec.rb
320
+ - spec/all/numeric_spec.rb
319
321
  - spec/cocoa/caanimation_spec.rb
320
322
  - spec/cocoa/calayer_spec.rb
321
323
  - spec/cocoa/nsarray_files_spec.rb