pixavatar 0.0.1 → 0.0.2

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
  SHA1:
3
- metadata.gz: 5a0174f3ccb4be7591e06897565394ca04641c38
4
- data.tar.gz: 902414f411a2793b839194c8341371639eb3d0c4
3
+ metadata.gz: ba36bf2373056f6d8571bec4c0b4184db6c02f81
4
+ data.tar.gz: 6825e3a0083e732dc157fca1ee410d3b790c0e49
5
5
  SHA512:
6
- metadata.gz: dbe58aad9dc4b576acc3a579953e3bba548aa2554e50b2a96e2d3ef054915ea516664f795ad612b1b854e49cc12e15194a15c24f4fe0e5241479253483996374
7
- data.tar.gz: c8494cde816f6d4958977f6a1d3b850e3312f3ef0a2c89096b8fc7dd4c873e4b447534d61969e6850606d63c8c7a871b41219a6475f6f7bed08d01a238364941
6
+ metadata.gz: 7b1346c9ba82748f349171a9f210df94b93375f336ba73aa0b091a447f42359f8adcba9c3c66e571892158dfb7651fb9e310e78019394ba276e902dfba9113a2
7
+ data.tar.gz: 30951d99b9a8ac1dbf25f294922eb468831d098c7012ba1a1bdfdb359ff14be7d8dab552b024976408c9f5a96830572418522994ca6861dcd41ff9e4d4c04e8a
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ *.gem
2
+ /tmp/*
3
+ *.png
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 array101
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # pixavatar
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/pixavatar.svg)](https://badge.fury.io/rb/pixavatar)
4
+
5
+ generate unique pixel avatar for users
6
+
7
+ ## How to use
8
+
9
+ - IRB
10
+
11
+ ```bash
12
+ $ gem install pixavatar
13
+ $ irb
14
+ > require 'pixavatar'
15
+ #=> true
16
+ > Pixavatar.draw_image('hello')
17
+ #=> generates and saves image on $PWD
18
+ ```
19
+
20
+
21
+
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require 'rspec/core/rake_task'
2
+ require 'bundler/gem_tasks'
3
+
4
+ # Default directory to look in is `/spec`
5
+ # Run with `rake spec`
6
+ RSpec::Core::RakeTask.new(:spec) do |task|
7
+ task.rspec_opts = ['--color', '--format progress']
8
+ end
9
+
10
+ task :default => :spec
data/bin/pixavatar ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'pixavatar'
4
+ if ARGV[0]
5
+ Pixavatar.draw_image(ARGV[0])
6
+ else
7
+ puts 'USE: pixavatar <string>'
8
+ puts 'Please pass a string to generate the image'
9
+ end
data/lib/pixavatar.rb CHANGED
@@ -71,11 +71,9 @@ class Pixavatar
71
71
  end
72
72
  end
73
73
  pixel_grid.compact
74
- end
75
-
74
+ end
76
75
 
77
76
  end
78
77
 
79
- Pixavatar.draw_image('sandeep')
80
78
 
81
79
 
@@ -0,0 +1,4 @@
1
+ module Pixavatar
2
+ VERSION = '0.0.2'
3
+ end
4
+
data/pixavatar.gemspec ADDED
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require "pixavatar/version"
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "pixavatar"
9
+ s.version = Pixavatar::VERSION
10
+ s.summary = "generate unique pixel avatar image"
11
+ s.description = "Pixavatar is a simple placeholder image generator that can be used as filler images where avatar images are missing"
12
+ s.authors = ["Sandeep"]
13
+ s.email = "acharya_sandeep@hotmail.com"
14
+ s.homepage = "https://github.com/array101/pixavatar"
15
+ s.license = "Beerware"
16
+
17
+ s.files = `git ls-files -z`.split("\x0")
18
+ s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
20
+
21
+ s.add_development_dependency("rspec", "~> 3")
22
+ s.add_development_dependency("pry", "~> 0")
23
+
24
+ s.add_runtime_dependency("chunky_png", "~> 1.3")
25
+ end
26
+
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe Pixavatar do
4
+ before do
5
+ @pixavatar = Pixavatar.new('hello')
6
+ end
7
+
8
+ context 'instantiate' do
9
+ it "assigns color RGB hash" do
10
+ expect(@pixavatar.avatar).to have_key(:color)
11
+ end
12
+
13
+ it "assigns grid value" do
14
+ expect(@pixavatar.avatar).to have_key(:grid)
15
+ end
16
+ end
17
+
18
+ end
@@ -0,0 +1,2 @@
1
+ require "pixavatar"
2
+ require "pry"
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pixavatar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandeep
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-04 00:00:00.000000000 Z
11
+ date: 2017-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: pry
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
13
41
  - !ruby/object:Gem::Dependency
14
42
  name: chunky_png
15
43
  requirement: !ruby/object:Gem::Requirement
@@ -24,14 +52,24 @@ dependencies:
24
52
  - - "~>"
25
53
  - !ruby/object:Gem::Version
26
54
  version: '1.3'
27
- description: Pixavatar is a simple placeholder image generator that can be used in
28
- placeholder images where avatar images are missing
55
+ description: Pixavatar is a simple placeholder image generator that can be used as
56
+ filler images where avatar images are missing
29
57
  email: acharya_sandeep@hotmail.com
30
- executables: []
58
+ executables:
59
+ - pixavatar
31
60
  extensions: []
32
61
  extra_rdoc_files: []
33
62
  files:
63
+ - ".gitignore"
64
+ - LICENSE
65
+ - README.md
66
+ - Rakefile
67
+ - bin/pixavatar
34
68
  - lib/pixavatar.rb
69
+ - lib/pixavatar/version.rb
70
+ - pixavatar.gemspec
71
+ - spec/pixavatar_spec.rb
72
+ - spec/spec_helper.rb
35
73
  homepage: https://github.com/array101/pixavatar
36
74
  licenses:
37
75
  - Beerware
@@ -56,4 +94,6 @@ rubygems_version: 2.6.8
56
94
  signing_key:
57
95
  specification_version: 4
58
96
  summary: generate unique pixel avatar image
59
- test_files: []
97
+ test_files:
98
+ - spec/pixavatar_spec.rb
99
+ - spec/spec_helper.rb