rubyapple 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 80f2fd2a37f82ad5a8b9f6b5886012200213bf733c7459948f26f357d9167508
4
+ data.tar.gz: b3b98dbafcfbabf800792f5eb0c8280884f988b2d2257c9cd7cc3cf14cb9fb4f
5
+ SHA512:
6
+ metadata.gz: a871989e6318450a264cb6e481b2beb39be59e53b595471df6ddcd21bc66bf1cda9997219bd8ef9facc805b1ebf796ea4a99d352a9d39f50aa3c579a91b1d576
7
+ data.tar.gz: bbc662830c865929a4d954c6e84ff939c95caa89b783eb5fe4e985912e2e7d3ed2cf207ebefbb4cedeb23e34110fd6c3b3a3b4e995d7a73c6fff125426926e51
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in rubyapple.gemspec
6
+ gemspec
data/README.md ADDED
@@ -0,0 +1,40 @@
1
+ ## Rubyapple
2
+
3
+ ## Contributing [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/dwyl/esta/issues)
4
+
5
+ ## Improvisation [![Improvised 100pct](https://img.shields.io/badge/Improvised-100%25-brightgreen.svg?longCache=true&style=plastic)](https://github.com/juksefantomet)
6
+
7
+
8
+ >This is Rubyapple
9
+ > A gem to convert a png picture into respective:
10
+ > apple-touch-icon-sizexsize.png
11
+ > and
12
+ > apple-touch-icon-sizexsize-precompiled.png
13
+ >
14
+
15
+ ## Installation
16
+
17
+ ```rb
18
+ gem install Rubyapple
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ NOTE! init should check if the name is in use or not, but we check to be certain.
24
+
25
+ ```rb
26
+ rubyapple picture.png
27
+ ```
28
+
29
+ output will be contained in the following folder where you invoked the command
30
+
31
+ ```rb
32
+ apple_images/*
33
+ ```
34
+
35
+ # Cloning/branching:
36
+
37
+ Make a pull request and make this a better one if you feel like it!
38
+
39
+ -- Juksefantomet
40
+
data/bin/rubyapple ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubyapple'
4
+
5
+ Rubyapple.new
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "rubyapple"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
15
+
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
9
+
@@ -0,0 +1,4 @@
1
+ module Rubyapple
2
+ VERSION = "0.0.1"
3
+ end
4
+
data/lib/rubyapple.rb ADDED
@@ -0,0 +1,35 @@
1
+ require 'rubygems'
2
+ require 'rmagick'
3
+ require 'fileutils'
4
+
5
+ class Rubyapple
6
+ def initialize
7
+ if !File.directory?('apple_images/')
8
+ puts "apple_images folder does not exist, please create it and run rubyapple again"
9
+ puts "----"
10
+ puts "rubyapple imagename.png"
11
+ return
12
+ end
13
+
14
+ img = Magick::Image.read(ARGV[0])[0].strip!
15
+
16
+ # apple-touch-icon-sizes.png
17
+ sizes = [16, 32, 57, 70, 76, 96, 114, 120, 144, 152, 167, 180, 270, 310]
18
+
19
+ temp = img
20
+
21
+ @numi = 0
22
+ (0..sizes.length).each do |x|
23
+ fsizes = "#{sizes[@numi]}x#{sizes[@numi]}"
24
+ fname = "apple-touch-icon-#{fsizes}.png"
25
+ fname2 = "apple-touch-icon-#{fsizes}-precomposed.png"
26
+ path = "apple_images/"
27
+ temp.resize_to_fill(sizes[@numi].to_i, sizes[@numi].to_i).write(path + "#{fname}")
28
+ temp.resize_to_fill(sizes[@numi].to_i, sizes[@numi].to_i).write(path + "#{fname2}")
29
+ if @numi < sizes.length - 1
30
+ @numi += 1
31
+ end
32
+ end
33
+
34
+ end
35
+ end
data/rubyapple.gemspec ADDED
@@ -0,0 +1,42 @@
1
+ lib = File.expand_path("../lib",__FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "rubyapple/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "rubyapple"
7
+ spec.version = Rubyapple::VERSION
8
+ spec.authors = ["Lars Grav"]
9
+ spec.email = ["larsgrav@gmail.com"]
10
+
11
+ spec.summary = %q{System command to logfile gem}
12
+ spec.description = %q{A gem to convert argument picture into apple-touch-icon and -precomposed .png files}
13
+ spec.homepage = "http://www.github.com/juksefantomet"
14
+ spec.license = "MIT"
15
+
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
18
+ #if spec.respond_to?(:metadata)
19
+ # spec.metadata["allowed_push_host"] = 'https://juksefantomet@git.fury.io'
20
+ #else
21
+ # raise "RubyGems 2.0 or newer is required to protect against " \
22
+ # "public gem pushes."
23
+ #end
24
+
25
+ # Specify which files should be added to the gem when it is released.
26
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
27
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
28
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
29
+ end
30
+ spec.bindir = "bin"
31
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
32
+ spec.require_paths = ["lib"]
33
+
34
+ spec.required_ruby_version = '>= 2.3'
35
+
36
+ spec.add_runtime_dependency 'rmagick', '~> 2.16', '>= 2.16.0'
37
+ spec.add_runtime_dependency 'fileutils', '~> 1.1', '>= 1.1.0'
38
+
39
+ spec.add_development_dependency "bundler", '~> 1.16', '>= 1.16.2'
40
+ spec.add_development_dependency "rake", '~> 12.3', '>= 12.3.1'
41
+ end
42
+
metadata ADDED
@@ -0,0 +1,136 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rubyapple
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Lars Grav
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-09-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rmagick
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.16'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 2.16.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '2.16'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 2.16.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: fileutils
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.1'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 1.1.0
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '1.1'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 1.1.0
53
+ - !ruby/object:Gem::Dependency
54
+ name: bundler
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '1.16'
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: 1.16.2
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '1.16'
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: 1.16.2
73
+ - !ruby/object:Gem::Dependency
74
+ name: rake
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: '12.3'
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 12.3.1
83
+ type: :development
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '12.3'
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: 12.3.1
93
+ description: A gem to convert argument picture into apple-touch-icon and -precomposed
94
+ .png files
95
+ email:
96
+ - larsgrav@gmail.com
97
+ executables:
98
+ - rubyapple
99
+ - rubyapple-console
100
+ - rubyapple-setup
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - Gemfile
105
+ - README.md
106
+ - bin/rubyapple
107
+ - bin/rubyapple-console
108
+ - bin/rubyapple-setup
109
+ - lib/rubyapple.rb
110
+ - lib/rubyapple/version.rb
111
+ - rubyapple.gemspec
112
+ homepage: http://www.github.com/juksefantomet
113
+ licenses:
114
+ - MIT
115
+ metadata: {}
116
+ post_install_message:
117
+ rdoc_options: []
118
+ require_paths:
119
+ - lib
120
+ required_ruby_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '2.3'
125
+ required_rubygems_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ requirements: []
131
+ rubyforge_project:
132
+ rubygems_version: 2.7.6
133
+ signing_key:
134
+ specification_version: 4
135
+ summary: System command to logfile gem
136
+ test_files: []