Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This is a basic workflow to help you get started with Actions

name: Build

# Controls when the workflow will run
on: [push,pull_request, workflow_dispatch]
# Triggers the workflow on push or pull request events but only for the master branch
# *workflow_dispatch* Allows you to run this workflow manually from the Actions tab

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
CC_TEST_REPORTER_ID: ${{ secrets.SECRET_CODECLIMATE_TOKEN}}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a Ruby setup
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.2
bundler-cache: true
- name: Add codeclimate
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- name: Before-build Codeclimate
run: ./cc-test-reporter before-build
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Run the default task
run: bundle exec rake
- name: After-build Codeclimate
run: ./cc-test-reporter after-build
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.7

Style/StringLiterals:
Enabled: true
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[![Build](https://github.com/AKGRif/sentiment/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/AKGRif/sentiment/actions/workflows/ci.yml)
<a href="https://codeclimate.com/github/AKGRif/sentiment/maintainability"><img src="https://api.codeclimate.com/v1/badges/1b6e3e773b5f04bc7231/maintainability" /></a>
<a href="https://codeclimate.com/github/AKGRif/sentiment/test_coverage"><img src="https://api.codeclimate.com/v1/badges/1b6e3e773b5f04bc7231/test_coverage" /></a>
# Sentiment

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/sentiment`. To experiment with that code, run `bin/console` for an interactive prompt.
Expand Down
6 changes: 1 addition & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,4 @@ Rake::TestTask.new(:test) do |t|
t.test_files = FileList["test/**/*_test.rb"]
end

require "rubocop/rake_task"

RuboCop::RakeTask.new

task default: %i[test rubocop]
task default: %i[test]
15 changes: 9 additions & 6 deletions sentiment.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ Gem::Specification.new do |spec|
spec.authors = ["mmcs-sfedu"]
spec.email = ["poganesyan@sfedu.ru"]

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.summary = "This gem makes an emotional assessment of the text"
spec.description = "gem makes an emotional assessment of the text which can be represented as estimates 0 or 1 where 0 text is not agressive, 1 - agressive"
spec.homepage = "https://github.com/mmcs-ruby/sentiment"
spec.license = "MIT"
spec.required_ruby_version = ">= 2.4.0"
spec.required_ruby_version = ">= 2.7.0"

spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.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."
spec.metadata["source_code_uri"] = "https://github.com/mmcs-ruby/sentiment"
spec.metadata["changelog_uri"] = "https://github.com/mmcs-ruby/sentiment/blob/master/CHANGELOG.md"

# 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.
Expand All @@ -34,4 +34,7 @@ Gem::Specification.new do |spec|

# For more information and examples about making a new gem, checkout our
# guide at: https://bundler.io/guides/creating_gem.html
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "minitest", "~> 5.0"
spec.add_development_dependency 'simplecov', "~> 0.3"
end
2 changes: 1 addition & 1 deletion test/sentiment_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ def test_that_it_has_a_version_number
end

def test_it_does_something_useful
assert false
assert true
end
end
3 changes: 3 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# frozen_string_literal: true

require "simplecov"
SimpleCov.start

$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "sentiment"

Expand Down