From 20f2063e678904ef34f1114a9d3bd4e71ab45a9c Mon Sep 17 00:00:00 2001 From: Adam Blinkinsop Date: Wed, 8 Apr 2020 13:52:48 -0700 Subject: [PATCH 1/7] Keyword arguments need ** (bare is deprecated) (#303) * Fix typos in the yaml documentation. * Fix keyword params deprecation warning. .../squib/lib/squib/api/data.rb:42: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call /Users/blinks/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/csv.rb:679: warning: The called method `parse' is defined here --- lib/squib/api/data.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/squib/api/data.rb b/lib/squib/api/data.rb index a834c98..682eb2c 100644 --- a/lib/squib/api/data.rb +++ b/lib/squib/api/data.rb @@ -39,7 +39,7 @@ module Squib file = Args::InputFile.new(file: 'deck.csv').load!(opts).file[0] data = opts.key?(:data) ? opts[:data] : File.read(file) csv_opts = Args::CSV_Opts.new(opts) - table = CSV.parse(data, csv_opts.to_hash) + table = CSV.parse(data, **csv_opts.to_hash) check_duplicate_csv_headers(table) hash = Squib::DataFrame.new table.headers.each do |header| From 006391245b9bd6046c0fab0f0ec437978eb062c0 Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Thu, 16 Jul 2020 22:28:18 -0400 Subject: [PATCH 2/7] Fix link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 420eb0d..400effe 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ Go [read the docs!](http://squib.readthedocs.org/) Also: * The `samples` directory in the [source repository](https://github.com/andymeneely/squib) has lots of examples. -* [Your Last Heist](http://yourlastheist.com) is my own creation, and it was made with Squib. Go through the repository and watch how it evolved! +* [Masters of the Heist](http://mastersoftheheist.com) is my own creation, and it was made with Squib. Go through the repository and watch how it evolved! * [Junk Land](https://github.com/andymeneely/junk-land) is my own creation that's uses Squib for full-color rendering, and makes use of Ruby in a lot of interesting ways. The port is still in process. * [Project Spider Monkey](https://github.com/andymeneely/project-spider-monkey) is another of my own creations. This one was started from scratch with Squib, but it's still in its early stages. From f5c41dd5c271a88fe8e1c5de5d95d28cbd54c9e6 Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Tue, 29 Sep 2020 11:31:30 -0400 Subject: [PATCH 3/7] update coveralls setup --- spec/spec_helper.rb | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 551582c..82b56b3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,13 +1,6 @@ -require 'simplecov' -require 'coveralls' require 'byebug' - -SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([ - SimpleCov::Formatter::HTMLFormatter, - Coveralls::SimpleCov::Formatter -]) -SimpleCov.start - +require 'coveralls' +Coveralls.wear! require 'squib' RSpec.configure do |config| From ecb75281b31dd572a8f433a719e8d499a57c69d5 Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Tue, 29 Sep 2020 11:38:14 -0400 Subject: [PATCH 4/7] because i keep typing `rake test` instead of spec --- Rakefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Rakefile b/Rakefile index 3a8ec2c..84d08a2 100644 --- a/Rakefile +++ b/Rakefile @@ -6,6 +6,9 @@ require 'benchmark' desc 'install + spec' task default: ['install:local', :spec] +desc 'test => spec' +task test: [:spec] + # Useful for hooking up with SublimeText. # e.g. rake sample[basic.rb] desc 'Run a specific sample' From 2f0820040354307d3b35722db90f8074def71322 Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Tue, 29 Sep 2020 11:41:27 -0400 Subject: [PATCH 5/7] cleanup test --- samples/colors/_switch_color.rb | 2 +- samples/colors/_switch_color_data.csv | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/colors/_switch_color.rb b/samples/colors/_switch_color.rb index dab17a1..cb668c5 100644 --- a/samples/colors/_switch_color.rb +++ b/samples/colors/_switch_color.rb @@ -5,7 +5,7 @@ require 'squib' # black snake cards with white text color = 'white' -cards = Squib.csv file: '_switch_color_data.csv', col_sep: "\t" +cards = Squib.csv file: '_switch_color_data.csv' Squib::Deck.new cards: cards['Type'].size do diff --git a/samples/colors/_switch_color_data.csv b/samples/colors/_switch_color_data.csv index 98b09d3..182a351 100644 --- a/samples/colors/_switch_color_data.csv +++ b/samples/colors/_switch_color_data.csv @@ -1,3 +1,3 @@ -Type Text -Snake This is a snake. -Lion This is a lion. +Type,Text +Snake,This is a snake. +Lion,This is a lion. From 6effc093c49b53c542af8ffa9b010f361f5ca871 Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Tue, 29 Sep 2020 15:15:06 -0400 Subject: [PATCH 6/7] Make alpine-based image --- Dockerfile | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 860de19..768bb78 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,31 @@ -FROM ruby:2.5-alpine +# This is the official Squib Docker image. +# +FROM ruby:2.6-alpine WORKDIR /usr/src/app LABEL org.squib.url=http://squib.rocks \ org.squib.github=https://github.com/andymeneely/squib -RUN apk --no-cache add --update \ - ruby-dev \ +# This works, but it really bloats the image +RUN apk --no-cache --update --upgrade add \ build-base \ - libxml2-dev \ - libxslt-dev \ - pcre-dev \ - libffi-dev \ - cairo + cairo-dev \ + pango-dev \ + gobject-introspection-dev \ + gdk-pixbuf-dev \ + librsvg-dev + +RUN gem install squib + +# Remove some of the dev tools +RUN apk del build-base + +RUN apk --no-cache --update --upgrade add \ + ttf-opensans # Just for devving on -COPY . /app +# CMD ["sh"] +# RUN apk --no-cache add ncdu -CMD ["sh"] -# RUN gem install \ -# squib \ -# -- --use-system-libraries -# NOTE: STILL UNDER DEVELOPMENT! Don't use this just yet. From 2682fcf0319a66d035a21cbad58b908d7a7ea3ab Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Tue, 29 Sep 2020 16:03:37 -0400 Subject: [PATCH 7/7] Convert to Github Actions --- .github/workflows/tests.yml | 18 ++++++++++++++++++ .travis.yml | 17 ----------------- appveyor.yml | 25 ------------------------- 3 files changed, 18 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..64b97a4 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,18 @@ + +name: Squib Unit Tests + +on: [push] + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up Ruby 2.6 + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + # bundler-cache: true + - run: bundle install + - run: bundle exec rake + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 291c817..0000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: ruby -sudo: true # need this for libgirepository1.0-dev -addons: - apt: - packages: - - libgirepository1.0-dev # for gobject-introspection -rvm: - - 2.4.2 - - 2.5.3 - - 2.6.3 - - ruby-head -before_install: - - gem update --system - - gem install bundler -matrix: - allow_failures: - - rvm: ruby-head diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 3749edc..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: '{build}' - -skip_tags: true - -environment: - matrix: - - ruby_version: "24" - - ruby_version: "24-x64" - - ruby_version: "25" - - ruby_version: "25-x64" - - ruby_version: "26" - - ruby_version: "26-x64" - -install: - - SET PATH=C:\Ruby%ruby_version%\bin;%PATH% - - ruby --version - - gem --version - - gem install bundler - - bundler --version - - bundle install - -test_script: - - rake - -build: off