placegant 1.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
+ SHA1:
3
+ metadata.gz: dafdbfd7c32938853452e5c42128ff9ddc647b1c
4
+ data.tar.gz: 861e1f3031ec0cba0e00b32aef351cca700896a4
5
+ SHA512:
6
+ metadata.gz: f60526e5a40c75bbcc0139f6a447512bb243196795af9fbe53943d363aad68cdee5b2b701e762234a45edf0d9a807ad4993f5d58d887d40e9536ef362bb8afa9
7
+ data.tar.gz: 197808975e2c5d838a746b615ac429db402624561e13491cd24a9f0c28ef7208bd0d969adf1e69021d108a5ecfc89f99495c8d8c8be16ecd3cfa542ea86f0a14
data/.gitignore ADDED
@@ -0,0 +1,7 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ .rvmrc
6
+ .yardoc/*
7
+ doc/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in placegant.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,23 @@
1
+ License
2
+ -------
3
+ MIT License
4
+
5
+ Copyright (c) 2015 Angie Green & the Bayou Binary Bitches
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ placeGant
2
+ ===========
3
+
4
+ placegant is a small library for generating [placeGants](http://placeGant.me/).
5
+
6
+ Installing
7
+ ----------
8
+
9
+ placegant is available on [RubyGems](http://rubygems.org/gems/placegant).
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ gem 'placegant'
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install placegant
22
+
23
+ Examples
24
+ --------
25
+
26
+ # Generate a 300x400 placeGant
27
+ PlaceGant.image(300, 400) => "http://placegant.me/pg/300/400"
28
+
29
+ Rails Helpers
30
+ -------------
31
+
32
+ # in Gemfile:
33
+ gem 'placegant'
34
+
35
+ # in app/helpers/application_helper.rb:
36
+ module ApplicationHelper
37
+ include PlaceGant::Helpers
38
+ end
39
+
40
+ # in your views:
41
+ <%= image_tag placegant(400, 500) %>
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ require 'bundler'
2
+ require 'rake/testtask'
3
+ Bundler::GemHelper.install_tasks
4
+
5
+ desc "Run basic tests"
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "lib"
8
+ t.pattern = "test/*_test.rb"
9
+ t.verbose = true
10
+ t.warning = true
11
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.1
@@ -0,0 +1,7 @@
1
+ module PlaceGant::Helpers
2
+ # @see PlaceGant.image
3
+ def placegant(width = nil, height = nil)
4
+ "http://placegant.me/pg/#{width}/#{height}"
5
+ end
6
+ end
7
+
@@ -0,0 +1,23 @@
1
+ class PlaceGant
2
+ DEFAULT_WIDTH = 300
3
+ DEFAULT_HEIGHT = 300
4
+
5
+ # Returns the URL for a placeGant with
6
+ # the given width and height. If the width is given but the height
7
+ # is not, the image will be square.
8
+ #
9
+ # @param [Number] width the width of the placeGant
10
+ # @param [Number] height the height of the placeGant
11
+ def self.image(width = nil, height = nil)
12
+ if width.nil?
13
+ width = DEFAULT_WIDTH
14
+ height = DEFAULT_HEIGHT
15
+ elsif height.nil?
16
+ height = width
17
+ end
18
+ end
19
+
20
+ class << self
21
+ alias_method :gant, :image
22
+ end
23
+ end
data/lib/placegant.rb ADDED
@@ -0,0 +1,2 @@
1
+ require 'placegant/placegant'
2
+ require 'placegant/helpers'
data/placegant.gemspec ADDED
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "placegant"
6
+ s.version = File.read('VERSION').strip
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ["Angie Green"]
9
+ s.email = ["angie@angieraegreen.com"]
10
+ s.homepage = "https://github.com/AngieGreen/placegant"
11
+ s.summary = %q{A small library to generate placeGant images.}
12
+ s.description = %q{A small library to generate placeGant images.}
13
+
14
+ s.rubyforge_project = "placegant"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+ end
@@ -0,0 +1,10 @@
1
+ require 'placegant'
2
+ require 'test/unit'
3
+
4
+ class GantRailsTest < Test::Unit::TestCase
5
+ include PlaceGant::Helpers
6
+ def test_placegant_helper
7
+ image = placegant(400, 500)
8
+ assert_equal "http://placegant.me/pg/400/500", image
9
+ end
10
+ end
@@ -0,0 +1,20 @@
1
+ require 'placegant'
2
+ require 'test/unit'
3
+
4
+ class GantTest < Test::Unit::TestCase
5
+ def test_no_params
6
+ image = PlaceGant.image
7
+ assert_equal "http://placegant.me/pg/#{PlaceGant::DEFAULT_WIDTH}/#{PlaceGant::DEFAULT_HEIGHT}", image
8
+ end
9
+
10
+ def test_width_height
11
+ image = PlaceGant.image(300, 200)
12
+ assert_equal "http://placegant.me/pg/300/200", image
13
+ end
14
+
15
+ def test_image_alias
16
+ image = PlaceGant.gant(300, 200)
17
+ assert_equal "http://placegant.me/pg/300/200", image
18
+ end
19
+
20
+ end
metadata ADDED
@@ -0,0 +1,55 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: placegant
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Angie Green
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-23 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A small library to generate placeGant images.
14
+ email:
15
+ - angie@angieraegreen.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".gitignore"
21
+ - Gemfile
22
+ - LICENSE.txt
23
+ - README.md
24
+ - Rakefile
25
+ - VERSION
26
+ - lib/placegant.rb
27
+ - lib/placegant/helpers.rb
28
+ - lib/placegant/placegant.rb
29
+ - placegant.gemspec
30
+ - test/placegant_helpers_test.rb
31
+ - test/placegant_test.rb
32
+ homepage: https://github.com/AngieGreen/placegant
33
+ licenses: []
34
+ metadata: {}
35
+ post_install_message:
36
+ rdoc_options: []
37
+ require_paths:
38
+ - lib
39
+ required_ruby_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ required_rubygems_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ requirements: []
50
+ rubyforge_project: placegant
51
+ rubygems_version: 2.2.3
52
+ signing_key:
53
+ specification_version: 4
54
+ summary: A small library to generate placeGant images.
55
+ test_files: []