divisible 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ pkg/*
2
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source :gemcutter
2
+
3
+ # Specify your gem's dependencies in divisible.gemspec
4
+ gemspec
@@ -0,0 +1,28 @@
1
+ = Divisible
2
+
3
+ Divisible is a Ruby gem useful in case you need to find out if one number is divisible by another
4
+
5
+ == Examples
6
+
7
+ 9.divisible_by(3) # => true
8
+ 10.divisible_by(3) # => false
9
+ 12.divisible_by(3) # => true
10
+ 12.divisible_by(4) # => true
11
+ 15.divisible_by(4) # => false
12
+
13
+ Same can be done with
14
+
15
+ Divisible.check(9, 3) # => true
16
+ Divisible.check(10, 3) # => false
17
+ Divisible.check(12, 3) # => true
18
+ Divisible.check(12, 4) # => true
19
+ Divisible.check(15, 4) # => false
20
+
21
+ == Install
22
+
23
+ gem install divisible
24
+
25
+ == Licence
26
+
27
+ Copyright (c) 2011 Vlado Cingel, released under the MIT license
28
+
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
3
+ require 'divisible/version'
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "divisible"
7
+ s.version = Divisible::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Vlado Cingel"]
10
+ s.email = ["vlado@cingel.hr"]
11
+ s.homepage = "http://rubygems.org/gems/divisible"
12
+ s.summary = "Useful to find out if one number is divisible by another"
13
+ s.description = "Useful to find out if one number is divisible by another 9.divisible_by(3) will return true, and 10.divisible_by(3) will return false"
14
+
15
+ s.required_rubygems_version = ">= 1.3.6"
16
+ s.rubyforge_project = "divisible"
17
+
18
+ s.add_development_dependency "bundler", ">= 1.0.0.rc.5"
19
+
20
+ s.files = `git ls-files`.split("\n")
21
+ s.executables = `git ls-files`.split("\n").select{|f| f =~ /^bin/}
22
+ s.require_path = 'lib'
23
+ end
@@ -0,0 +1,13 @@
1
+ require "divisible/core_ext"
2
+
3
+ module Divisible
4
+
5
+ class << self
6
+
7
+ def check(n, d)
8
+ n % d == 0
9
+ end
10
+
11
+ end
12
+
13
+ end
@@ -0,0 +1,7 @@
1
+ class Fixnum
2
+
3
+ def divisible_by(d)
4
+ Divisible.check(self, d)
5
+ end
6
+
7
+ end
@@ -0,0 +1,3 @@
1
+ module Divisible
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: divisible
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Vlado Cingel
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-03-26 00:00:00 +01:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: bundler
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 15424063
30
+ segments:
31
+ - 1
32
+ - 0
33
+ - 0
34
+ - rc
35
+ - 5
36
+ version: 1.0.0.rc.5
37
+ type: :development
38
+ version_requirements: *id001
39
+ description: Useful to find out if one number is divisible by another 9.divisible_by(3) will return true, and 10.divisible_by(3) will return false
40
+ email:
41
+ - vlado@cingel.hr
42
+ executables: []
43
+
44
+ extensions: []
45
+
46
+ extra_rdoc_files: []
47
+
48
+ files:
49
+ - .gitignore
50
+ - Gemfile
51
+ - README.rdoc
52
+ - Rakefile
53
+ - divisible.gemspec
54
+ - lib/divisible.rb
55
+ - lib/divisible/core_ext.rb
56
+ - lib/divisible/version.rb
57
+ has_rdoc: true
58
+ homepage: http://rubygems.org/gems/divisible
59
+ licenses: []
60
+
61
+ post_install_message:
62
+ rdoc_options: []
63
+
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ hash: 3
72
+ segments:
73
+ - 0
74
+ version: "0"
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ none: false
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ hash: 23
81
+ segments:
82
+ - 1
83
+ - 3
84
+ - 6
85
+ version: 1.3.6
86
+ requirements: []
87
+
88
+ rubyforge_project: divisible
89
+ rubygems_version: 1.3.7
90
+ signing_key:
91
+ specification_version: 3
92
+ summary: Useful to find out if one number is divisible by another
93
+ test_files: []
94
+