gray_scott_gtk3 0.5.4 → 0.5.5

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: 2d6144fd61b89a4f478d3551ed4648ce9fe10bba4b6c61b0dcb40aa596c21d82
4
- data.tar.gz: 8cb60d9a0a48f7abbaae085fc11e8d1347d39879108ca904d0d809b464dedef9
3
+ metadata.gz: 1fd6bafca69957ca5cc59d33544dc6b9952d0b5d225efb65e8ad27afa800fda5
4
+ data.tar.gz: cdafc69e4ef9de1c28831734394d99bef2dded4b1aba75e7045d95f204f67ce6
5
5
  SHA512:
6
- metadata.gz: '099e6543d57bdd095f6ff28ee74291dbca5ab089a07d7b304c9b91afe28583d2f71686fb66f97f8434c3e9b4ddeb5544890b6ac9b710944c8c3c04e0a24887ba'
7
- data.tar.gz: 629899205425c0d7caab3c62f4adeec2e6694d66fa33bd22e6674045c787c02ce40f065855785a42a1515a5803bbf687477843d18b53885036af920c5f54c1a7
6
+ metadata.gz: b3e837611848aeb5e9dc566c3da244c5872590eefbc539bdf9111761f6d0180f584d721bc50b630b6ab008a25ecb4f017b12021820c45bd1bf8c3712b7c7516c
7
+ data.tar.gz: 331f8d90692858a220e60ce3a3a42eaf5b170dc80f8ae3b44b8182079bb8fc022d178fc934cebfd63fc134c1d0dc99b5a195c8a3aecc96c1b7bf66ef6bc02931
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
 
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'bundler/setup'
4
5
  require 'gray_scott_gtk3'
@@ -1,11 +1,12 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'optparse'
4
5
 
5
- opt = {}
6
+ opt = { width: 256, height: 256 }
6
7
  OptionParser.new do |op|
7
- op.on('-h val', '--height', 'height of the model') { |v| opt[:height] = v.to_i }
8
- op.on('-w val', '--width', 'width of the model') { |v| opt[:width] = v.to_i }
8
+ op.on('-h val', '--height', 'height of the model', Integer) { |v| opt[:height] = v }
9
+ op.on('-w val', '--width', 'width of the model', Integer) { |v| opt[:width] = v }
9
10
  op.on('-g', '--gpu', 'use GPU(Cumo)') { |v| opt[:gpu] = v }
10
11
  op.parse!(ARGV)
11
12
  end
@@ -19,7 +20,7 @@ module GrayScott
19
20
  class << self
20
21
  def run(opt)
21
22
  xml_path = File.expand_path('../resources/', __dir__)
22
- Controller.new(xml_path, opt)
23
+ Controller.new(xml_path, height: opt[:height], width: opt[:width])
23
24
  Gtk.main
24
25
  end
25
26
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  lib = File.expand_path('lib', __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'gray_scott/version'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'gtk3'
2
4
 
3
5
  if Object.const_defined? :Cumo
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GrayScott
2
4
  module Color
3
5
  include XumoShortHand
@@ -79,7 +81,7 @@ module GrayScott
79
81
 
80
82
  def grayscale(ar)
81
83
  d = ar * 255
82
- UInt8.dstack([d, d, d])
84
+ uInt8_dstack([d, d, d])
83
85
  end
84
86
 
85
87
  private
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'controller/aboutdialog'
2
4
 
3
5
  module GrayScott
@@ -13,7 +15,7 @@ module GrayScott
13
15
  @model = Model.new(height: height, width: width)
14
16
  @show_u = false
15
17
  @color = 'colorful'
16
- @frames = 1
18
+ @frames = 5
17
19
  @msec = 40
18
20
 
19
21
  builder = Gtk::Builder.new
@@ -1,14 +1,21 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GrayScott
2
4
  class Controller
3
5
  class AboutDialog
4
6
  def initialize(resource_dir)
5
- @a = Gtk::AboutDialog.new
6
- @a.program_name = 'Gray-Scott'
7
- @a.logo = GdkPixbuf::Pixbuf.new(file: File.join(resource_dir, 'about_icon.png'))
8
- @a.authors = ['kojix2']
9
- @a.version = GrayScott::VERSION
10
- @a.run
11
- @a.destroy
7
+ Gtk::AboutDialog.new.tap do |d|
8
+ d.program_name = 'Gray-Scott'
9
+ d.comments = 'Reaction diffusion system'
10
+ d.logo = GdkPixbuf::Pixbuf.new(file: File.join(resource_dir, 'about_icon.png'))
11
+ d.copyright = 'Copyright (C) kojix2'
12
+ d.authors = ['kojix2']
13
+ d.version = GrayScott::VERSION
14
+ d.website = 'https://github.com/kojix2/Gray-Scott'
15
+ d.website_label = 'Github kojix2/Gray-Scott'
16
+ d.run
17
+ d.destroy
18
+ end
12
19
  end
13
20
  end
14
21
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GrayScott
2
4
  # Gray-Scott model
3
5
  class Model
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GrayScott
2
4
  module Utils
3
5
  module Math
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module GrayScott
2
- VERSION = '0.5.4'.freeze
4
+ VERSION = '0.5.5'
3
5
  end
@@ -10,8 +10,9 @@
10
10
  <signal name="value-changed" handler="on_f_changed" swapped="no"/>
11
11
  </object>
12
12
  <object class="GtkAdjustment" id="frames">
13
+ <property name="lower">1</property>
13
14
  <property name="upper">1000</property>
14
- <property name="value">1</property>
15
+ <property name="value">5</property>
15
16
  <property name="step_increment">1</property>
16
17
  <property name="page_increment">10</property>
17
18
  <signal name="value-changed" handler="on_frames_changed" swapped="no"/>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gray_scott_gtk3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - kojix2
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-31 00:00:00.000000000 Z
11
+ date: 2020-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gtk3
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  requirements: []
127
- rubygems_version: 3.0.3
127
+ rubygems_version: 3.1.2
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Gray-Scott model.