{"id":14991365,"url":"https://github.com/ltfschoen/discrete_math","last_synced_at":"2025-07-24T16:41:49.030Z","repository":{"id":65903973,"uuid":"105218257","full_name":"ltfschoen/discrete_math","owner":"ltfschoen","description":null,"archived":false,"fork":false,"pushed_at":"2017-10-09T13:28:16.000Z","size":66,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T11:20:00.958Z","etag":null,"topics":["algorithms","cli","discrete-mathematics","namespaces","rakefile","rspec","ruby-gem","threading","travis-ci"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/discrete_math","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ltfschoen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-29T01:59:23.000Z","updated_at":"2023-02-13T20:50:27.000Z","dependencies_parsed_at":"2023-02-15T12:25:28.250Z","dependency_job_id":null,"html_url":"https://github.com/ltfschoen/discrete_math","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltfschoen%2Fdiscrete_math","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltfschoen%2Fdiscrete_math/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltfschoen%2Fdiscrete_math/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltfschoen%2Fdiscrete_math/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ltfschoen","download_url":"https://codeload.github.com/ltfschoen/discrete_math/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249058420,"owners_count":21205915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","cli","discrete-mathematics","namespaces","rakefile","rspec","ruby-gem","threading","travis-ci"],"created_at":"2024-09-24T14:27:33.052Z","updated_at":"2025-04-15T11:20:09.185Z","avatar_url":"https://github.com/ltfschoen.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Travis CI Build Status: [![Build Status](https://api.travis-ci.org/ltfschoen/discrete_math.svg)](https://travis-ci.org/ltfschoen/discrete_math)\n\n* Gem End-User Usage\n  * Install [Ruby](https://www.ruby-lang.org/en/documentation/installation/)\n  * Install using Bundler with Ruby or framework (i.e. Ruby on Rails)\n    * Add to Gemfile `gem 'discrete_math'`\n    * Install dependencies `bundle install`\n    * Add missing dependencies\n      ```\n      gem install rest-client\n      ```\n  * Setup IntelliJ\n    * Fix error `TERM environment variable not set`\n      * Add to Edit Configurations Environment Variable `TERM=xterm-256color`\n  * Install Signed Gem from Ruby Gemspec\n    * Download [discrete math Gem](https://rubygems.org/gems/discrete_math)\n    * Verify SHA256 Checksum matches\n      ```\n      ruby -rdigest/sha2 -e \"puts Digest::SHA256.new.hexdigest(File.read('discrete_math-\u003cinsert_version\u003e.gem'));\n      gem install discrete_math --trust-policy MediumSecurity\n      ```\n    * Discrete Math Gem is cryptographically signed to ensure the downloaded gem has not been tampered with. Add my public key (if you haven’t already) as a trusted certificate. The MediumSecurity trust profile verifies signed gems but allows installation of required unsigned dependencies.\n      ```\n      gem cert --add \u003c(curl -Ls https://raw.github.com/ltfschoen/discrete_math/master/certs/ltfschoen.pem)\n      gem install discrete_math -P MediumSecurity\n      ```\n  * Run in Interactive Ruby (IRB)\n    * Run IRB\n    * Load and Run Gem discrete math within IRB\n    * Exit IRB `quit`\n    * Summary of Steps\n      ```\n      irb\n      require 'discrete_math'; DiscreteMath.run(\"default\")\n      ```\n\n* Gem Developer Contributor Usage\n  * Clone Repo\n    ```\n    git clone https://github.com/ltfschoen/discrete_math \u0026\u0026 cd discrete_math\n    ```\n  * Setup\n    * Switch to Ruby version\n    * [Install Gemspec dependencies](http://guides.rubygems.org/patterns/)\n    * Show Gem environment and installation locations\n    * Show Rake commands available\n    * Summary of Setup Steps\n      ```\n      rbenv local 2.4.2;\n      gem install --dev rake terminal-table rake rest-client rspec algorithms;\n      gem env home; gem list -d;\n      rake -T;\n      ```\n    * Run Demo\n      ```\n      ruby main.rb\n      ```\n  * Unit Tests\n    * Run Automatic Unit Tests `bundle exec guard`\n      * Alternative 1: `rake`\n      * Alternative 2: `rake discrete:test`\n      * Alternative 3: `rspec spec/helpers/math_helpers_spec.rb`\n    * Guard Setup\n      * Add to Gemfile\n        ```\n        source 'https://rubygems.org'\n\n        group :development do\n          gem 'rspec', '~\u003e 3.6.0'\n          gem 'guard-rspec', '~\u003e 4.7.3'\n        end\n        ```\n      * Install dependencies `bundle install`\n      * Generate Guardfile `bundle exec guard init rspec`\n      * Remove Rails sections from Guardfile\n      * Run Guard `bundle exec guard`\n      * Watch Guard automatically run tests after each codebase change\n  * Build, install, and run Gem updates on local machine\n    * Change version in discrete_math.gemspec\n    * Note: [Check that all used Gem files have been added to Gemspec](http://guides.rubygems.org/specification-reference/#files)\n    * Create Self-Signed Gem Certificate\n      * Update discrete_math.gemspec\n        ```\n        s.cert_chain  = ['certs/ltfschoen.pem']\n        s.signing_key = File.expand_path(\"~/.ssh/gem-private_key.pem\") if $0 =~ /gem\\z/\n        ```\n      * Generate Certificates\n        ```\n        ~/.ssh/gem cert --build ltfschoen@gmail.com\n        ~/.ssh/chmod 600 gem-p*\n        mkdir certs; cp ~/.ssh/gem-public_cert.pem certs/ltfschoen.pem\n        git add certs/ltfschoen.pem\n        gem cert --add certs/ltfschoen.pem\n        ```\n    * Reference\n      * [RubyGem Security](http://guides.rubygems.org/security/)\n    * Uninstall specific version of previously installed discrete math gem (i.e. version 0.0.1) `rake discrete:uninstall[0.0.1]`\n    * Build and install new discrete math gem version defined in discrete_math.gemspec `rake discrete:install`\n    * Run\n      * Default program passing argument for default mode `rake discrete:run[default]`\n        * Alternative 2: See IRB instructions for General User\n  * Deploy latest Gem discrete math version to RubyGems (i.e. version 0.0.2) `rake discrete:deploy[0.0.2]`\n  * Deployment Steps Summary\n    ```\n    rake discrete:install;\n    cd ~/.ssh/; gem cert --build ltfschoen@gmail.com; chmod 600 gem-p*;\n    cd ~/code/discrete_maths;\n    mkdir -p certs; cp ~/.ssh/gem-public_cert.pem certs/ltfschoen.pem;\n    gem cert --add certs/ltfschoen.pem; git add certs/ltfschoen.pem;\n    rake discrete:deploy[0.0.8]\n    ```\n\n* References\n  * [Create Ruby Gem](http://guides.rubygems.org/make-your-own-gem/)\n  * [RSpec Tests](http://rspec.info/)\n  * Rake\n    * Executable and ARGV\n      * [Rake Executable and ARGV](http://www.thegreatcodeadventure.com/argv-and-command-line-gems/)\n      * [ARGV](https://github.com/rails/rails/blob/master/railties/lib/rails/commands.rb)\n    * [Rake Task Guide](http://www.stuartellis.name/articles/rake/)\n      * [Rakefile Bash Commands](https://stackoverflow.com/questions/9796028/execute-bash-commands-from-a-rakefile)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fltfschoen%2Fdiscrete_math","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fltfschoen%2Fdiscrete_math","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fltfschoen%2Fdiscrete_math/lists"}