ruborithms 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3cf3cbce1d2265a02d1f863a0c9a2f6e2f179fe0
4
+ data.tar.gz: 5d940be77faed6cc6d725ef98a35146c4a3703de
5
+ SHA512:
6
+ metadata.gz: fa6295b1684b423516001f26d552cfab81effa7263a3ebccb3a5f395b67fc443b687a0f0f602ea3dfc132d6697cd08090afc70d14fa43ce20e29b05b32aab256
7
+ data.tar.gz: 714c3d5bb38d872038b355ac52f5520e364eefc4227875c80ed7353e0f729afe3f45942d1603c69661a89232df54da5e1c0a72c61cd1c9c485bcac3e9d19ce3c
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ *gem
data/lib/ruborithms.rb ADDED
@@ -0,0 +1,5 @@
1
+ require 'ruborithms/version'
2
+ require 'ruborithms/algorithms/linear_search'
3
+
4
+ module Ruborithms
5
+ end
@@ -0,0 +1,24 @@
1
+ module Ruborithms
2
+ module Algorithms
3
+ module LinearSearch
4
+ class << self
5
+ def included(mod)
6
+ mod.extend(ClassMethods)
7
+ end
8
+
9
+ end
10
+
11
+ module ClassMethods
12
+ def linear_search(object, value)
13
+ object.each_with_index do |item, index|
14
+ return index if value == item
15
+ end
16
+ end
17
+ end
18
+
19
+ def linear_search(value)
20
+ self.class.linear_search(self, value)
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,3 @@
1
+ module Ruborithms
2
+ VERSION = '0.1.0'
3
+ end
metadata ADDED
@@ -0,0 +1,61 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruborithms
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ivan Zinovyev
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-04-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.5'
27
+ description: Algorithms and data structures built with Ruby
28
+ email: vanyazin@gmail.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - ".gitignore"
34
+ - lib/ruborithms.rb
35
+ - lib/ruborithms/algorithms/linear_search.rb
36
+ - lib/ruborithms/version.rb
37
+ homepage: https://github.com/zinovyev/ruborithms
38
+ licenses:
39
+ - MIT
40
+ metadata: {}
41
+ post_install_message:
42
+ rdoc_options: []
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ requirements: []
56
+ rubyforge_project:
57
+ rubygems_version: 2.6.8
58
+ signing_key:
59
+ specification_version: 4
60
+ summary: Algorithms and data structures built with Ruby
61
+ test_files: []