chardinjs-rails 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "https://rubygems.org"
2
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 Pablo Fernandez
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # chardin.js-rails
2
+ **Chardin.js for rails asset pipeline**
3
+
4
+ [Chardin.js][0] provides a simple overlay instructions for your apps.
5
+
6
+ ## Usage
7
+
8
+ ### Install chardinjs-rails gem
9
+
10
+ Add `chardinjs-rails` to your Gemfile and run `bundle install`:
11
+
12
+ gem "chardinjs-rails"
13
+
14
+ ### Include chardinjs-rails javascript assets
15
+
16
+ Add the following to your `app/assets/javascripts/application.js`:
17
+
18
+ //= require chardinjs
19
+
20
+ ### Include chardinjs-rails stylesheet assets
21
+
22
+ Add to your `app/assets/stylesheets/application.css`:
23
+
24
+ *= require chardinjs
25
+
26
+ ## Version
27
+
28
+ `chardinjs-rails` tracks [Chardin.js][0]'s versions.
29
+
30
+ ## Contributions
31
+
32
+ If you want to contribute, please:
33
+
34
+ * Fork the project.
35
+ * Make your feature addition or bug fix.
36
+ * Send me a pull request on Github.
37
+
38
+ ## Copyright
39
+
40
+ ### MIT Licensed
41
+
42
+ Copyright (c) 2013 Pablo Fernandez. See [LICENSE][1] for details.
43
+
44
+ [0]: https://github.com/heelhook/chardin.js
45
+ [1]: https://github.com/heelhook/chardin.js-rails/blob/master/LICENSE
data/Rakefile ADDED
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env rake
2
+
3
+ require "bundler/gem_tasks"
4
+ require File.expand_path('../lib/chardinjs-rails/source_file', __FILE__)
5
+
6
+ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
7
+ require 'chardinjs-rails/version'
8
+
9
+ task default: :update
10
+
11
+ desc "Update library"
12
+ task :update do
13
+ files = SourceFile.new
14
+ files.fetch
15
+ end
16
+
17
+ task gem: :build
18
+ task :build do
19
+ system "gem build chardinjs-rails.gemspec"
20
+ end
21
+
22
+ task release: :build do
23
+ version = chardinjs::Rails::VERSION
24
+ system "git tag -a v#{version} -m 'Tagging #{version}'"
25
+ system "git push --tags"
26
+ system "gem push chardinjs-#{version}.gem"
27
+ system "rm chardinjs-#{version}.gem"
28
+ end
@@ -0,0 +1,20 @@
1
+ require File.expand_path("../lib/chardinjs-rails/version", __FILE__)
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "chardinjs-rails"
5
+ s.version = Chardinjs::Rails::VERSION
6
+ s.authors = ["Pablo Fernandez"]
7
+ s.email = ["heelhook@littleq.net"]
8
+ s.homepage = "https://github.com/heelhook/chardinjs-rails"
9
+ s.summary = %q{Integrate the excellent Chardin.js javascript library with Rails asset pipeline}
10
+ s.description = %q{Simple overlay instructions for your apps.}
11
+
12
+ s.files = `git ls-files`.split("\n")
13
+ s.require_paths = ["lib"]
14
+
15
+ s.add_dependency "thor", "~> 0.14"
16
+ s.add_runtime_dependency "sass-rails", ">= 3.2"
17
+ s.add_development_dependency "bundler", "~> 1.0"
18
+ s.add_development_dependency "rails", "~> 3.0"
19
+ s.add_development_dependency "httpclient", "~> 2.2"
20
+ end
@@ -0,0 +1,2 @@
1
+ require 'chardinjs-rails/engine'
2
+ require 'chardinjs-rails/version'
@@ -0,0 +1,6 @@
1
+ module Chardinjs
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,42 @@
1
+ require "thor"
2
+ require "json"
3
+ require "httpclient"
4
+
5
+ class SourceFile < Thor
6
+ include Thor::Actions
7
+
8
+ desc "fetch source files", "fetch source files from GitHub"
9
+ def fetch
10
+ filtered_tags = fetch_tags
11
+ tag = select("Which tag do you want to fetch?", filtered_tags)
12
+ self.destination_root = "app/assets"
13
+ remote = "https://github.com/heelhook/chardin.js"
14
+ get "#{remote}/raw/#{tag}/chardinjs.min.js", "javascripts/chardinjs.js"
15
+ get "#{remote}/raw/#{tag}/chardinjs.css", "stylesheets/chardinjs.css"
16
+
17
+ versionrb = File.readlines('lib/chardinjs-rails/version.rb')
18
+ tag = tag[1..-1] # Skip the v in the tag
19
+ File.open('lib/chardinjs-rails/version.rb', 'w') do |file|
20
+ versionrb.each do |l|
21
+ l.gsub!(/VERSION = (.*)/, "VERSION = '#{tag}'") if l =~ /VERSION =/
22
+ file << l
23
+ end
24
+ end
25
+ end
26
+
27
+ private
28
+
29
+ def fetch_tags
30
+ http = HTTPClient.new
31
+ response = JSON.parse(http.get("https://api.github.com/repos/heelhook/chardin.js/tags").body)
32
+ response.map{|tag| tag["name"]}.sort
33
+ end
34
+
35
+ def select msg, elements
36
+ elements.each_with_index do |element, index|
37
+ say(block_given? ? yield(element, index + 1) : ("#{index + 1}. #{element.to_s}"))
38
+ end
39
+ result = ask(msg).to_i
40
+ elements[result - 1]
41
+ end
42
+ end
@@ -0,0 +1,5 @@
1
+ module Chardinjs
2
+ module Rails
3
+ VERSION = '0.1.0'
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,141 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: chardinjs-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Pablo Fernandez
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-04-05 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: thor
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '0.14'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '0.14'
30
+ - !ruby/object:Gem::Dependency
31
+ name: sass-rails
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '3.2'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '3.2'
46
+ - !ruby/object:Gem::Dependency
47
+ name: bundler
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: '1.0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rails
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: '3.0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '3.0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: httpclient
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: '2.2'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: '2.2'
94
+ description: Simple overlay instructions for your apps.
95
+ email:
96
+ - heelhook@littleq.net
97
+ executables: []
98
+ extensions: []
99
+ extra_rdoc_files: []
100
+ files:
101
+ - .gitignore
102
+ - Gemfile
103
+ - LICENSE
104
+ - README.md
105
+ - Rakefile
106
+ - chardinjs-rails.gemspec
107
+ - lib/chardinjs-rails.rb
108
+ - lib/chardinjs-rails/engine.rb
109
+ - lib/chardinjs-rails/source_file.rb
110
+ - lib/chardinjs-rails/version.rb
111
+ homepage: https://github.com/heelhook/chardinjs-rails
112
+ licenses: []
113
+ post_install_message:
114
+ rdoc_options: []
115
+ require_paths:
116
+ - lib
117
+ required_ruby_version: !ruby/object:Gem::Requirement
118
+ none: false
119
+ requirements:
120
+ - - ! '>='
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ segments:
124
+ - 0
125
+ hash: -501672828919507099
126
+ required_rubygems_version: !ruby/object:Gem::Requirement
127
+ none: false
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ segments:
133
+ - 0
134
+ hash: -501672828919507099
135
+ requirements: []
136
+ rubyforge_project:
137
+ rubygems_version: 1.8.25
138
+ signing_key:
139
+ specification_version: 3
140
+ summary: Integrate the excellent Chardin.js javascript library with Rails asset pipeline
141
+ test_files: []