Browse Source

Merge branch 'dev' into args-refactor-forrealsies

dev
Andy Meneely 5 years ago
parent
commit
ca96a0e857
  1. 18
      .github/workflows/tests.yml
  2. 17
      .travis.yml
  3. 34
      Dockerfile
  4. 2
      README.md
  5. 3
      Rakefile
  6. 25
      appveyor.yml
  7. 2
      lib/squib/api/data.rb
  8. 2
      samples/colors/_switch_color.rb
  9. 6
      samples/colors/_switch_color_data.csv
  10. 11
      spec/spec_helper.rb

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

17
.travis.yml

@ -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

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

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

3
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'

25
appveyor.yml

@ -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

2
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|

2
samples/colors/_switch_color.rb

@ -5,7 +5,7 @@ require_relative '../../lib/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

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

1 Type Text
2 Snake This is a snake.
3 Lion This is a lion.

11
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'
require 'rainbow/refinement'

Loading…
Cancel
Save