cornerstone-source 0.1.5 → 0.1.6
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.
- data/Gemfile +1 -2
- data/Rakefile +0 -6
- data/cornerstone-source.gemspec +5 -11
- data/lib/cornerstone-source/sprockets.rb +1 -1
- data/lib/cornerstone-source/version.rb +1 -1
- data/source/{javascripts/_cornerstone/_object_extensions.js.coffee → _object_extensions.js.coffee} +0 -0
- data/source/{javascripts/_cornerstone/array_extensions.js.coffee → array_extensions.js.coffee} +28 -26
- data/source/{javascripts/_cornerstone/bindable.js.coffee → bindable.js.coffee} +0 -0
- data/source/{javascripts/_cornerstone/command_stack.js.coffee → command_stack.js.coffee} +0 -0
- data/source/{javascripts/_cornerstone/core_object.js.coffee → core_object.js.coffee} +0 -0
- data/source/{javascripts/_cornerstone/function_extensions.js.coffee → function_extensions.js.coffee} +0 -0
- data/source/{javascripts/_cornerstone/logging.js.coffee → logging.js.coffee} +0 -0
- data/source/{javascripts/_cornerstone/matrix.js.coffee → matrix.js.coffee} +0 -0
- data/source/{javascripts/_cornerstone/number_extensions.js.coffee → number_extensions.js.coffee} +0 -0
- data/source/{javascripts/_cornerstone/point.js.coffee → point.js.coffee} +0 -0
- data/source/{javascripts/_cornerstone/random.js.coffee → random.js.coffee} +0 -0
- data/source/{javascripts/_cornerstone/rectangle.js.coffee → rectangle.js.coffee} +0 -0
- data/source/{javascripts/_cornerstone/string_extensions.js.coffee → string_extensions.js.coffee} +3 -0
- data/source/{javascripts/_cornerstone/uuid.js → uuid.js} +0 -0
- data/{source/javascripts/_test → test}/array_extensions.coffee +0 -0
- data/{source/javascripts/_test → test}/bindable.coffee +0 -0
- data/{source/javascripts/_test → test}/command_stack.coffee +0 -0
- data/{source/javascripts/_test → test}/core_object.coffee +0 -0
- data/{source/javascripts/_test → test}/function_extensions.coffee +0 -0
- data/{source/javascripts/_test → test}/logging.coffee +0 -0
- data/{source/javascripts/_test → test}/matrix.coffee +0 -0
- data/{source/javascripts/_test → test}/number_extensions.coffee +0 -0
- data/{source/javascripts/_test → test}/object_extensions.coffee +0 -0
- data/{source/javascripts/_test → test}/point.coffee +0 -0
- data/{source/javascripts/_test → test}/random.coffee +0 -0
- data/{source/javascripts/_test → test}/rectangle.coffee +0 -0
- data/{source/javascripts/_test → test}/string_extensions.coffee +10 -0
- metadata +37 -113
- data/config.rb +0 -79
- data/config.ru +0 -4
- data/doc_scraper.rb +0 -51
- data/game.js +0 -4295
- data/lib/assets/javascripts/cornerstone.js +0 -4722
- data/manifest.json +0 -15
- data/pixie.json +0 -12
- data/source/javascripts/_cornerstone/stubs.js.coffee +0 -1042
- data/source/javascripts/cornerstone.js.coffee +0 -1
- data/source/javascripts/cornerstone_tests.js.coffee +0 -2
- data/source/test.html.haml +0 -13
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/cornerstone-source.gemspec
CHANGED
@@ -2,22 +2,16 @@
|
|
2
2
|
require File.expand_path('../lib/cornerstone-source/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
+
gem.name = "cornerstone-source"
|
6
|
+
gem.version = Cornerstone::Source::VERSION
|
5
7
|
gem.authors = ["Matt Diebolt", "Daniel X. Moore"]
|
6
8
|
gem.email = ["pixie@pixieengine.com"]
|
7
|
-
gem.description = %q{Cornerstone provides a solid foundation for working with JavaScript. It aggressively shivs many of the core classes.}
|
8
|
-
gem.summary = %q{A solid foundation for JavaScript}
|
9
9
|
gem.homepage = "https://github.com/PixieEngine/Cornerstone"
|
10
|
+
gem.summary = %q{A solid foundation for JavaScript}
|
11
|
+
gem.description = %q{Cornerstone provides a solid foundation for working with JavaScript. It aggressively shivs many of the core classes.}
|
10
12
|
|
11
|
-
gem.files = `git ls-files`.split(
|
12
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
-
gem.name = "cornerstone-source"
|
13
|
+
gem.files = `git ls-files`.split("\n")
|
15
14
|
gem.require_paths = ["lib"]
|
16
|
-
gem.version = Cornerstone::Source::VERSION
|
17
15
|
|
18
|
-
gem.add_development_dependency "middleman", "3.0.0.beta.3"
|
19
|
-
gem.add_development_dependency "rb-inotify"
|
20
|
-
gem.add_development_dependency "sass"
|
21
|
-
gem.add_development_dependency "therubyracer"
|
22
16
|
gem.add_development_dependency "rake"
|
23
17
|
end
|
@@ -1,2 +1,2 @@
|
|
1
1
|
root_dir = File.expand_path(File.dirname(File.dirname(File.dirname(__FILE__))))
|
2
|
-
Sprockets.paths << File.join(root_dir, "
|
2
|
+
Sprockets.paths << File.join(root_dir, "source")
|
data/source/{javascripts/_cornerstone/_object_extensions.js.coffee → _object_extensions.js.coffee}
RENAMED
File without changes
|
data/source/{javascripts/_cornerstone/array_extensions.js.coffee → array_extensions.js.coffee}
RENAMED
@@ -32,11 +32,11 @@ the same objects.
|
|
32
32
|
|
33
33
|
a = ["a", "b", "c"]
|
34
34
|
b = a.copy()
|
35
|
-
|
35
|
+
|
36
36
|
# their elements are equal
|
37
37
|
a[0] == b[0] && a[1] == b[1] && a[2] == b[2]
|
38
38
|
# => true
|
39
|
-
|
39
|
+
|
40
40
|
# but they aren't the same object in memory
|
41
41
|
a === b
|
42
42
|
# => false
|
@@ -70,7 +70,7 @@ Flatten out an array of arrays into a single array of elements.
|
|
70
70
|
|
71
71
|
[[1, 2], [3, 4], 5].flatten()
|
72
72
|
# => [1, 2, 3, 4, 5]
|
73
|
-
|
73
|
+
|
74
74
|
# won't flatten twice nested arrays. call
|
75
75
|
# flatten twice if that is what you want
|
76
76
|
[[1, 2], [3, [4, 5]], 6].flatten()
|
@@ -90,7 +90,7 @@ and return a new array containing the results of the invocation.
|
|
90
90
|
|
91
91
|
[1.1, 2.2, 3.3, 4.4].invoke("floor")
|
92
92
|
# => [1, 2, 3, 4]
|
93
|
-
|
93
|
+
|
94
94
|
['hello', 'world', 'cool!'].invoke('substring', 0, 3)
|
95
95
|
# => ['hel', 'wor', 'coo']
|
96
96
|
|
@@ -124,7 +124,7 @@ present. The array is modified in place.
|
|
124
124
|
a = [1, 1, "a", "b"]
|
125
125
|
a.remove(1)
|
126
126
|
# => 1
|
127
|
-
|
127
|
+
|
128
128
|
a
|
129
129
|
# => [1, "a", "b"]
|
130
130
|
|
@@ -146,7 +146,7 @@ Returns true if the element is present in the array.
|
|
146
146
|
|
147
147
|
["a", "b", "c"].include("c")
|
148
148
|
# => true
|
149
|
-
|
149
|
+
|
150
150
|
[40, "a"].include(700)
|
151
151
|
# => false
|
152
152
|
|
@@ -160,7 +160,7 @@ Array::include = (element) ->
|
|
160
160
|
|
161
161
|
###*
|
162
162
|
Call the given iterator once for each element in the array,
|
163
|
-
passing in the element as the first argument, the index of
|
163
|
+
passing in the element as the first argument, the index of
|
164
164
|
the element as the second argument, and <code>this</code> array as the
|
165
165
|
third argument.
|
166
166
|
|
@@ -169,12 +169,12 @@ third argument.
|
|
169
169
|
["r", "a", "d"].each (letter, index) ->
|
170
170
|
word += letter
|
171
171
|
indices.push(index)
|
172
|
-
|
172
|
+
|
173
173
|
# => ["r", "a", "d"]
|
174
|
-
|
174
|
+
|
175
175
|
word
|
176
176
|
# => "rad"
|
177
|
-
|
177
|
+
|
178
178
|
indices
|
179
179
|
# => [0, 1, 2]
|
180
180
|
|
@@ -194,8 +194,8 @@ Array::each = (iterator, context) ->
|
|
194
194
|
return this
|
195
195
|
|
196
196
|
###*
|
197
|
-
Call the given iterator once for each element in the array,
|
198
|
-
passing in the element as the first argument, the index of
|
197
|
+
Call the given iterator once for each element in the array,
|
198
|
+
passing in the element as the first argument, the index of
|
199
199
|
the element as the second argument, and `this` array as the
|
200
200
|
third argument.
|
201
201
|
|
@@ -276,7 +276,7 @@ passed as in each.
|
|
276
276
|
[1, 2, 3, 4].eachSlice 2, (slice) ->
|
277
277
|
results.push(slice)
|
278
278
|
# => [1, 2, 3, 4]
|
279
|
-
|
279
|
+
|
280
280
|
results
|
281
281
|
# => [[1, 2], [3, 4]]
|
282
282
|
|
@@ -321,10 +321,10 @@ Array::pipeline = (input) ->
|
|
321
321
|
Returns a new array with the elements all shuffled up.
|
322
322
|
|
323
323
|
a = [1, 2, 3]
|
324
|
-
|
324
|
+
|
325
325
|
a.shuffle()
|
326
326
|
# => [2, 3, 1]
|
327
|
-
|
327
|
+
|
328
328
|
a # => [1, 2, 3]
|
329
329
|
|
330
330
|
@name shuffle
|
@@ -375,7 +375,7 @@ Returns an object containing the extremes of this array.
|
|
375
375
|
@methodOf Array#
|
376
376
|
@param {Function} [fn] An optional funtion used to evaluate each element to calculate its value for determining extremes.
|
377
377
|
@returns {Object} {min: minElement, max: maxElement}
|
378
|
-
###
|
378
|
+
###
|
379
379
|
Array::extremes = (fn) ->
|
380
380
|
fn ||= (n) -> n
|
381
381
|
|
@@ -405,16 +405,16 @@ Array::extremes = (fn) ->
|
|
405
405
|
max: max
|
406
406
|
|
407
407
|
###*
|
408
|
-
Pretend the array is a circle and grab a new array containing length elements.
|
409
|
-
If length is not given return the element at start, again assuming the array
|
408
|
+
Pretend the array is a circle and grab a new array containing length elements.
|
409
|
+
If length is not given return the element at start, again assuming the array
|
410
410
|
is a circle.
|
411
411
|
|
412
412
|
[1, 2, 3].wrap(-1)
|
413
413
|
# => 3
|
414
|
-
|
414
|
+
|
415
415
|
[1, 2, 3].wrap(6)
|
416
416
|
# => 1
|
417
|
-
|
417
|
+
|
418
418
|
["l", "o", "o", "p"].wrap(0, 16)
|
419
419
|
# => ["l", "o", "o", "p", "l", "o", "o", "p", "l", "o", "o", "p", "l", "o", "o", "p"]
|
420
420
|
|
@@ -430,11 +430,13 @@ Array::wrap = (start, length) ->
|
|
430
430
|
i = start
|
431
431
|
result = []
|
432
432
|
|
433
|
-
|
433
|
+
while i < end
|
434
|
+
result.push(@[i.mod(@length)])
|
435
|
+
i += 1
|
434
436
|
|
435
437
|
return result
|
436
438
|
else
|
437
|
-
return
|
439
|
+
return @[start.mod(@length)]
|
438
440
|
|
439
441
|
###*
|
440
442
|
Partitions the elements into two groups: those for which the iterator returns
|
@@ -442,10 +444,10 @@ true, and those for which it returns false.
|
|
442
444
|
|
443
445
|
[evens, odds] = [1, 2, 3, 4].partition (n) ->
|
444
446
|
n.even()
|
445
|
-
|
447
|
+
|
446
448
|
evens
|
447
449
|
# => [2, 4]
|
448
|
-
|
450
|
+
|
449
451
|
odds
|
450
452
|
# => [1, 3]
|
451
453
|
|
@@ -508,7 +510,7 @@ Array::reject = (iterator, context) ->
|
|
508
510
|
|
509
511
|
###*
|
510
512
|
Combines all elements of the array by applying a binary operation.
|
511
|
-
for each element in the arra the iterator is passed an accumulator
|
513
|
+
for each element in the arra the iterator is passed an accumulator
|
512
514
|
value (memo) and the element.
|
513
515
|
|
514
516
|
@name inject
|
@@ -560,7 +562,7 @@ Merges together the values of each of the arrays with the values at the correspo
|
|
560
562
|
@returns {Array} Array groupings whose values are arranged by their positions in the original input arrays.
|
561
563
|
###
|
562
564
|
Array::zip = (args...) ->
|
563
|
-
this.map (element, index) ->
|
565
|
+
this.map (element, index) ->
|
564
566
|
output = args.map (arr) ->
|
565
567
|
arr[index]
|
566
568
|
|
File without changes
|
File without changes
|
File without changes
|
data/source/{javascripts/_cornerstone/function_extensions.js.coffee → function_extensions.js.coffee}
RENAMED
File without changes
|
File without changes
|
File without changes
|
data/source/{javascripts/_cornerstone/number_extensions.js.coffee → number_extensions.js.coffee}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -46,6 +46,16 @@ test "#titleize", ->
|
|
46
46
|
equals "man from the boondocks".titleize(), "Man From The Boondocks"
|
47
47
|
equals "x-men: the last stand".titleize(), "X Men: The Last Stand"
|
48
48
|
|
49
|
+
test "#toInt", ->
|
50
|
+
equals "31.3".toInt(), 31
|
51
|
+
equals "31.".toInt(), 31
|
52
|
+
equals "-1.02".toInt(), -1
|
53
|
+
|
54
|
+
equals "009".toInt(), 9
|
55
|
+
equals "0109".toInt(), 109
|
56
|
+
|
57
|
+
equals "F".toInt(16), 15
|
58
|
+
|
49
59
|
test "#underscore", ->
|
50
60
|
equals "Pro-tip".underscore(), "pro_tip"
|
51
61
|
equals "Bullet".underscore(), "bullet"
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cornerstone-source
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
4
|
+
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
8
|
+
- 6
|
9
|
+
version: 0.1.6
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Matt Diebolt
|
@@ -16,82 +15,21 @@ autorequire:
|
|
16
15
|
bindir: bin
|
17
16
|
cert_chain: []
|
18
17
|
|
19
|
-
date:
|
18
|
+
date: 2013-02-16 00:00:00 -06:00
|
19
|
+
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
-
none: false
|
24
|
-
requirements:
|
25
|
-
- - "="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
hash: 3005530751
|
28
|
-
segments:
|
29
|
-
- 3
|
30
|
-
- 0
|
31
|
-
- 0
|
32
|
-
- beta
|
33
|
-
- 3
|
34
|
-
version: 3.0.0.beta.3
|
35
|
-
prerelease: false
|
36
|
-
type: :development
|
37
|
-
name: middleman
|
38
|
-
version_requirements: *id001
|
39
|
-
- !ruby/object:Gem::Dependency
|
40
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ">="
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 3
|
46
|
-
segments:
|
47
|
-
- 0
|
48
|
-
version: "0"
|
49
|
-
prerelease: false
|
50
|
-
type: :development
|
51
|
-
name: rb-inotify
|
52
|
-
version_requirements: *id002
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
-
none: false
|
56
|
-
requirements:
|
57
|
-
- - ">="
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
hash: 3
|
60
|
-
segments:
|
61
|
-
- 0
|
62
|
-
version: "0"
|
63
|
-
prerelease: false
|
64
|
-
type: :development
|
65
|
-
name: sass
|
66
|
-
version_requirements: *id003
|
67
|
-
- !ruby/object:Gem::Dependency
|
68
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
69
|
-
none: false
|
70
|
-
requirements:
|
71
|
-
- - ">="
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
hash: 3
|
74
|
-
segments:
|
75
|
-
- 0
|
76
|
-
version: "0"
|
77
|
-
prerelease: false
|
78
22
|
type: :development
|
79
|
-
|
80
|
-
version_requirements: *id004
|
81
|
-
- !ruby/object:Gem::Dependency
|
82
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
83
|
-
none: false
|
23
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
84
24
|
requirements:
|
85
25
|
- - ">="
|
86
26
|
- !ruby/object:Gem::Version
|
87
|
-
hash: 3
|
88
27
|
segments:
|
89
28
|
- 0
|
90
29
|
version: "0"
|
91
|
-
prerelease: false
|
92
|
-
type: :development
|
93
30
|
name: rake
|
94
|
-
|
31
|
+
requirement: *id001
|
32
|
+
prerelease: false
|
95
33
|
description: Cornerstone provides a solid foundation for working with JavaScript. It aggressively shivs many of the core classes.
|
96
34
|
email:
|
97
35
|
- pixie@pixieengine.com
|
@@ -107,51 +45,41 @@ files:
|
|
107
45
|
- LICENSE
|
108
46
|
- README.md
|
109
47
|
- Rakefile
|
110
|
-
- config.rb
|
111
|
-
- config.ru
|
112
48
|
- cornerstone-source.gemspec
|
113
|
-
- doc_scraper.rb
|
114
|
-
- game.js
|
115
|
-
- lib/assets/javascripts/cornerstone.js
|
116
49
|
- lib/cornerstone-source.rb
|
117
50
|
- lib/cornerstone-source/rails.rb
|
118
51
|
- lib/cornerstone-source/sprockets.rb
|
119
52
|
- lib/cornerstone-source/version.rb
|
120
|
-
-
|
121
|
-
-
|
122
|
-
- source/
|
123
|
-
- source/
|
124
|
-
- source/
|
125
|
-
- source/
|
126
|
-
- source/
|
127
|
-
- source/
|
128
|
-
- source/
|
129
|
-
- source/
|
130
|
-
- source/
|
131
|
-
- source/
|
132
|
-
- source/
|
133
|
-
- source/
|
134
|
-
-
|
135
|
-
-
|
136
|
-
-
|
137
|
-
-
|
138
|
-
-
|
139
|
-
-
|
140
|
-
-
|
141
|
-
-
|
142
|
-
-
|
143
|
-
-
|
144
|
-
-
|
145
|
-
-
|
146
|
-
-
|
147
|
-
- source/javascripts/_test/random.coffee
|
148
|
-
- source/javascripts/_test/rectangle.coffee
|
149
|
-
- source/javascripts/_test/string_extensions.coffee
|
150
|
-
- source/javascripts/cornerstone.js.coffee
|
151
|
-
- source/javascripts/cornerstone_tests.js.coffee
|
152
|
-
- source/test.html.haml
|
53
|
+
- source/_object_extensions.js.coffee
|
54
|
+
- source/array_extensions.js.coffee
|
55
|
+
- source/bindable.js.coffee
|
56
|
+
- source/command_stack.js.coffee
|
57
|
+
- source/core_object.js.coffee
|
58
|
+
- source/function_extensions.js.coffee
|
59
|
+
- source/logging.js.coffee
|
60
|
+
- source/matrix.js.coffee
|
61
|
+
- source/number_extensions.js.coffee
|
62
|
+
- source/point.js.coffee
|
63
|
+
- source/random.js.coffee
|
64
|
+
- source/rectangle.js.coffee
|
65
|
+
- source/string_extensions.js.coffee
|
66
|
+
- source/uuid.js
|
67
|
+
- test/array_extensions.coffee
|
68
|
+
- test/bindable.coffee
|
69
|
+
- test/command_stack.coffee
|
70
|
+
- test/core_object.coffee
|
71
|
+
- test/function_extensions.coffee
|
72
|
+
- test/logging.coffee
|
73
|
+
- test/matrix.coffee
|
74
|
+
- test/number_extensions.coffee
|
75
|
+
- test/object_extensions.coffee
|
76
|
+
- test/point.coffee
|
77
|
+
- test/random.coffee
|
78
|
+
- test/rectangle.coffee
|
79
|
+
- test/string_extensions.coffee
|
153
80
|
- vendor/javascripts/qunit.js
|
154
81
|
- vendor/stylesheets/qunit.css.sass
|
82
|
+
has_rdoc: true
|
155
83
|
homepage: https://github.com/PixieEngine/Cornerstone
|
156
84
|
licenses: []
|
157
85
|
|
@@ -161,27 +89,23 @@ rdoc_options: []
|
|
161
89
|
require_paths:
|
162
90
|
- lib
|
163
91
|
required_ruby_version: !ruby/object:Gem::Requirement
|
164
|
-
none: false
|
165
92
|
requirements:
|
166
93
|
- - ">="
|
167
94
|
- !ruby/object:Gem::Version
|
168
|
-
hash: 3
|
169
95
|
segments:
|
170
96
|
- 0
|
171
97
|
version: "0"
|
172
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
173
|
-
none: false
|
174
99
|
requirements:
|
175
100
|
- - ">="
|
176
101
|
- !ruby/object:Gem::Version
|
177
|
-
hash: 3
|
178
102
|
segments:
|
179
103
|
- 0
|
180
104
|
version: "0"
|
181
105
|
requirements: []
|
182
106
|
|
183
107
|
rubyforge_project:
|
184
|
-
rubygems_version: 1.
|
108
|
+
rubygems_version: 1.3.6
|
185
109
|
signing_key:
|
186
110
|
specification_version: 3
|
187
111
|
summary: A solid foundation for JavaScript
|