rubysh_mathematica 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 18421fca02d681f759ac4a07ae52f9cc2861f0a3
4
- data.tar.gz: 0ea40581dfbc928733bc425a2bc20693d734cb49
3
+ metadata.gz: d1986e43d685c49e180e966b8a1c40c3bf0b0761
4
+ data.tar.gz: bc32b42f01a0c6c067aa08d121ad165da2a6748b
5
5
  SHA512:
6
- metadata.gz: 422f9c56385c5e1b2e37318c0a9a70b0349f01407455d0a704280c3fa0fb012e8a8a29b8c93f857f8ee90af0f8b0c995a88fe20196fd9e409c8e0e334bd931ea
7
- data.tar.gz: 73eeb7f5a3ab7219eae9a6e4a1602b797e210a98cbab32171a4b1169edaf2e0a59ffff0d4b019523983aa268e2aad082f7cd9ab3403c97ab17d97f3463aa437a
6
+ metadata.gz: 2cb946f6f8a643cd5c628d7efe01e314b1024a1b7cbd4e6571e11b6cb6ca9c44961f55c76adaddefb5534ecb6a056a532c542dcd22b3e1b74201b7836df8ff99
7
+ data.tar.gz: ec71b7d936f77dfb17517d6415b2d123401c3aa86f503e4034665fbad0a5503eb3b50d189d4523b09a303baf8a294021dacc87a5d86801d6ff8dfc055e4a898d
data/Gemfile CHANGED
@@ -2,5 +2,7 @@ source "https://rubygems.org"
2
2
 
3
3
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
+ gem 'rubysh_mathematica', :path => 'lib/rubysh_mathematica'
6
+
5
7
  # Specify your gem's dependencies in rubysh_mathematica.gemspec
6
8
  gemspec
@@ -0,0 +1,7 @@
1
+ # Integer class method overloading.
2
+ class Integer
3
+ # Returns true if self is a composite number.
4
+ def composite?
5
+ !prime?
6
+ end
7
+ end
@@ -0,0 +1,8 @@
1
+ # Integer class method overloading.
2
+ class Integer
3
+ # Returns true if self is a prime number.
4
+ def prime?
5
+ return false if [0, 1].include? self
6
+ (2..Math.sqrt(self)).none? { |number| (self % number).zero? }
7
+ end
8
+ end
@@ -0,0 +1,2 @@
1
+ require_relative('is_prime')
2
+ require_relative('is_composite')
@@ -1 +1,2 @@
1
1
  require_relative('Multiples/multiples')
2
+ require_relative('Prime/prime')
@@ -1,3 +1,3 @@
1
1
  module RubyshMathematica
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubysh_mathematica
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rubysh
@@ -72,6 +72,9 @@ files:
72
72
  - lib/rubysh_mathematica/Overloads/Integer/Multiples/is_factor_of.rb
73
73
  - lib/rubysh_mathematica/Overloads/Integer/Multiples/is_multiple_of.rb
74
74
  - lib/rubysh_mathematica/Overloads/Integer/Multiples/multiples.rb
75
+ - lib/rubysh_mathematica/Overloads/Integer/Prime/is_composite.rb
76
+ - lib/rubysh_mathematica/Overloads/Integer/Prime/is_prime.rb
77
+ - lib/rubysh_mathematica/Overloads/Integer/Prime/prime.rb
75
78
  - lib/rubysh_mathematica/Overloads/Integer/integer_overload.rb
76
79
  - lib/rubysh_mathematica/version.rb
77
80
  - rubysh_mathematica.gemspec