moiristo-tileup 1.0.0 → 1.0.1

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
- SHA1:
3
- metadata.gz: c2f73ac375c4eacafa750e4e03ef7343fa988544
4
- data.tar.gz: c6ec4fe16e14a3c943fe5f486359df568873fbf0
2
+ SHA256:
3
+ metadata.gz: 7dd89cc58c1fe5d6687136a0bfb036c4abff99b56ac5fcec1a0b11426cd460ed
4
+ data.tar.gz: dfaffe0196f5c566cec83ff90a577c66789863a7c5b3f2acbf9bfaf70d9a11e0
5
5
  SHA512:
6
- metadata.gz: 5f037259541831f2af80bf5cfc74ea9a66fc6e51c0b346aa2d9032d7b2dfc1c8c244b65c4d1d139c759e695e6cfa4c0a3bdf154c56a5afcdb52b760cfae833a6
7
- data.tar.gz: 31751b7bc4d79339912bed4fc4e057005332b60f27b051009b27eda19ce5cefc7c3238e676359775813f544e859f2e867f003aca3fa5b489feb1b202c8adb1e5
6
+ metadata.gz: 186108e84103aa0dbf47a54312ca3b6c07381fce30cc9529b8150043b4fdfdb1f607186753866767d4399d224d02948ccca1e2b0f3896be20714b9700cd0e663
7
+ data.tar.gz: d0bf44fbf1a5f9b2517e7a125888decf92fb0aaaa4456a2ccf27a47ba963423a01321a762fe372ae8e602b12b20aa2e09f2104a16740bfb3d9e8a4817d59e516
@@ -1,22 +1,23 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- moiristo-tileup (1.0.0)
4
+ moiristo-tileup (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- coderay (1.1.0)
10
- method_source (0.8.2)
11
- mini_magick (4.7.0)
12
- minitest (5.10.2)
13
- pry (0.10.3)
9
+ coderay (1.1.2)
10
+ metaclass (0.0.4)
11
+ method_source (0.9.0)
12
+ mini_magick (4.8.0)
13
+ minitest (5.11.3)
14
+ mocha (1.3.0)
15
+ metaclass (~> 0.0.1)
16
+ pry (0.11.3)
14
17
  coderay (~> 1.1.0)
15
- method_source (~> 0.8.1)
16
- slop (~> 3.4)
18
+ method_source (~> 0.9.0)
17
19
  rake (10.5.0)
18
20
  rmagick (2.16.0)
19
- slop (3.6.0)
20
21
 
21
22
  PLATFORMS
22
23
  ruby
@@ -25,10 +26,11 @@ DEPENDENCIES
25
26
  bundler (~> 1.13)
26
27
  mini_magick (~> 4.7)
27
28
  minitest (~> 5.10)
29
+ mocha
28
30
  moiristo-tileup!
29
31
  pry
30
32
  rake (~> 10.0)
31
33
  rmagick (~> 2.16)
32
34
 
33
35
  BUNDLED WITH
34
- 1.15.3
36
+ 1.16.1
File without changes
data/README.md CHANGED
@@ -8,7 +8,10 @@
8
8
 
9
9
  ## Installation
10
10
 
11
- `gem install moiristo-tileup`
11
+ * Manual:
12
+ * `gem install moiristo-tileup`
13
+ * Gemfile:
14
+ * `gem 'moiristo-tileup', require: 'tileup'`
12
15
 
13
16
  `tileup` requires `rmagick` or `mini_magick` for image manipulation, which depends on `imagemagick`. `imagemagick` is avaliable through `homebrew`.
14
17
 
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'rake/testtask'
2
+ require 'bundler/gem_tasks'
2
3
 
3
4
  Rake::TestTask.new do |t|
4
5
  t.libs << 'test'
@@ -57,7 +57,7 @@ module TileUp
57
57
  raise NotImplementedError
58
58
  end
59
59
 
60
- def crop_image image, crop, extend_crop: false, extend_color: 'none'
60
+ def crop_and_save_image image, crop, filename:, extend_crop: false, extend_color: 'none'
61
61
  raise NotImplementedError
62
62
  end
63
63
 
@@ -26,7 +26,12 @@ module TileUp
26
26
  self.logger = TileUp::Logger.build(options.logger, :info, verbose: options.verbose)
27
27
  self.image_processor = TileUp::ImageProcessor.build(options.processor, logger)
28
28
  self.image = image_processor.open(image_filename)
29
- self.extension = image_filename.split(".").last
29
+
30
+ self.extension = if File.exist?(image_filename)
31
+ File.extname(image_filename)
32
+ else
33
+ File.extname(URI(image_filename).path)
34
+ end
30
35
 
31
36
  %w(tile_width tile_height).each{|dimension| options[dimension] = options[dimension].to_i }
32
37
 
@@ -102,7 +107,7 @@ module TileUp
102
107
  logger.info "Tiling image into columns: #{num_columns}, rows: #{num_rows}"
103
108
 
104
109
  crops_for(num_columns, num_rows).map do |crop|
105
- filename = "#{filename_prefix}_#{crop[:column]}_#{crop[:row]}.#{extension}"
110
+ filename = "#{filename_prefix}_#{crop[:column]}_#{crop[:row]}#{extension}"
106
111
  is_edge = (crop[:row] == num_rows - 1 || crop[:column] == num_columns - 1)
107
112
  image_processor.crop_and_save(base_image, crop, filename: filename, extend_crop: options.extend_incomplete_tiles && is_edge, extend_color: options.extend_color)
108
113
  filename
@@ -1,3 +1,3 @@
1
1
  module TileUp
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency 'rake', '~> 10.0'
27
27
  spec.add_development_dependency 'minitest', '~> 5.10'
28
28
  spec.add_development_dependency 'pry'
29
+ spec.add_development_dependency 'mocha'
29
30
 
30
31
  spec.add_development_dependency 'rmagick', '~> 2.16'
31
32
  spec.add_development_dependency 'mini_magick', '~> 4.7'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moiristo-tileup
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reinier de Lange
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-18 00:00:00.000000000 Z
11
+ date: 2018-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: mocha
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rmagick
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -106,7 +120,7 @@ files:
106
120
  - CHANGES.md
107
121
  - Gemfile
108
122
  - Gemfile.lock
109
- - LICENCE.txt
123
+ - LICENSE.txt
110
124
  - README.md
111
125
  - Rakefile
112
126
  - bin/tileup
@@ -140,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
154
  version: '0'
141
155
  requirements: []
142
156
  rubyforge_project:
143
- rubygems_version: 2.4.8
157
+ rubygems_version: 2.7.5
144
158
  signing_key:
145
159
  specification_version: 4
146
160
  summary: Turn an image into an X,Y tile set for use with JS mapping libraries