piecon-rails 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +7 -0
- data/.travis.yml +4 -0
- data/Changelog.md +4 -0
- data/Gemfile +2 -0
- data/Rakefile +5 -0
- data/Readme.md +31 -0
- data/app/assets/javascripts/piecon.js +5 -0
- data/lib/piecon-rails.rb +2 -0
- data/lib/piecon/rails.rb +6 -0
- data/lib/piecon/version.rb +3 -0
- data/piecon-rails.gemspec +25 -0
- metadata +112 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NmE4ZjhiMTRmNmE0Yjg4ZTEwZGZmNWVlMzMxZjliOGY3MzIwZTZhNA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NjQzM2I1OWRmNjk2Y2EwZGExNDJhMDM3NzRmNDJiNjEyZWM4NTcwNw==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YjQzZTYzZmM2NDQ5ZjFjNjRjNTNlMjNkOTY3NjE0ZjM1MDczMTk2ZTA2Mjky
|
10
|
+
ZGU1MjkyZGNhN2ZhMjBmOWIwMGVjMDdkYTMwMTQ5OGI3ZGMyNGZiZWMwNjNl
|
11
|
+
MWIxNDI2MWMwYmY4ZjJhMDk1OTJlMWM0Y2IyZTliNTkyNzI5Mzc=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZGZlZGUwY2Q2OTYxNjVjMWY4OThhODI1NmY4MDNjMmMzNzU5OTI0NWUxZjk2
|
14
|
+
ZjNjZjVhZDk5NzYyODRiZWUzNmQzY2FlMzcwNjI2MGU5NGQyYTNmOGQ0NzM1
|
15
|
+
YzYwYmQ2MjMxNzU0MzAxZmI1NWI3NzViODJkYTM3ZDNlYjc2N2U=
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Changelog.md
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
data/Readme.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Piecon-Rails
|
2
|
+
|
3
|
+
A Ruby wrapper to integrate [Piecon](https://github.com/lipka/piecon) - A tiny javascript library for generating progress pie charts in your favicon, in your Rails asset pipeline easily.
|
4
|
+
|
5
|
+
You can find a [Sample Rails Application here](http://morning-bayou-5775.herokuapp.com).
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add the gem to the Gemfile:
|
10
|
+
|
11
|
+
gem "piecon-rails"
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
In your JavaScript manifest (e.g. `application.js`):
|
16
|
+
|
17
|
+
//= require piecon
|
18
|
+
|
19
|
+
|
20
|
+
In your `application.html.erb` or `application.html.haml` make sure you have
|
21
|
+
|
22
|
+
favicon_link_tag 'favicon.ico'
|
23
|
+
|
24
|
+
And after all `favicon.ico` in your `app/assets/images` :smile:
|
25
|
+
|
26
|
+
## Licensing
|
27
|
+
|
28
|
+
|
29
|
+
The gem itself is released under the MIT license
|
30
|
+
|
31
|
+
:pray:
|
@@ -0,0 +1,5 @@
|
|
1
|
+
(function(){var h={},k=null,m=null,e=null,f=null,g={},n={color:"#ff0084",background:"#bbb",shadow:"#fff",fallback:!1},r=1<window.devicePixelRatio,d=function(){var c=navigator.userAgent.toLowerCase();return function(a){return-1!==c.indexOf(a)}}(),s=d("msie");d("chrome");d("chrome")||d("safari");var t=d("safari")&&!d("chrome");d("mozilla")&&!d("chrome")&&d("safari");var p=function(c){for(var a=document.getElementsByTagName("link"),b=document.getElementsByTagName("head")[0],l=0,d=a.length;l<d;l++)("icon"===
|
2
|
+
a[l].getAttribute("rel")||"shortcut icon"===a[l].getAttribute("rel"))&&b.removeChild(a[l]);a=document.createElement("link");a.type="image/x-icon";a.rel="icon";a.href=c;document.getElementsByTagName("head")[0].appendChild(a)},q=function(){f||(f=document.createElement("canvas"),r?(f.width=32,f.height=32):(f.width=16,f.height=16));return f},u=function(c){var a=q(),b=a.getContext("2d");c=c||0;var d=k,e=new Image;e.onload=function(){b&&(b.clearRect(0,0,a.width,a.height),b.beginPath(),b.moveTo(a.width/
|
3
|
+
2,a.height/2),b.arc(a.width/2,a.height/2,Math.min(a.width/2,a.height/2),0,2*Math.PI,!1),b.fillStyle=g.shadow,b.fill(),b.beginPath(),b.moveTo(a.width/2,a.height/2),b.arc(a.width/2,a.height/2,Math.min(a.width/2,a.height/2)-2,0,2*Math.PI,!1),b.fillStyle=g.background,b.fill(),0<c&&(b.beginPath(),b.moveTo(a.width/2,a.height/2),b.arc(a.width/2,a.height/2,Math.min(a.width/2,a.height/2)-2,-0.5*Math.PI,(-0.5+2*c/100)*Math.PI,!1),b.lineTo(a.width/2,a.height/2),b.fillStyle=g.color,b.fill()),p(a.toDataURL()))};
|
4
|
+
d.match(/^data/)||(e.crossOrigin="anonymous");e.src=d};h.setOptions=function(c){g={};for(var a in n)g[a]=c.hasOwnProperty(a)?c[a]:n[a];return this};h.setProgress=function(c){e||(e=document.title);if(!m||!k){var a;a:{a=document.getElementsByTagName("link");for(var b=0,d=a.length;b<d;b++)if("icon"===a[b].getAttribute("rel")||"shortcut icon"===a[b].getAttribute("rel")){a=a[b];break a}a=!1}m=k=a?a.getAttribute("href"):"/favicon.ico"}if(!isNaN(parseFloat(c))&&isFinite(c)){if(!q().getContext||s||t||!0===
|
5
|
+
g.fallback){document.title=0<c?"("+c+"%) "+e:e;return}"force"===g.fallback&&(document.title=0<c?"("+c+"%) "+e:e);return u(c)}return!1};h.reset=function(){e&&(document.title=e);m&&(k=m,p(k))};h.setOptions(n);window.Piecon=h})();
|
data/lib/piecon-rails.rb
ADDED
data/lib/piecon/rails.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "piecon/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "piecon-rails"
|
7
|
+
s.version = Piecon::VERSION
|
8
|
+
s.authors = ["Ankit Gupta"]
|
9
|
+
s.date = '2013-11-09'
|
10
|
+
s.email = ["ankit.gupta8898@gmail.com"]
|
11
|
+
s.summary = %q{Gem for easily adding Piecon to the Rails Asset Pipeline}
|
12
|
+
s.description = %q{Gem that includes Piecon (A tiny javascript library for generating progress pie charts in your favicon)}
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
s.licenses = ['MIT']
|
19
|
+
s.homepage = 'https://github.com/ankit8898/piecon-rails'
|
20
|
+
s.add_dependency "railties", ">= 3.1"
|
21
|
+
s.add_development_dependency "bundler", "~> 1.0"
|
22
|
+
s.add_development_dependency "rails", ">= 3.1"
|
23
|
+
s.add_development_dependency 'rake'
|
24
|
+
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: piecon-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ankit Gupta
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-11-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: railties
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rails
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.1'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Gem that includes Piecon (A tiny javascript library for generating progress
|
70
|
+
pie charts in your favicon)
|
71
|
+
email:
|
72
|
+
- ankit.gupta8898@gmail.com
|
73
|
+
executables: []
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- .gitignore
|
78
|
+
- .travis.yml
|
79
|
+
- Changelog.md
|
80
|
+
- Gemfile
|
81
|
+
- Rakefile
|
82
|
+
- Readme.md
|
83
|
+
- app/assets/javascripts/piecon.js
|
84
|
+
- lib/piecon-rails.rb
|
85
|
+
- lib/piecon/rails.rb
|
86
|
+
- lib/piecon/version.rb
|
87
|
+
- piecon-rails.gemspec
|
88
|
+
homepage: https://github.com/ankit8898/piecon-rails
|
89
|
+
licenses:
|
90
|
+
- MIT
|
91
|
+
metadata: {}
|
92
|
+
post_install_message:
|
93
|
+
rdoc_options: []
|
94
|
+
require_paths:
|
95
|
+
- lib
|
96
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ! '>='
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ! '>='
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
requirements: []
|
107
|
+
rubyforge_project:
|
108
|
+
rubygems_version: 2.1.10
|
109
|
+
signing_key:
|
110
|
+
specification_version: 4
|
111
|
+
summary: Gem for easily adding Piecon to the Rails Asset Pipeline
|
112
|
+
test_files: []
|