rapngasm 3.1.3 → 3.1.4pre

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
  SHA1:
3
- metadata.gz: 1fd3037dc303ca697c1a641e40a7f329ec63c73b
4
- data.tar.gz: b448bba078fb51cc2c8a78721626ca23f64ffc6c
3
+ metadata.gz: ba65067eac4d1ee22f66fb37fb88a8f8b020def7
4
+ data.tar.gz: 3eb0a2bd90e4b7c33a2816c00fb2ca824c77417d
5
5
  SHA512:
6
- metadata.gz: b19ec6123bc42125483bf151be4ee7ab61e400b9fbca61411b8f9598ed3339aa155d8ef926fc52d39a665fb3170a6b0b6efbab87212a33060aee2dceae0a3660
7
- data.tar.gz: e8d02218de7ac0ea809d3250c64ae0c5acb2b12148abb43da487dd6fb7ff1b1eb997a6d7d22e6988cb9ced6463c631deaac2f6e8a6ada0e224563ece7b2422e7
6
+ metadata.gz: b428af8011ea50c5f151228dad0534e74eb32d3eb892ea2fd38aba1dfd3346266df6dabf58b4ebb0bf5f779a96043a2e03b8ce0fa048061f640a8feea90ab6f4
7
+ data.tar.gz: a220a5a608d2ff460903c40fbd54c26a59d5fd5038effff6ca4ec501e5c6be8061bfdaa67a2b701238723953349c4733ad7537f7633e45afe1d4be9577e34f15
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ *.swp
2
+ *.swo
3
+ *.o
4
+ *.so
5
+ Gemfile.lock
6
+ tmp/
7
+ mkmkf.log
8
+ Makefile
9
+ .DS_Store
10
+ *.bundle
11
+ spec/out/*
data/.rubocop.yml ADDED
@@ -0,0 +1,14 @@
1
+ GlobalVars:
2
+ Enabled: false # catches on extconf, which needs globals
3
+
4
+ AsciiIdentifiers:
5
+ Enabled: false
6
+
7
+ AsciiComments:
8
+ Enabled: false
9
+
10
+ AccessorMethodName:
11
+ Enabled: false
12
+
13
+ LineLength:
14
+ Max: 99
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development do
6
+ gem 'libnotify'
7
+ gem 'guard'
8
+ gem 'guard-rspec'
9
+ gem 'rubocop'
10
+ gem 'guard-rubocop'
11
+ end
data/Guardfile ADDED
@@ -0,0 +1,12 @@
1
+ guard :rubocop do
2
+ watch(%r{.+\.rb$})
3
+ watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
4
+ end
5
+
6
+ guard :rspec do
7
+ watch(%r{^spec/.+_spec\.rb$})
8
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
9
+ watch('spec/spec_helper.rb') { "spec" }
10
+
11
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
12
+ end
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ rapngasm [![Gem Version](https://badge.fury.io/rb/rapngasm.svg)](http://badge.fury.io/rb/rapngasm)
2
+ ========
3
+ Ruby interface for apngasm
4
+
5
+ Requirements
6
+ ------------
7
+ rapngasm requires libapngasm. Install instructions can be found in the "Installing" section [here](https://github.com/apngasm/apngasm).
8
+
9
+ Building
10
+ --------
11
+ ```
12
+ rake compile
13
+ ```
14
+
15
+ Specs!
16
+ ------
17
+ ```
18
+ rspec
19
+ ```
20
+
21
+ License
22
+ -------
23
+ libpng
24
+
25
+ Support
26
+ -------
27
+ File a github issue
28
+
29
+ Expediated Support
30
+ ------------------
31
+ PayPal to corporate@genshin.org
32
+
33
+ Copyright
34
+ ---------
35
+ Genshin Souzou Kabushiki Kaisha
36
+ apngasm is copyright Max Stepin & Genshin Souzou K.K.
37
+
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ require 'rake/extensiontask'
2
+
3
+ spec = Gem::Specification.load('rapngasm.gemspec')
4
+ Rake::ExtensionTask.new('rapngasm', spec)
data/rapngasm.gemspec ADDED
@@ -0,0 +1,18 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'rapngasm'
3
+ s.version = '3.1.4pre'
4
+ s.license = 'libpng/zlib'
5
+ s.summary = 'apngasm for Ruby'
6
+ s.description = 'Ruby native extension for the apngasm APNG Assembler.'
7
+ s.authors = ['Rei Kagetsuki', 'Rika Yoshida']
8
+ s.email = 'zero@genshin.org'
9
+ s.homepage = 'http://www.github.com/apngasm/rapngasm'
10
+
11
+ s.files = `git ls-files`.split("\n")
12
+
13
+ s.extensions = ['ext/rapngasm/extconf.rb']
14
+ s.require_paths = ['lib', 'ext']
15
+
16
+ s.add_development_dependency 'rake-compiler', '~> 0.9', '~> 0.9.2'
17
+ s.add_development_dependency 'rice', '~> 1.6', '~> 1.6.2'
18
+ end
@@ -0,0 +1,90 @@
1
+ require 'rapngasm'
2
+
3
+ describe 'APNGAsm' do
4
+ let(:apngasm) do
5
+ APNGAsm.new
6
+ end
7
+
8
+ let(:apngframe) do
9
+ APNGFrame.new
10
+ end
11
+
12
+ describe 'APNGAsm.new' do
13
+ it 'creates an apngasm object' do
14
+ expect(apngasm).to be_an_instance_of(APNGAsm)
15
+ end
16
+ end
17
+
18
+ describe 'APNGFrame.new' do
19
+ it 'creates an APNG Frame object' do
20
+ expect(apngframe).to be_an_instance_of(APNGFrame)
21
+ end
22
+ end
23
+
24
+ describe '.version' do
25
+ it 'outputs the native APNGAsm library version' do
26
+ expect(apngasm.version).to be
27
+ end
28
+ end
29
+
30
+ describe '.add_frame' do
31
+ it 'add an APNGFrame object into apngasm' do
32
+ expect(apngasm.add_frame(apngframe)).to eq(1)
33
+ end
34
+ end
35
+
36
+ describe '.add_frame_file' do
37
+ it 'add an APNGFrame object into apngasm' do
38
+ expect(apngasm.add_frame_file('./spec/support/test1.png', 100, 1000)).to eq(1)
39
+ end
40
+ end
41
+
42
+ describe '.add_frame_rgb' do
43
+ it 'add an APNGFrame object made from rgb data into apngasm' do
44
+ size = 64
45
+ rgb = []
46
+ ((size * size) - 1).times do
47
+ rgb << [Random.rand(256), Random.rand(256), Random.rand(256)]
48
+ end
49
+
50
+ frame_count = apngasm.add_frame_rgb(rgb, size, size)
51
+ expect(frame_count).to eq(1)
52
+ apngasm.assemble('./spec/support/rgb.png')
53
+ end
54
+ end
55
+
56
+ describe '.add_frame_rgba' do
57
+ it 'add an APNGFrame object made from rgba data into apngasm' do
58
+ size = 64
59
+ rgba = []
60
+ ((size * size) - 1).times do
61
+ rgba << [Random.rand(256), Random.rand(256), Random.rand(256),
62
+ Random.rand(256)]
63
+ end
64
+
65
+ frame_count = apngasm.add_frame_rgba(rgba, size, size)
66
+ expect(frame_count).to eq(1)
67
+ apngasm.assemble('./spec/support/rgba.png')
68
+ end
69
+ end
70
+
71
+ describe '.assemble' do
72
+ it 'creates an animated PNG file from frames' do
73
+ apngasm.add_frame_file('./spec/support/test1.png', 100, 1000)
74
+ apngasm.add_frame_file('./spec/support/test2.png', 100, 1000)
75
+ Dir.mkdir('./spec/out') unless Dir.exist?('./spec/out')
76
+ apngasm.assemble('./spec/out/apngasm_anim.png')
77
+ expect(File.exist?('./spec/out/apngasm_anim.png')).to eq(true)
78
+ FileUtils.rm_rf('./spec/out')
79
+ end
80
+ end
81
+
82
+ describe '.disassemble' do
83
+ it 'disassemble the frames of an anmated PNG file into PNGs' do
84
+ Dir.mkdir('./spec/out') unless Dir.exist?('./spec/out')
85
+ apngframes = apngasm.disassemble('./spec/out/apngasm_anim.png')
86
+ expect(apngframes).to be_an_instance_of(Array)
87
+ FileUtils.rm_rf('./spec/out')
88
+ end
89
+ end
90
+ end
File without changes
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rapngasm
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.3
4
+ version: 3.1.4pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rei Kagetsuki
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-07 00:00:00.000000000 Z
12
+ date: 2014-09-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake-compiler
@@ -21,7 +21,7 @@ dependencies:
21
21
  - - "~>"
22
22
  - !ruby/object:Gem::Version
23
23
  version: 0.9.2
24
- type: :runtime
24
+ type: :development
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
@@ -41,7 +41,7 @@ dependencies:
41
41
  - - "~>"
42
42
  - !ruby/object:Gem::Version
43
43
  version: 1.6.2
44
- type: :runtime
44
+ type: :development
45
45
  prerelease: false
46
46
  version_requirements: !ruby/object:Gem::Requirement
47
47
  requirements:
@@ -58,9 +58,21 @@ extensions:
58
58
  - ext/rapngasm/extconf.rb
59
59
  extra_rdoc_files: []
60
60
  files:
61
+ - ".gitignore"
62
+ - ".rubocop.yml"
63
+ - Gemfile
64
+ - Guardfile
65
+ - README.md
66
+ - Rakefile
61
67
  - ext/rapngasm/apngasm_ruby.h
62
68
  - ext/rapngasm/extconf.rb
63
69
  - ext/rapngasm/rapngasm.cpp
70
+ - rapngasm.gemspec
71
+ - spec/rapngasm_spec.rb
72
+ - spec/spec_helper.rb
73
+ - spec/support/apngasm.png
74
+ - spec/support/test1.png
75
+ - spec/support/test2.png
64
76
  homepage: http://www.github.com/apngasm/rapngasm
65
77
  licenses:
66
78
  - libpng/zlib
@@ -69,6 +81,7 @@ post_install_message:
69
81
  rdoc_options: []
70
82
  require_paths:
71
83
  - lib
84
+ - ext
72
85
  required_ruby_version: !ruby/object:Gem::Requirement
73
86
  requirements:
74
87
  - - ">="
@@ -76,9 +89,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
89
  version: '0'
77
90
  required_rubygems_version: !ruby/object:Gem::Requirement
78
91
  requirements:
79
- - - ">="
92
+ - - ">"
80
93
  - !ruby/object:Gem::Version
81
- version: '0'
94
+ version: 1.3.1
82
95
  requirements: []
83
96
  rubyforge_project:
84
97
  rubygems_version: 2.2.2