ruby2d 0.9.2 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68b61e2fafeade49bbde64e9cf5f4ac9b547e993a6b93e33b6f6682987d9bdab
4
- data.tar.gz: cb55b6a5b15697b2ab43957927dd25b14759342b9924eb9c355f080fc8d29790
3
+ metadata.gz: bc9cd5ced7c619c8e46e75f6d7995533cda2b25cdb664fada6164d7685ecd3bd
4
+ data.tar.gz: '068515dfd572e25f244ea194831e6b3ac89fa5ef02899615b5d75c1592f55d35'
5
5
  SHA512:
6
- metadata.gz: 5132d8b96019444a50ac3b63de338069abf2179833d6a066658d8716fc6cfdd6e728c5185ed47aedcc9304f424b7c98c3f44fad7b7eb681c2db41376017ee42e
7
- data.tar.gz: b073bad73e499447a94a21bc3e85218b741250d9b9f1d9798f2fdf202c1bab334740ff8bd479de46798deed8328ca07027dd55b8de39f1583551d6d276f32fbe
6
+ metadata.gz: 298106e209781cecfbad8c41e5d1076001b9ecaae45826553d8bddfd4569d228896794d1e3150ca1c788984091d504dcc49a2ba8b50bcd0b16a1154fb0654414
7
+ data.tar.gz: bcd3bf7df06bf2b6bbd424c008abb19abe978be5302ca2731b5badaf1d653c48f5619ca1abdf28538b53d5848d6f703d31173a34ed057c54122609af54c2b541
@@ -21,3 +21,4 @@
21
21
  - From your local [Simple 2D](https://github.com/simple2d) project
22
22
  - Copy `simple2d.h` to `include/`
23
23
  - Copy the `libsimple2d.a` builds to their respective `macos/lib` and `mingw/lib` directories
24
+ - Copy `bin/simple2d.sh`, `include/`, `src/`, and `Makefile` to `linux/simple2d/`
@@ -26,6 +26,13 @@ ifeq ($(shell uname),Linux)
26
26
  CFLAGS+=-fPIC
27
27
  endif
28
28
 
29
+ # BSD
30
+ ifneq (,$(findstring BSD,$(shell uname)))
31
+ CC=cc
32
+ INCLUDES=-I/usr/local/include/
33
+ CFLAGS+=-fPIC
34
+ endif
35
+
29
36
  # MinGW
30
37
  ifneq (,$(findstring MINGW,$(shell uname -s)))
31
38
  PLATFORM=mingw
@@ -1,4 +1,4 @@
1
- #!/bin/bash
1
+ #!/usr/bin/env bash
2
2
 
3
3
  # ------------------------------------------------------------------------------
4
4
  # The Simple 2D Command-Line Utility for Unix-like Systems
@@ -333,6 +333,32 @@ have_sdl_libs?() {
333
333
  }
334
334
 
335
335
 
336
+ # Installs SDL on BSD
337
+ install_sdl_bsd() {
338
+
339
+ echo "The following packages will be installed:"
340
+ echo " sdl2"
341
+ echo " sdl2_image"
342
+ echo " sdl2_mixer"
343
+ echo " sdl2_ttf"
344
+
345
+ prompt_to_continue "Install SDL now?"
346
+
347
+ print_task "Updating packages" "\n\n"
348
+ print_and_run "sudo pkg update"
349
+
350
+ echo; print_task "Installing packages" "\n\n"
351
+ print_and_run "sudo pkg install sdl2 sdl2_image sdl2_mixer sdl2_ttf"
352
+ echo
353
+
354
+ if ! have_sdl_libs?; then
355
+ echo; error_msg "SDL libraries did not install correctly"; exit 1
356
+ else
357
+ echo; info_msg "SDL was installed successfully"
358
+ fi
359
+ }
360
+
361
+
336
362
  # Installs SDL on Linux
337
363
  install_sdl_linux() {
338
364
 
@@ -502,6 +528,8 @@ install_sdl_source() {
502
528
  install_sdl() {
503
529
  if [[ $platform == 'linux' ]]; then
504
530
  install_sdl_linux
531
+ elif [[ $platform == 'bsd' ]]; then
532
+ install_sdl_bsd
505
533
  elif [[ $platform == 'arm' ]]; then
506
534
  install_sdl_source
507
535
  fi
@@ -552,7 +580,7 @@ install_s2d() {
552
580
  fi
553
581
 
554
582
  echo; print_task "Unpacking" "\n\n"
555
- print_and_run "unzip -q $tmp_dir/$f_name -d $tmp_dir"
583
+ print_and_run "unzip -q $tmp_dir/$f_name.zip -d $tmp_dir"
556
584
 
557
585
  # Check if archive was unpacked properly
558
586
  if [[ $? != 0 ]]; then
@@ -561,8 +589,13 @@ install_s2d() {
561
589
 
562
590
  print_and_run "cd $tmp_dir/simple2d-$1"
563
591
 
564
- echo; print_and_run "make"
565
- echo; print_and_run "sudo make install"
592
+ if [[ $platform == 'bsd' ]]; then
593
+ echo; print_and_run "gmake"
594
+ echo; print_and_run "sudo gmake install"
595
+ else
596
+ echo; print_and_run "make"
597
+ echo; print_and_run "sudo make install"
598
+ fi
566
599
 
567
600
  echo; print_task "Cleaning up" "\n"; echo
568
601
  print_and_run "rm -rf $tmp_dir"; echo
@@ -644,6 +677,29 @@ install() {
644
677
  # Uninstall ####################################################################
645
678
 
646
679
 
680
+ # Uninstalls SDL on BSD
681
+ uninstall_sdl_bsd() {
682
+
683
+ echo "The following packages will be removed:"
684
+ echo " sdl2"
685
+ echo " sdl2_image"
686
+ echo " sdl2_mixer"
687
+ echo " sdl2_ttf"
688
+
689
+ prompt_to_continue "Uninstall SDL now?"
690
+
691
+ echo; print_task "Uninstalling packages" "\n\n"
692
+ print_and_run "sudo pkg remove sdl2 sdl2_image sdl2_mixer sdl2_ttf"
693
+ echo
694
+
695
+ if have_sdl_libs?; then
696
+ echo; error_msg "SDL libraries did not uninstall correctly"
697
+ else
698
+ echo; info_msg "SDL was uninstalled successfully"
699
+ fi
700
+ }
701
+
702
+
647
703
  # Uninstalls SDL on Linux
648
704
  uninstall_sdl_linux() {
649
705
 
@@ -757,6 +813,8 @@ uninstall_sdl() {
757
813
 
758
814
  if [[ $platform == 'linux' ]]; then
759
815
  uninstall_sdl_linux
816
+ elif [[ $platform == 'bsd' ]]; then
817
+ uninstall_sdl_bsd
760
818
  elif [[ $platform == 'arm' ]]; then
761
819
  uninstall_sdl_source
762
820
  fi
@@ -1090,6 +1148,11 @@ elif [[ $unamestr == 'Linux' ]]; then
1090
1148
  elif [[ $unamestr =~ 'MINGW' ]]; then
1091
1149
  platform_display='Windows / MinGW'
1092
1150
  platform='mingw'
1151
+
1152
+ # BSD
1153
+ elif [[ $unamestr =~ 'BSD' ]]; then
1154
+ platform_display='BSD'
1155
+ platform='bsd'
1093
1156
  fi
1094
1157
 
1095
1158
  # Unsupported platform
@@ -1226,7 +1289,7 @@ case $1 in
1226
1289
  --libs)
1227
1290
  if [[ $platform == 'macos' ]]; then
1228
1291
  FLAGS='-Wl,-framework,OpenGL'
1229
- elif [[ $platform == 'linux' ]]; then
1292
+ elif [[ $platform == 'linux' || $platform == 'bsd' ]]; then
1230
1293
  FLAGS='-lGL -lm'
1231
1294
  elif [[ $platform == 'arm' ]]; then
1232
1295
  FLAGS='-lm -I/opt/vc/include/ -L/opt/vc/lib'
Binary file
data/bin/ruby2d CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'ruby2d/colorize'
3
+ require 'ruby2d/cli/colorize'
4
4
  require 'ruby2d/version'
5
5
 
6
6
  # Debugging command-line flag
@@ -1,5 +1,5 @@
1
1
  require 'mkmf'
2
- require_relative '../../lib/ruby2d/colorize'
2
+ require_relative '../../lib/ruby2d/cli/colorize'
3
3
 
4
4
  S2D_VERSION = '1.1.0' # Simple 2D minimum version required
5
5
  $errors = [] # Holds errors
@@ -1,7 +1,7 @@
1
1
  # Ruby2D module and native extension loader, adds DSL
2
2
 
3
3
  unless RUBY_ENGINE == 'mruby'
4
- require 'ruby2d/colorize'
4
+ require 'ruby2d/cli/colorize'
5
5
  require 'ruby2d/exceptions'
6
6
  require 'ruby2d/renderable'
7
7
  require 'ruby2d/color'
@@ -7,7 +7,7 @@ require 'fileutils'
7
7
 
8
8
  # The Ruby 2D library files
9
9
  @lib_files = [
10
- 'colorize',
10
+ 'cli/colorize',
11
11
  'exceptions',
12
12
  'renderable',
13
13
  'color',
@@ -0,0 +1,10 @@
1
+ # String#ruby2d_colorize
2
+
3
+ # Extend `String` to include some fancy colors
4
+ class String
5
+ def ruby2d_colorize(c); "\e[#{c}m#{self}\e[0m" end
6
+ def bold; ruby2d_colorize('1') end
7
+ def info; ruby2d_colorize('1;34') end
8
+ def warn; ruby2d_colorize('1;33') end
9
+ def error; ruby2d_colorize('1;31') end
10
+ end
@@ -1,5 +1,5 @@
1
1
  # Ruby2D::VERSION
2
2
 
3
3
  module Ruby2D
4
- VERSION = '0.9.2'
4
+ VERSION = '0.9.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby2d
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Black
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-26 00:00:00.000000000 Z
11
+ date: 2020-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -281,11 +281,11 @@ files:
281
281
  - lib/ruby2d.rb
282
282
  - lib/ruby2d/circle.rb
283
283
  - lib/ruby2d/cli/build.rb
284
+ - lib/ruby2d/cli/colorize.rb
284
285
  - lib/ruby2d/cli/console.rb
285
286
  - lib/ruby2d/cli/enable_console.rb
286
287
  - lib/ruby2d/cli/launch.rb
287
288
  - lib/ruby2d/color.rb
288
- - lib/ruby2d/colorize.rb
289
289
  - lib/ruby2d/dsl.rb
290
290
  - lib/ruby2d/exceptions.rb
291
291
  - lib/ruby2d/font.rb
@@ -321,7 +321,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
321
321
  - !ruby/object:Gem::Version
322
322
  version: '0'
323
323
  requirements: []
324
- rubygems_version: 3.0.3
324
+ rubygems_version: 3.1.2
325
325
  signing_key:
326
326
  specification_version: 4
327
327
  summary: Ruby 2D
@@ -1,10 +0,0 @@
1
- # String#colorize
2
-
3
- # Extend `String` to include some fancy colors
4
- class String
5
- def colorize(c); "\e[#{c}m#{self}\e[0m" end
6
- def bold; colorize('1') end
7
- def info; colorize('1;34') end
8
- def warn; colorize('1;33') end
9
- def error; colorize('1;31') end
10
- end