mebeZ_gcd 0.1.0
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 +7 -0
 - data/CHANGELOG.md +0 -0
 - data/Gemfile +10 -0
 - data/Gemfile.lock +30 -0
 - data/README.md +35 -0
 - data/Rakefile +12 -0
 - data/bin/console +15 -0
 - data/bin/setup +8 -0
 - data/lib/mebeZ_gcd/version.rb +5 -0
 - data/lib/mebeZ_gcd.rb +41 -0
 - data/sig/mebeZ_gcd.rbs +4 -0
 - metadata +57 -0
 
    
        checksums.yaml
    ADDED
    
    | 
         @@ -0,0 +1,7 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ---
         
     | 
| 
      
 2 
     | 
    
         
            +
            SHA256:
         
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 71764efef314eb6f20087c217d53a63fe20fdf6639b544abd5fc602c7e8d2edb
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 67bb5126eb54803e6e0338f1bbec571f291ef10b6445b4b969d33c42481969ad
         
     | 
| 
      
 5 
     | 
    
         
            +
            SHA512:
         
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 288d3cea3a4a62449dd4841032c837dcef2502801f3719023d2271527655bda4f616ffe06f5004bea2b59978a773c21c75c0b94ada6bc622591fdf2b61e5f1cb
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 8f866369b7099764d731f255cdc2c87811aa1811ee9bc979704ed3b7585aa07ed1a902e0a7fdc08d0310d909903d235f51ad87f526b631d25e40efa88ba148e8
         
     | 
    
        data/CHANGELOG.md
    ADDED
    
    | 
         
            File without changes
         
     | 
    
        data/Gemfile
    ADDED
    
    
    
        data/Gemfile.lock
    ADDED
    
    | 
         @@ -0,0 +1,30 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            PATH
         
     | 
| 
      
 2 
     | 
    
         
            +
              remote: .
         
     | 
| 
      
 3 
     | 
    
         
            +
              specs:
         
     | 
| 
      
 4 
     | 
    
         
            +
                mebeZ_gcd (0.1.0)
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            GEM
         
     | 
| 
      
 7 
     | 
    
         
            +
              remote: https://rubygems.org/
         
     | 
| 
      
 8 
     | 
    
         
            +
              specs:
         
     | 
| 
      
 9 
     | 
    
         
            +
                ansi (1.5.0)
         
     | 
| 
      
 10 
     | 
    
         
            +
                builder (3.2.4)
         
     | 
| 
      
 11 
     | 
    
         
            +
                minitest (5.15.0)
         
     | 
| 
      
 12 
     | 
    
         
            +
                minitest-reporters (1.5.0)
         
     | 
| 
      
 13 
     | 
    
         
            +
                  ansi
         
     | 
| 
      
 14 
     | 
    
         
            +
                  builder
         
     | 
| 
      
 15 
     | 
    
         
            +
                  minitest (>= 5.0)
         
     | 
| 
      
 16 
     | 
    
         
            +
                  ruby-progressbar
         
     | 
| 
      
 17 
     | 
    
         
            +
                rake (13.0.6)
         
     | 
| 
      
 18 
     | 
    
         
            +
                ruby-progressbar (1.11.0)
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            PLATFORMS
         
     | 
| 
      
 21 
     | 
    
         
            +
              x86_64-linux
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
            DEPENDENCIES
         
     | 
| 
      
 24 
     | 
    
         
            +
              mebeZ_gcd!
         
     | 
| 
      
 25 
     | 
    
         
            +
              minitest (~> 5.0)
         
     | 
| 
      
 26 
     | 
    
         
            +
              minitest-reporters (~> 1.5.0)
         
     | 
| 
      
 27 
     | 
    
         
            +
              rake (~> 13.0)
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
            BUNDLED WITH
         
     | 
| 
      
 30 
     | 
    
         
            +
               2.3.4
         
     | 
    
        data/README.md
    ADDED
    
    | 
         @@ -0,0 +1,35 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # MebeZGcd
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/mebeZ_gcd`. To experiment with that code, run `bin/console` for an interactive prompt.
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            TODO: Delete this and the text above, and describe your gem
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            ## Installation
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            Add this line to your application's Gemfile:
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            ```ruby
         
     | 
| 
      
 12 
     | 
    
         
            +
            gem 'mebeZ_gcd'
         
     | 
| 
      
 13 
     | 
    
         
            +
            ```
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            And then execute:
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                $ bundle install
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            Or install it yourself as:
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                $ gem install mebeZ_gcd
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
            ## Usage
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            TODO: Write usage instructions here
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
            ## Development
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
            After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
            To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
            ## Contributing
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
            Bug reports and pull requests are welcome on GitHub at https://github.com/mebeZ/mebeZ_gcd.
         
     | 
    
        data/Rakefile
    ADDED
    
    
    
        data/bin/console
    ADDED
    
    | 
         @@ -0,0 +1,15 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #!/usr/bin/env ruby
         
     | 
| 
      
 2 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            require "bundler/setup"
         
     | 
| 
      
 5 
     | 
    
         
            +
            require "mebeZ_gcd"
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            # You can add fixtures and/or initialization code here to make experimenting
         
     | 
| 
      
 8 
     | 
    
         
            +
            # with your gem easier. You can also use a different console, if you like.
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            # (If you use this, don't forget to add pry to your Gemfile!)
         
     | 
| 
      
 11 
     | 
    
         
            +
            # require "pry"
         
     | 
| 
      
 12 
     | 
    
         
            +
            # Pry.start
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            require "irb"
         
     | 
| 
      
 15 
     | 
    
         
            +
            IRB.start(__FILE__)
         
     | 
    
        data/bin/setup
    ADDED
    
    
    
        data/lib/mebeZ_gcd.rb
    ADDED
    
    | 
         @@ -0,0 +1,41 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            require_relative "mebeZ_gcd/version"
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            class GCD
         
     | 
| 
      
 6 
     | 
    
         
            +
              
         
     | 
| 
      
 7 
     | 
    
         
            +
              attr_accessor :a
         
     | 
| 
      
 8 
     | 
    
         
            +
              attr_accessor :b
         
     | 
| 
      
 9 
     | 
    
         
            +
              
         
     | 
| 
      
 10 
     | 
    
         
            +
              def initialize(a, b) 
         
     | 
| 
      
 11 
     | 
    
         
            +
                @a = a
         
     | 
| 
      
 12 
     | 
    
         
            +
                @b = b
         
     | 
| 
      
 13 
     | 
    
         
            +
                if (b > a) 
         
     | 
| 
      
 14 
     | 
    
         
            +
                  swap()
         
     | 
| 
      
 15 
     | 
    
         
            +
                end
         
     | 
| 
      
 16 
     | 
    
         
            +
              end
         
     | 
| 
      
 17 
     | 
    
         
            +
              
         
     | 
| 
      
 18 
     | 
    
         
            +
              def swap
         
     | 
| 
      
 19 
     | 
    
         
            +
                temp = @a
         
     | 
| 
      
 20 
     | 
    
         
            +
                @a = @b
         
     | 
| 
      
 21 
     | 
    
         
            +
                @b = temp
         
     | 
| 
      
 22 
     | 
    
         
            +
              end
         
     | 
| 
      
 23 
     | 
    
         
            +
              
         
     | 
| 
      
 24 
     | 
    
         
            +
              def recurse
         
     | 
| 
      
 25 
     | 
    
         
            +
                r = @a % @b 
         
     | 
| 
      
 26 
     | 
    
         
            +
                @a = @b
         
     | 
| 
      
 27 
     | 
    
         
            +
                @b = r
         
     | 
| 
      
 28 
     | 
    
         
            +
              end
         
     | 
| 
      
 29 
     | 
    
         
            +
              
         
     | 
| 
      
 30 
     | 
    
         
            +
              def get_gcd # Apply Euclid's algorithm to get GCD
         
     | 
| 
      
 31 
     | 
    
         
            +
                #base case R0
         
     | 
| 
      
 32 
     | 
    
         
            +
                if (@a % @b == 0) 
         
     | 
| 
      
 33 
     | 
    
         
            +
                  return @b
         
     | 
| 
      
 34 
     | 
    
         
            +
                end
         
     | 
| 
      
 35 
     | 
    
         
            +
                # else recurse
         
     | 
| 
      
 36 
     | 
    
         
            +
                recurse()
         
     | 
| 
      
 37 
     | 
    
         
            +
                return get_gcd
         
     | 
| 
      
 38 
     | 
    
         
            +
              end
         
     | 
| 
      
 39 
     | 
    
         
            +
            end
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
            gcd = GCD.new(3, 8)
         
     | 
    
        data/sig/mebeZ_gcd.rbs
    ADDED
    
    
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,57 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
      
 2 
     | 
    
         
            +
            name: mebeZ_gcd
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.0
         
     | 
| 
      
 5 
     | 
    
         
            +
            platform: ruby
         
     | 
| 
      
 6 
     | 
    
         
            +
            authors:
         
     | 
| 
      
 7 
     | 
    
         
            +
            - Zachary Hine
         
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
      
 9 
     | 
    
         
            +
            bindir: exe
         
     | 
| 
      
 10 
     | 
    
         
            +
            cert_chain: []
         
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2022-01-17 00:00:00.000000000 Z
         
     | 
| 
      
 12 
     | 
    
         
            +
            dependencies: []
         
     | 
| 
      
 13 
     | 
    
         
            +
            description: Detects GCD of two integers using Euclids algorithm. Adaption of original
         
     | 
| 
      
 14 
     | 
    
         
            +
              palindrome gem
         
     | 
| 
      
 15 
     | 
    
         
            +
            email:
         
     | 
| 
      
 16 
     | 
    
         
            +
            - zacharyhine@gmail.com
         
     | 
| 
      
 17 
     | 
    
         
            +
            executables: []
         
     | 
| 
      
 18 
     | 
    
         
            +
            extensions: []
         
     | 
| 
      
 19 
     | 
    
         
            +
            extra_rdoc_files: []
         
     | 
| 
      
 20 
     | 
    
         
            +
            files:
         
     | 
| 
      
 21 
     | 
    
         
            +
            - CHANGELOG.md
         
     | 
| 
      
 22 
     | 
    
         
            +
            - Gemfile
         
     | 
| 
      
 23 
     | 
    
         
            +
            - Gemfile.lock
         
     | 
| 
      
 24 
     | 
    
         
            +
            - README.md
         
     | 
| 
      
 25 
     | 
    
         
            +
            - Rakefile
         
     | 
| 
      
 26 
     | 
    
         
            +
            - bin/console
         
     | 
| 
      
 27 
     | 
    
         
            +
            - bin/setup
         
     | 
| 
      
 28 
     | 
    
         
            +
            - lib/mebeZ_gcd.rb
         
     | 
| 
      
 29 
     | 
    
         
            +
            - lib/mebeZ_gcd/version.rb
         
     | 
| 
      
 30 
     | 
    
         
            +
            - sig/mebeZ_gcd.rbs
         
     | 
| 
      
 31 
     | 
    
         
            +
            homepage: https://github.com/mebeZ/mebeZ_gcd
         
     | 
| 
      
 32 
     | 
    
         
            +
            licenses: []
         
     | 
| 
      
 33 
     | 
    
         
            +
            metadata:
         
     | 
| 
      
 34 
     | 
    
         
            +
              allowed_push_host: https://rubygems.org/
         
     | 
| 
      
 35 
     | 
    
         
            +
              homepage_uri: https://github.com/mebeZ/mebeZ_gcd
         
     | 
| 
      
 36 
     | 
    
         
            +
              source_code_uri: https://github.com/mebeZ/mebeZ_gcd
         
     | 
| 
      
 37 
     | 
    
         
            +
              changelog_uri: https://github.com/mebeZ/mebeZ_gcd/blob/main/CHANGELOG.md
         
     | 
| 
      
 38 
     | 
    
         
            +
            post_install_message: 
         
     | 
| 
      
 39 
     | 
    
         
            +
            rdoc_options: []
         
     | 
| 
      
 40 
     | 
    
         
            +
            require_paths:
         
     | 
| 
      
 41 
     | 
    
         
            +
            - lib
         
     | 
| 
      
 42 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 43 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 44 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 45 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 46 
     | 
    
         
            +
                  version: 2.6.0
         
     | 
| 
      
 47 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 48 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 49 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 50 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 51 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 52 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 53 
     | 
    
         
            +
            rubygems_version: 3.0.8
         
     | 
| 
      
 54 
     | 
    
         
            +
            signing_key: 
         
     | 
| 
      
 55 
     | 
    
         
            +
            specification_version: 4
         
     | 
| 
      
 56 
     | 
    
         
            +
            summary: Detects GCD of two integers using Euclids algorithm
         
     | 
| 
      
 57 
     | 
    
         
            +
            test_files: []
         
     |