sinatra-kittens 0.0.1 → 0.0.3

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
- ---
2
- SHA1:
3
- metadata.gz: 581ede8a9c66829a5b4aa063ba78eb54e01be02c
4
- data.tar.gz: f95bff35b1c6a4382c4aac54cb68b7f0540ad584
5
- SHA512:
6
- metadata.gz: e5249cbb4f29cbecfcd1503684e5d87b6559344529d67aef819c7fa594793c0c53291d4aea3c9c32860d28f298d300ff04880a51e9b8be6c85c1725d07c7f83f
7
- data.tar.gz: c02f270cfbed933b980e87cced4c04088eb65767e13c7fec3eb607892f35a1791f67ef4c38bf829a3ff6b624ad6f097b74cdd6b122e22b8e8bbf02d5a67c521e
1
+ ---
2
+ SHA1:
3
+ data.tar.gz: 6b77afc5188a129358caacae1115f55ef0cb7727
4
+ metadata.gz: 110880438bad412bb4b66910400a3c976fb0d353
5
+ SHA512:
6
+ data.tar.gz: d8976beb627d4b22ad393cf546aeff727c0944d96e8bf6df9a9877fe69235c6b958fb01926e09177b3f577a7c4fbbb2735591aeec006920c9bf140b941850f9d
7
+ metadata.gz: 59588ca358684b553628969cb1f296d1c2be5c75f39771d90dee26ab4bd31332be9c7a01daedbb07f3c0ef5a1493cb8877702fd02fcccb0f15517d84f951dbe9
data/README.md CHANGED
@@ -2,8 +2,10 @@
2
2
 
3
3
  Providing kitten not_found pages for [Sinatra](https://github.com/sinatra/sinatra "Sinatra") using [placekitten](http://placekitten.com/ "placekitten").
4
4
 
5
+ Example application [here](http://sinatra-kittens-example.herokuapp.com/).
6
+
5
7
  ## Requirements
6
- - Ruby => 1.9.2
8
+ - Ruby => 1.8.7
7
9
  - Sinatra ~> 1.3
8
10
 
9
11
  ## Installation
@@ -25,7 +27,7 @@ Install it:
25
27
  Require the Gem and register the `Kittens` Module:
26
28
 
27
29
  ```ruby
28
- require 'sinatra-kittens'
30
+ require 'sinatra/kittens'
29
31
 
30
32
  class Application < Sinatra::Base
31
33
  configure do
@@ -0,0 +1,26 @@
1
+ module Sinatra
2
+ module Kittens
3
+ module Helpers
4
+ def kittens_page(x = 200..500, factor = 0.2)
5
+ sample_method = RUBY_VERSION >= '1.9' ? :sample : :choice
6
+ x = x.to_a.send(sample_method)
7
+ y = ((x - factor*x).floor..(x + factor*x).ceil).to_a.send(sample_method)
8
+
9
+ <<-HTML
10
+ <!DOCTYPE html>
11
+ <html>
12
+ <head>
13
+ <title>Not found</title>
14
+ </head>
15
+ <body>
16
+ <center>
17
+ <h1>Page not found</h2>
18
+ <img src="http://placekitten.com/#{x}/#{y}" alt="Kitten!" height="#{x}" width="#{y}">
19
+ </center>
20
+ </body>
21
+ </html>
22
+ HTML
23
+ end
24
+ end
25
+ end
26
+ end
@@ -1,5 +1,5 @@
1
1
  module Sinatra
2
2
  module Kittens
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.version = Sinatra::Kittens::VERSION
8
8
  spec.authors = ['Tobias Bühlmann']
9
9
  spec.email = ['tobias.buehlmann@gmx.de']
10
- spec.date = '2013-03-05'
10
+ spec.date = '2013-03-06'
11
11
  spec.description = 'Kitten pictures for Sinatra not_found pages.'
12
12
  spec.summary = spec.description
13
13
  spec.homepage = 'https://github.com/tbuehlmann/kittens'
@@ -18,11 +18,12 @@ Gem::Specification.new do |spec|
18
18
  Gemfile
19
19
  LICENSE.txt
20
20
  README.md
21
- sinatra-kittens.gemspec
22
21
  lib/sinatra/kittens.rb
22
+ lib/sinatra/kittens/helpers.rb
23
23
  lib/sinatra/kittens/version.rb
24
+ sinatra-kittens.gemspec
24
25
  ]
25
26
 
26
- spec.required_ruby_version = '>= 1.9.2'
27
+ spec.required_ruby_version = '>= 1.8.7'
27
28
  spec.add_dependency 'sinatra', '~> 1.3'
28
29
  end
metadata CHANGED
@@ -1,65 +1,70 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: sinatra-kittens
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
5
  platform: ruby
6
- authors:
7
- - Tobias Bühlmann
6
+ authors:
7
+ - "Tobias B\xC3\xBChlmann"
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-05 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
11
+
12
+ date: 2013-03-06 00:00:00 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
14
15
  name: sinatra
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: '1.3'
20
- type: :runtime
21
16
  prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
17
+ requirement: &id001 !ruby/object:Gem::Requirement
18
+ requirements:
24
19
  - - ~>
25
- - !ruby/object:Gem::Version
26
- version: '1.3'
20
+ - !ruby/object:Gem::Version
21
+ version: "1.3"
22
+ type: :runtime
23
+ version_requirements: *id001
27
24
  description: Kitten pictures for Sinatra not_found pages.
28
- email:
25
+ email:
29
26
  - tobias.buehlmann@gmx.de
30
27
  executables: []
28
+
31
29
  extensions: []
30
+
32
31
  extra_rdoc_files: []
33
- files:
32
+
33
+ files:
34
34
  - .gitignore
35
35
  - Gemfile
36
36
  - LICENSE.txt
37
37
  - README.md
38
- - sinatra-kittens.gemspec
39
38
  - lib/sinatra/kittens.rb
39
+ - lib/sinatra/kittens/helpers.rb
40
40
  - lib/sinatra/kittens/version.rb
41
+ - sinatra-kittens.gemspec
41
42
  homepage: https://github.com/tbuehlmann/kittens
42
- licenses:
43
+ licenses:
43
44
  - MIT
44
45
  metadata: {}
46
+
45
47
  post_install_message:
46
48
  rdoc_options: []
47
- require_paths:
49
+
50
+ require_paths:
48
51
  - lib
49
- required_ruby_version: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - '>='
52
- - !ruby/object:Gem::Version
53
- version: 1.9.2
54
- required_rubygems_version: !ruby/object:Gem::Requirement
55
- requirements:
56
- - - '>='
57
- - !ruby/object:Gem::Version
58
- version: '0'
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 1.8.7
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: "0"
59
62
  requirements: []
63
+
60
64
  rubyforge_project:
61
65
  rubygems_version: 2.0.0
62
66
  signing_key:
63
67
  specification_version: 4
64
68
  summary: Kitten pictures for Sinatra not_found pages.
65
69
  test_files: []
70
+