bicycle 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/Gemfile.lock +4 -0
- data/VERSION +1 -1
- data/bicycle.gemspec +6 -3
- data/lib/bicycle.rb +2 -2
- data/test/helper.rb +1 -0
- data/test/test_bicycle.rb +8 -8
- metadata +111 -89
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
+
ansi (1.4.2)
|
4
5
|
git (1.2.5)
|
5
6
|
jeweler (1.6.4)
|
6
7
|
bundler (~> 1.0)
|
@@ -13,6 +14,8 @@ GEM
|
|
13
14
|
multi_json (~> 1.0)
|
14
15
|
simplecov-html (~> 0.5.3)
|
15
16
|
simplecov-html (0.5.3)
|
17
|
+
turn (0.9.5)
|
18
|
+
ansi
|
16
19
|
yard (0.6.8)
|
17
20
|
|
18
21
|
PLATFORMS
|
@@ -23,4 +26,5 @@ DEPENDENCIES
|
|
23
26
|
jeweler (~> 1.6.4)
|
24
27
|
minitest
|
25
28
|
simplecov
|
29
|
+
turn (~> 0.9.5)
|
26
30
|
yard (~> 0.6.0)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.1
|
data/bicycle.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "bicycle"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Stuart Chinery"]
|
12
|
-
s.date = "2012-06-
|
12
|
+
s.date = "2012-06-06"
|
13
13
|
s.description = "A conveniance gem for cycling through a set of values, much like the 'cycle' functionality found in Rails, but is independant of which framework you use so will run in Sinatra, Padrino or straight up Ruby itself."
|
14
14
|
s.email = "sleepingstu@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.homepage = "http://github.com/sleepingstu/bicycle"
|
33
33
|
s.licenses = ["MIT"]
|
34
34
|
s.require_paths = ["lib"]
|
35
|
-
s.rubygems_version = "1.8.
|
35
|
+
s.rubygems_version = "1.8.19"
|
36
36
|
s.summary = "Why walk when you can cycle"
|
37
37
|
|
38
38
|
if s.respond_to? :specification_version then
|
@@ -44,12 +44,14 @@ Gem::Specification.new do |s|
|
|
44
44
|
s.add_development_dependency(%q<bundler>, [">= 0"])
|
45
45
|
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
46
46
|
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
47
|
+
s.add_development_dependency(%q<turn>, ["~> 0.9.5"])
|
47
48
|
else
|
48
49
|
s.add_dependency(%q<minitest>, [">= 0"])
|
49
50
|
s.add_dependency(%q<yard>, ["~> 0.6.0"])
|
50
51
|
s.add_dependency(%q<bundler>, [">= 0"])
|
51
52
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
52
53
|
s.add_dependency(%q<simplecov>, [">= 0"])
|
54
|
+
s.add_dependency(%q<turn>, ["~> 0.9.5"])
|
53
55
|
end
|
54
56
|
else
|
55
57
|
s.add_dependency(%q<minitest>, [">= 0"])
|
@@ -57,6 +59,7 @@ Gem::Specification.new do |s|
|
|
57
59
|
s.add_dependency(%q<bundler>, [">= 0"])
|
58
60
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
59
61
|
s.add_dependency(%q<simplecov>, [">= 0"])
|
62
|
+
s.add_dependency(%q<turn>, ["~> 0.9.5"])
|
60
63
|
end
|
61
64
|
end
|
62
65
|
|
data/lib/bicycle.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Bicycle
|
2
2
|
|
3
|
-
# Function to return a single value from an array of
|
3
|
+
# Function to return a single value from an array of
|
4
4
|
# given values that you want to cycle through.
|
5
|
-
# @param [Array] values to cycle through
|
5
|
+
# @param [Array] *to_cycle - values to cycle through
|
6
6
|
# @return [?] one of the values in a given order
|
7
7
|
def self.cycle(*to_cycle)
|
8
8
|
return to_cycle[@_cycle = ((@_cycle || -1) + 1) % to_cycle.count]
|
data/test/helper.rb
CHANGED
data/test/test_bicycle.rb
CHANGED
@@ -2,16 +2,16 @@ require 'helper'
|
|
2
2
|
|
3
3
|
describe "When cycling" do
|
4
4
|
before do
|
5
|
-
@
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
@values = []
|
6
|
+
for i in (0..3)
|
7
|
+
@values[i] = Bicycle.cycle("Foo", "Bar", "Huh?")
|
8
|
+
end
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should return a value in the cycle order" do
|
12
|
-
assert_equal "Foo", @
|
13
|
-
assert_equal "Bar", @
|
14
|
-
assert_equal "Huh?", @
|
15
|
-
assert_equal "Foo", @
|
12
|
+
assert_equal "Foo", @values[0]
|
13
|
+
assert_equal "Bar", @values[1]
|
14
|
+
assert_equal "Huh?", @values[2]
|
15
|
+
assert_equal "Foo", @values[3]
|
16
16
|
end
|
17
17
|
end
|
metadata
CHANGED
@@ -1,106 +1,122 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: bicycle
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Stuart Chinery
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
17
|
+
|
18
|
+
date: 2012-06-06 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
22
21
|
type: :development
|
23
|
-
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
23
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 3
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
version: "0"
|
31
|
+
version_requirements: *id001
|
32
|
+
name: minitest
|
33
|
+
prerelease: false
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
type: :development
|
36
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
33
37
|
none: false
|
34
|
-
requirements:
|
38
|
+
requirements:
|
35
39
|
- - ~>
|
36
|
-
- !ruby/object:Gem::Version
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
hash: 7
|
42
|
+
segments:
|
43
|
+
- 0
|
44
|
+
- 6
|
45
|
+
- 0
|
37
46
|
version: 0.6.0
|
38
|
-
|
47
|
+
version_requirements: *id002
|
48
|
+
name: yard
|
39
49
|
prerelease: false
|
40
|
-
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
type: :development
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
53
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
61
|
+
version_requirements: *id003
|
47
62
|
name: bundler
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ! '>='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
54
|
-
type: :development
|
55
63
|
prerelease: false
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
- - ! '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: jeweler
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
+
- !ruby/object:Gem::Dependency
|
65
|
+
type: :development
|
66
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
65
67
|
none: false
|
66
|
-
requirements:
|
68
|
+
requirements:
|
67
69
|
- - ~>
|
68
|
-
- !ruby/object:Gem::Version
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 7
|
72
|
+
segments:
|
73
|
+
- 1
|
74
|
+
- 6
|
75
|
+
- 4
|
69
76
|
version: 1.6.4
|
70
|
-
|
77
|
+
version_requirements: *id004
|
78
|
+
name: jeweler
|
71
79
|
prerelease: false
|
72
|
-
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
type: :development
|
82
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
73
83
|
none: false
|
74
|
-
requirements:
|
75
|
-
- -
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
|
78
|
-
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
hash: 3
|
88
|
+
segments:
|
89
|
+
- 0
|
90
|
+
version: "0"
|
91
|
+
version_requirements: *id005
|
79
92
|
name: simplecov
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
|
-
requirements:
|
83
|
-
- - ! '>='
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: '0'
|
86
|
-
type: :development
|
87
93
|
prerelease: false
|
88
|
-
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
type: :development
|
96
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
89
97
|
none: false
|
90
|
-
requirements:
|
91
|
-
- -
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
98
|
+
requirements:
|
99
|
+
- - ~>
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
hash: 49
|
102
|
+
segments:
|
103
|
+
- 0
|
104
|
+
- 9
|
105
|
+
- 5
|
106
|
+
version: 0.9.5
|
107
|
+
version_requirements: *id006
|
108
|
+
name: turn
|
109
|
+
prerelease: false
|
110
|
+
description: A conveniance gem for cycling through a set of values, much like the 'cycle' functionality found in Rails, but is independant of which framework you use so will run in Sinatra, Padrino or straight up Ruby itself.
|
97
111
|
email: sleepingstu@gmail.com
|
98
112
|
executables: []
|
113
|
+
|
99
114
|
extensions: []
|
100
|
-
|
115
|
+
|
116
|
+
extra_rdoc_files:
|
101
117
|
- LICENSE.txt
|
102
118
|
- README.md
|
103
|
-
files:
|
119
|
+
files:
|
104
120
|
- .document
|
105
121
|
- Gemfile
|
106
122
|
- Gemfile.lock
|
@@ -113,31 +129,37 @@ files:
|
|
113
129
|
- test/helper.rb
|
114
130
|
- test/test_bicycle.rb
|
115
131
|
homepage: http://github.com/sleepingstu/bicycle
|
116
|
-
licenses:
|
132
|
+
licenses:
|
117
133
|
- MIT
|
118
134
|
post_install_message:
|
119
135
|
rdoc_options: []
|
120
|
-
|
136
|
+
|
137
|
+
require_paths:
|
121
138
|
- lib
|
122
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
139
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
123
140
|
none: false
|
124
|
-
requirements:
|
125
|
-
- -
|
126
|
-
- !ruby/object:Gem::Version
|
127
|
-
|
128
|
-
segments:
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
hash: 3
|
145
|
+
segments:
|
129
146
|
- 0
|
130
|
-
|
131
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
147
|
+
version: "0"
|
148
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
149
|
none: false
|
133
|
-
requirements:
|
134
|
-
- -
|
135
|
-
- !ruby/object:Gem::Version
|
136
|
-
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
hash: 3
|
154
|
+
segments:
|
155
|
+
- 0
|
156
|
+
version: "0"
|
137
157
|
requirements: []
|
158
|
+
|
138
159
|
rubyforge_project:
|
139
|
-
rubygems_version: 1.8.
|
160
|
+
rubygems_version: 1.8.19
|
140
161
|
signing_key:
|
141
162
|
specification_version: 3
|
142
163
|
summary: Why walk when you can cycle
|
143
164
|
test_files: []
|
165
|
+
|