LPP_alu0100966589 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,35 @@
1
+ # Open the Array class
2
+ class Array
3
+
4
+ # Returns the array sorted
5
+ # @return [Array] the array sorted
6
+ def sort_for
7
+ # Deep copy
8
+ r = Marshal.load(Marshal.dump(self))
9
+ for i in (0...r.length)
10
+ for j in (0...(r.length-i-1))
11
+ r[j], r[j+1] = r[j+1], r[j] if(r[j] > r[j+1])
12
+ end
13
+ end
14
+
15
+ return r
16
+ end
17
+
18
+ # Returns the array sorted
19
+ # @return [Array] the array sorted
20
+ def sort_each
21
+ # Deep copy
22
+ aux = Marshal.load(Marshal.dump(self))
23
+ result = []
24
+
25
+ # Each iteration finds the minimun from aux,
26
+ # deletes it and add it to result
27
+ self.length.times do |i|
28
+ m = aux.each_with_index.min
29
+ aux.delete_at(m[1])
30
+ result << m[0]
31
+ end
32
+
33
+ return result
34
+ end
35
+ end
@@ -0,0 +1,3 @@
1
+ module TDD
2
+ VERSION = "0.1.1"
3
+ end
metadata ADDED
@@ -0,0 +1,203 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: LPP_alu0100966589
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Carlos Domínguez García
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-12-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.15'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.15'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: guard
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: guard-rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: guard-bundler
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: yard
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: coveralls
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description: To practise TDD we will code a class that handle food nutrients
126
+ email:
127
+ - alu0100966589@ull.edu.es
128
+ executables: []
129
+ extensions: []
130
+ extra_rdoc_files: []
131
+ files:
132
+ - ".coveralls.yml"
133
+ - ".gitignore"
134
+ - ".rspec"
135
+ - ".travis.yml"
136
+ - Gemfile
137
+ - Guardfile
138
+ - LICENSE.txt
139
+ - README.md
140
+ - Rakefile
141
+ - TDD.gemspec
142
+ - bin/console
143
+ - bin/setup
144
+ - docs/Array.html
145
+ - docs/CarbohydrateRich.html
146
+ - docs/Dll.html
147
+ - docs/DllNode.html
148
+ - docs/EggMilkAndDerivatives.html
149
+ - docs/Fish.html
150
+ - docs/Food.html
151
+ - docs/Fruits.html
152
+ - docs/MeatAndDerivatives.html
153
+ - docs/OilsAndSweets.html
154
+ - docs/TDD.html
155
+ - docs/Vegetables.html
156
+ - docs/_index.html
157
+ - docs/class_list.html
158
+ - docs/css/common.css
159
+ - docs/css/full_list.css
160
+ - docs/css/style.css
161
+ - docs/file.README.html
162
+ - docs/file_list.html
163
+ - docs/frames.html
164
+ - docs/index.html
165
+ - docs/js/app.js
166
+ - docs/js/full_list.js
167
+ - docs/js/jquery.js
168
+ - docs/method_list.html
169
+ - docs/top-level-namespace.html
170
+ - lib/TDD.rb
171
+ - lib/TDD/Dll.rb
172
+ - lib/TDD/DllNode.rb
173
+ - lib/TDD/Food.rb
174
+ - lib/TDD/FoodPyramidClasses.rb
175
+ - lib/TDD/Plate.rb
176
+ - lib/TDD/sort.rb
177
+ - lib/TDD/version.rb
178
+ homepage: ''
179
+ licenses:
180
+ - MIT
181
+ metadata:
182
+ allowed_push_host: https://rubygems.org
183
+ post_install_message:
184
+ rdoc_options: []
185
+ require_paths:
186
+ - lib
187
+ required_ruby_version: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - ">="
190
+ - !ruby/object:Gem::Version
191
+ version: '0'
192
+ required_rubygems_version: !ruby/object:Gem::Requirement
193
+ requirements:
194
+ - - ">="
195
+ - !ruby/object:Gem::Version
196
+ version: '0'
197
+ requirements: []
198
+ rubyforge_project:
199
+ rubygems_version: 2.5.1
200
+ signing_key:
201
+ specification_version: 4
202
+ summary: Task for college subject. The goal is to get familiar with Test Driven Development
203
+ test_files: []