Skip to content

Commit

Permalink
run bundle gem .
Browse files Browse the repository at this point in the history
  • Loading branch information
maxamus123 committed Apr 24, 2024
1 parent e9f6f51 commit 9fa9e73
Show file tree
Hide file tree
Showing 14 changed files with 169 additions and 139 deletions.
18 changes: 10 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/.bundle/
/.yardoc
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# rspec failure tracking
.rspec_status
3 changes: 3 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--format documentation
--color
--require spec_helper
13 changes: 13 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
AllCops:
TargetRubyVersion: 2.6

Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes

Style/StringLiteralsInInterpolation:
Enabled: true
EnforcedStyle: double_quotes

Layout/LineLength:
Max: 120
12 changes: 12 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

source "https://rubygems.org"

# Specify your gem's dependencies in acts_as_versionable.gemspec
gemspec

gem "rake", "~> 13.0"

gem "rspec", "~> 3.0"

gem "rubocop", "~> 1.21"
146 changes: 15 additions & 131 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,145 +1,29 @@
# Example README
# ActsAsVersionable

This is an example of what we expect in a README.
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/acts_as_versionable`. To experiment with that code, run `bin/console` for an interactive prompt.

## What?
TODO: Delete this and the text above, and describe your gem

A summary of the purpose of this piece of software, for example:
Delivery of Learnosity assessments to students and reporting student results to teachers.
## Installation

### Diagram
Install the gem and add to the application's Gemfile by executing:

A diagram showing all of the following:
$ bundle add acts_as_versionable

* project inputs
* projects end users
* project outputs
* project data stores
If bundler is not being used to manage dependencies, install the gem by executing:

([see mermaid documentation on how to create these diagrams](https://mermaid-js.github.io/mermaid/#/./flowchart?id=flowcharts-basic-syntax))
$ gem install acts_as_versionable

For example:
## Usage

```mermaid
graph LR
subgraph project_components[Hypothetical Service]
TODO: Write usage instructions here

project_api[Hypothetical Service API]
project_frontend[Hypothetical Service Frontend]
subgraph datastores[Data Stores]
postgres[PostgreSQL]
queue[SQS queue service]
end
end
## Development

subgraph inputs[Inputs]
event_platform_input[Event Platform]
cloud_canvas[Cloud Canvas API]
identity[Identity Server]
end
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

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).

subgraph end_users[End Users]
student[Student]
administrator[Administrator]
end
## Contributing

subgraph outputs[Outputs]
event_platform_out[Event Platform]
end
event_platform_input -->|Canvas Change Events| project_api
cloud_canvas -->|Canvas User API get| project_api
identity -->|Authentication of users| project_frontend
project_frontend -->|Views a thing| student
administrator -->|Creates things| project_frontend
project_api -->|Sends create and view messages| event_platform_out
```

## Where?

### Links

A list of links to deployed software
For example:

* stage: [stage-project.strongmind.com](https://stage-project.strongmind.com)
* prod: [project.strongmind.com](https://project.strongmind.com)

### CI/CD

A link to CI/CD for this repository
For example:

* [https://github.com/StrongMind/project/actions](https://github.com/StrongMind/project/actions)

### Administration

A list of links to operational information, for example:

* [Logs](https://us-west-2.console.aws.amazon.com/cloudwatch/home?region=us-west-2#logsV2:logs-insights$3FqueryDetail$%5B%E2%80%A6%5D*2flambda*2fid-mapper-prod$2529$2529)
* [Exception Tracking](https://sentry.io/organizations/strongmind-4j/projects/id-mapper/?project=6262579)
* [Monitoring & Metrics Dashboard](https://us-west-2.console.aws.amazon.com/cloudwatch/home?region=us-west-2#dashboards:name=identifier-mapper-prod)

## Local Install

A set of comprehensive instructions to install from scratch on a developer workstation. We suggest you test these with a member from another team. For example:

### Mac

In this source directory:

1. Install homebrew
1. Install python 3.10 using homebrew `brew install python@3.10`
1. Install virtualenv and virtualenvwrapper `pip install virtualenv virtualenvwrapper`
1. Create virtual environment for project `mkvirtualenv project_name -p /opt/homebrew/opt/python@3.10/bin/python3`
1. Install project requirements `pip install -r requirements.txt`

#### Known Issues and Fixes

If your system python does not include pip, you will need to make sure pip is installed :

```console
python -m ensurepip # if your system python is at least 3.4
```

If your system python isn't at least 3.4, you will need to use your system package manager to install pip.

### Windows

In this source directory:

1. [Install python](https://www.python.org/downloads/release/python-3105/)
1. Open project in pycharm
1. Set interpreter installed python 3.10
1. Open shell
1. Install project requirements `pip install -r requirements.txt`

## Run tests locally

A set of instructions to run tests locally, for example:

```console
pytest
```

## Run service locally

A set of instructions to run service locally, for example:

### Mac (service)

```console
python manage.py runserver
```

### Windows (service)

```console
py manage.py runserver
```

> Code owners can be found in [CODEOWNERS file](./CODEOWNERS)
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/acts_as_versionable.
12 changes: 12 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)

require "rubocop/rake_task"

RuboCop::RakeTask.new

task default: %i[spec rubocop]
38 changes: 38 additions & 0 deletions acts_as_versionable.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# frozen_string_literal: true

require_relative "lib/acts_as_versionable/version"

Gem::Specification.new do |spec|
spec.name = "acts_as_versionable"
spec.version = ActsAsVersionable::VERSION
spec.authors = ["Maxwell Creamer"]
spec.email = ["maxwell.creamer@strongmind.com"]

spec.summary = "TODO: Write a short summary, because RubyGems requires one."
spec.description = "TODO: Write a longer description or delete this line."
spec.homepage = "TODO: Put your gem's website or public repo URL here."
spec.required_ruby_version = ">= 2.6.0"

spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
spec.files = Dir.chdir(__dir__) do
`git ls-files -z`.split("\x0").reject do |f|
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
end
end
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

# Uncomment to register a new dependency of your gem
# spec.add_dependency "example-gem", "~> 1.0"

# For more information and examples about making a new gem, check out our
# guide at: https://bundler.io/guides/creating_gem.html
end
15 changes: 15 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"
require "acts_as_versionable"

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.

# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start

require "irb"
IRB.start(__FILE__)
8 changes: 8 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx

bundle install

# Do any other automated setup that you need to do here
8 changes: 8 additions & 0 deletions lib/acts_as_versionable.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

require_relative "acts_as_versionable/version"

module ActsAsVersionable
class Error < StandardError; end
# Your code goes here...
end
5 changes: 5 additions & 0 deletions lib/acts_as_versionable/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

module ActsAsVersionable
VERSION = "0.1.0"
end
4 changes: 4 additions & 0 deletions sig/acts_as_versionable.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module ActsAsVersionable
VERSION: String
# See the writing guide of rbs: https://github.com/ruby/rbs#guides
end
11 changes: 11 additions & 0 deletions spec/acts_as_versionable_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

RSpec.describe ActsAsVersionable do
it "has a version number" do
expect(ActsAsVersionable::VERSION).not_to be nil
end

it "does something useful" do
expect(false).to eq(true)
end
end
15 changes: 15 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

require "acts_as_versionable"

RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"

# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!

config.expect_with :rspec do |c|
c.syntax = :expect
end
end

0 comments on commit 9fa9e73

Please sign in to comment.