graphics 1.1.0 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67d82ed6f28d5e1a85f4bc54a31e67804e6f0071645c8174d96ee7eb72d5fa30
4
- data.tar.gz: ef980c42b79b48f48d8ecb143bc912c295b08171479d0e877f58baab4687ea39
3
+ metadata.gz: 77f69378932806144f098c0234730070067b715fad49389094e491824e43c009
4
+ data.tar.gz: ac579bcb9081b0ed9aa2f9dffff4659857919320360f01ba1f0d74b0a83c1248
5
5
  SHA512:
6
- metadata.gz: 2ed3a2b99b78e0910d63b8cc119a6f229364713026d1002a5e139ea8814472392db32051b3385e346b4c619adf27c81c068432dadf9719ca01fee9af994b1f89
7
- data.tar.gz: eac5fcf6f1576ac47a2f77e06b46b39fdc7489429f8e9099cbfa49140cfeacde037d8545140ad875542c3532c900c1a0ce550d8e6fcf7629cdf38eb7ff0cbc26
6
+ metadata.gz: ed79e3761f5acd978457d54fd93225a41ff8722d635141842f2125e057b6b8d9548f18ac33e010c0bef4ea813f9eb8045fe6fde59d60f82420d939d13584fc1d
7
+ data.tar.gz: 995279ada59cd448174c44f35e97a1f3e2a2329bb2c06d4233c3e11f8afb06afd193bae7c75a9a0e9b146ed968446106cdedf18b38709dcbbc9ea8aa16f305cd
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,27 @@
1
+ === 1.1.2 / 2024-12-07
2
+
3
+ * 1 minor enhancement:
4
+
5
+ * Bumped required ruby version.
6
+
7
+ * 3 bug fixes:
8
+
9
+ * Fixed bad copy/paste in setup script. (havenwood)
10
+ * Fixed color handling in polygon.
11
+ * Fixed frozen string literal in examples/editor.rb
12
+
13
+ === 1.1.1 / 2024-08-27
14
+
15
+ * 1 minor enhancement:
16
+
17
+ * Add basic package manager detection to deps script. (havenwood)
18
+
19
+ * 3 bug fixes:
20
+
21
+ * Fixed home link in readme/gemspec.
22
+ * Minor fix in ext/sdl/sge/sge_surface.cpp.
23
+ * Reorder installation instructions & format as code. (havenwood)
24
+
1
25
  === 1.1.0 / 2023-07-26
2
26
 
3
27
  * 3 minor enhancements:
data/README.rdoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = graphics
2
2
 
3
- home :: https://github.com/zenspider/graphics
3
+ home :: https://github.com/seattlerb/graphics
4
4
  rdoc :: http://docs.seattlerb.org/graphics
5
5
 
6
6
  == DESCRIPTION:
@@ -86,8 +86,8 @@ up-to-date versions.
86
86
 
87
87
  == INSTALL:
88
88
 
89
- * sudo gem install graphics
90
- * `curl -L https://tinyurl.com/graphics-setup | bash`
89
+ curl -L https://tinyurl.com/graphics-setup | bash
90
+ sudo gem install graphics
91
91
 
92
92
  == LICENSE:
93
93
 
data/Rakefile CHANGED
@@ -16,7 +16,7 @@ Hoe.spec "graphics" do
16
16
 
17
17
  extension :sdl
18
18
 
19
- require_ruby_version ">= 2.7"
19
+ require_ruby_version ">= 3.3"
20
20
 
21
21
  license "MIT"
22
22
  end
data/examples/editor.rb CHANGED
@@ -12,7 +12,7 @@ class Editor < Graphics::Simulation
12
12
  super 850, 850
13
13
 
14
14
  self.overlay = true
15
- self.s = ""
15
+ self.s = +""
16
16
  self.lines = []
17
17
  end
18
18
 
@@ -156,7 +156,7 @@ void sge_SetError(const char *format, ...)
156
156
  vsprintf(buf, format, ap);
157
157
  va_end(ap);
158
158
 
159
- SDL_SetError("%s", buf);
159
+ SDL_SetError(buf);
160
160
  }
161
161
 
162
162
 
data/graphics_setup.sh CHANGED
@@ -2,39 +2,48 @@
2
2
 
3
3
  set -v
4
4
 
5
- case `uname` in
5
+ case "$(uname -s)" in
6
6
  Darwin)
7
- echo "I'm on OSX. Not using sudo"
8
- SUDO=
7
+ if command -v brew >/dev/null; then
8
+ echo "Detected macOS. Installing dependencies with brew."
9
+ sudo=""
9
10
 
10
- brew install sdl2
11
- brew install sdl2_mixer
12
- brew install sdl2_ttf
13
- brew install sdl2_image
14
- brew install sdl2_gfx
11
+ brew install sdl2
12
+ brew install sdl2_mixer
13
+ brew install sdl2_ttf
14
+ brew install sdl2_image
15
+ brew install sdl2_gfx
16
+ else
17
+ echo "Detected macOS but not brew. Install Homebrew and try again."
18
+ exit 1
19
+ fi
15
20
  ;;
16
21
  Linux)
17
- echo "I'm on linux, using sudo where needed"
18
- SUDO=sudo
22
+ if command -v apt >/dev/null; then
23
+ echo "Detected Linux. Installing dependencies with apt."
24
+ sudo="sudo"
19
25
 
20
- $SUDO apt-get install --no-install-recommends --no-install-suggests libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev gcc g++
21
- ;;
26
+ $sudo apt-get install --no-install-recommends --no-install-suggests libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev gcc g++
27
+ else
28
+ echo "Detected Linux but not apt. Install sdl2 with your package manager."
29
+ exit 1
30
+ fi
31
+ ;;
22
32
  *)
23
- echo "Unknown OS $OSTYPE, aborting"
24
- exit 1
33
+ echo "Dependency installation not supported for your OS. Install sdl2 with your package manager."
34
+ exit 1
25
35
  ;;
26
36
  esac
27
37
 
28
- if [ -f $0 ]; then
29
- $SUDO gem update --system -N -V
30
- $SUDO gem install hoe --conservative
31
- $SUDO rake newb
38
+ if [ -f "$0" ]; then
39
+ $sudo gem install hoe --conservative
40
+ $sudo rake newb
32
41
  rake test
33
42
  rake clean package
34
- $SUDO gem install pkg/graphics*.gem
43
+ $sudo gem install pkg/graphics*.gem
35
44
  else
36
- $SUDO gem install graphics
45
+ $sudo gem install graphics
37
46
  fi
38
47
 
39
- echo "running a test... you should see a window show up."
48
+ echo "Running a graphics test... You should see a window appear."
40
49
  ruby -Ilib -rgraphics -e 'Class.new(Graphics::Simulation) { def draw n; clear :white; text "hit escape to quit", 100, 100, :black; end; }.new(500, 250, "Working!").run'
@@ -117,13 +117,10 @@ class Graphics::AbstractSimulation
117
117
  #
118
118
  # This also names a bunch colors and hues for convenience.
119
119
 
120
- def initialize w=nil, h=nil, name=self.class.name, full=false
120
+ def initialize w = nil, h = nil, name = self.class.name, full = false
121
121
  w ||= SDL::Screen::W/2
122
122
  h ||= SDL::Screen::H/2
123
123
 
124
- # TODO: remove for 1.0.0 final
125
- raise "Do NOT pass bpp to Simulation anymore" if !name || Integer === name
126
-
127
124
  full = full ? SDL::FULLSCREEN : 0
128
125
 
129
126
  self._bodies = []
@@ -504,7 +501,7 @@ class Graphics::AbstractSimulation
504
501
 
505
502
  xs, ys = points.transpose
506
503
 
507
- renderer.draw_polygon xs, ys.map { |y| h-y-1 }, c, :aa
504
+ renderer.draw_polygon xs, ys.map { |y| h-y-1 }, color[c], :aa
508
505
  end
509
506
 
510
507
  ##
data/lib/graphics.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # The top-level namespace.
3
3
 
4
4
  class Graphics
5
- VERSION = "1.1.0" # :nodoc:
5
+ VERSION = "1.1.2" # :nodoc:
6
6
  end
7
7
 
8
8
  require "graphics/simulation"
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -10,9 +10,9 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDPjCCAiagAwIBAgIBBzANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
13
+ MIIDPjCCAiagAwIBAgIBCDANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
14
14
  ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
15
- GRYDY29tMB4XDTIzMDEwMTA3NTExN1oXDTI0MDEwMTA3NTExN1owRTETMBEGA1UE
15
+ GRYDY29tMB4XDTI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O998ho6BSOgYBI9Yk1ttdCtti6Y+8N9+fZESsjtWMykA+WXWeGUScHqiU+gH8
29
+ S7043fq9EbQdBr2AXdj92+CDwuTfHI6/Hj5FVBDULufrJaan4xUgL70Hvc6pTTeW
30
+ deKfBjgVAq7EYHu1AczzlUly
31
31
  -----END CERTIFICATE-----
32
- date: 2023-07-26 00:00:00.000000000 Z
32
+ date: 2024-12-07 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rdoc
@@ -71,14 +71,14 @@ dependencies:
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '4.0'
74
+ version: '4.2'
75
75
  type: :development
76
76
  prerelease: false
77
77
  version_requirements: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '4.0'
81
+ version: '4.2'
82
82
  description: |-
83
83
  Graphics provides a simple framework to implement games and/or
84
84
  simulations and is designed to follow mathematical conventions, NOT
@@ -179,11 +179,11 @@ files:
179
179
  - test/test_graphics.rb
180
180
  - test/test_rainbows.rb
181
181
  - test/test_sdl.rb
182
- homepage: https://github.com/zenspider/graphics
182
+ homepage: https://github.com/seattlerb/graphics
183
183
  licenses:
184
184
  - MIT
185
185
  metadata:
186
- homepage_uri: https://github.com/zenspider/graphics
186
+ homepage_uri: https://github.com/seattlerb/graphics
187
187
  post_install_message:
188
188
  rdoc_options:
189
189
  - "--main"
@@ -194,14 +194,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
194
194
  requirements:
195
195
  - - ">="
196
196
  - !ruby/object:Gem::Version
197
- version: '2.7'
197
+ version: '3.3'
198
198
  required_rubygems_version: !ruby/object:Gem::Requirement
199
199
  requirements:
200
200
  - - ">="
201
201
  - !ruby/object:Gem::Version
202
202
  version: '0'
203
203
  requirements: []
204
- rubygems_version: 3.4.10
204
+ rubygems_version: 3.5.23
205
205
  signing_key:
206
206
  specification_version: 4
207
207
  summary: Graphics provides a simple framework to implement games and/or simulations
metadata.gz.sig CHANGED
Binary file