skates 0.2.6 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/Rakefile +3 -2
  2. data/lib/skates.rb +1 -1
  3. data/lib/skates/ext/array.rb +21 -0
  4. metadata +6 -6
data/Rakefile CHANGED
@@ -12,13 +12,14 @@ begin
12
12
 
13
13
  gem.add_dependency('eventmachine', ">= 0.12.10")
14
14
  gem.add_dependency('log4r')
15
- gem.add_dependency('superfeedr-nokogiri', ">= 1.4.0")
15
+ gem.add_dependency('nokogiri', ">= 1.4.1")
16
16
  gem.add_dependency('superfeedr-sax-machine', ">= 0.0.22")
17
17
  gem.add_dependency('templater')
18
- gem.requirements = ["eventmachine", "yaml", "fileutils", "log4r", "superfeedr-nokogiri", "superfeedr-sax-machine", "templater", "optparse", "digest/sha1", "base64", "resolv", "activesupport"]
18
+ gem.requirements = ["eventmachine", "yaml", "fileutils", "log4r", "nokogiri", "superfeedr-sax-machine", "templater", "optparse", "digest/sha1", "base64", "resolv"]
19
19
  gem.executables = "skates"
20
20
  gem.files = [ "bin/skates",
21
21
  "lib/skates.rb",
22
+ "lib/skates/ext/array.rb",
22
23
  "lib/skates/base/controller.rb",
23
24
  "lib/skates/base/view.rb",
24
25
  "lib/skates/base/stanza.rb",
data/lib/skates.rb CHANGED
@@ -3,7 +3,6 @@ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname
3
3
 
4
4
  require 'eventmachine'
5
5
  require 'log4r'
6
- require 'activesupport'
7
6
  require 'nokogiri'
8
7
  require 'yaml'
9
8
  require 'fileutils'
@@ -14,6 +13,7 @@ require 'resolv'
14
13
  require 'templater'
15
14
  require 'cgi'
16
15
 
16
+ require 'skates/ext/array.rb'
17
17
  require 'skates/xmpp_connection'
18
18
  require 'skates/xmpp_parser'
19
19
  require 'skates/component_connection'
@@ -0,0 +1,21 @@
1
+ class Array
2
+ def in_groups_of(number, fill_with = nil)
3
+ if fill_with == false
4
+ collection = self
5
+ else
6
+ # size % number gives how many extra we have;
7
+ # subtracting from number gives how many to add;
8
+ # modulo number ensures we don't add group of just fill.
9
+ padding = (number - size % number) % number
10
+ collection = dup.concat([fill_with] * padding)
11
+ end
12
+
13
+ if block_given?
14
+ collection.each_slice(number) { |slice| yield(slice) }
15
+ else
16
+ returning [] do |groups|
17
+ collection.each_slice(number) { |group| groups << group }
18
+ end
19
+ end
20
+ end
21
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - julien Genestoux
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-21 00:00:00 -08:00
12
+ date: 2010-01-23 00:00:00 +01:00
13
13
  default_executable: skates
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -33,14 +33,14 @@ dependencies:
33
33
  version: "0"
34
34
  version:
35
35
  - !ruby/object:Gem::Dependency
36
- name: superfeedr-nokogiri
36
+ name: nokogiri
37
37
  type: :runtime
38
38
  version_requirement:
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 1.4.0
43
+ version: 1.4.1
44
44
  version:
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: superfeedr-sax-machine
@@ -82,6 +82,7 @@ files:
82
82
  - lib/skates/base/view.rb
83
83
  - lib/skates/client_connection.rb
84
84
  - lib/skates/component_connection.rb
85
+ - lib/skates/ext/array.rb
85
86
  - lib/skates/generator.rb
86
87
  - lib/skates/router.rb
87
88
  - lib/skates/router/dsl.rb
@@ -127,14 +128,13 @@ requirements:
127
128
  - yaml
128
129
  - fileutils
129
130
  - log4r
130
- - superfeedr-nokogiri
131
+ - nokogiri
131
132
  - superfeedr-sax-machine
132
133
  - templater
133
134
  - optparse
134
135
  - digest/sha1
135
136
  - base64
136
137
  - resolv
137
- - activesupport
138
138
  rubyforge_project: skates
139
139
  rubygems_version: 1.3.5
140
140
  signing_key: