Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit ec2efbff14e496c0121bfbb0045e43ec619a43b7 @heelhook committed Mar 15, 2013
@@ -0,0 +1,4 @@
+*.gem
+.bundle
+Gemfile.lock
+pkg/*
@@ -0,0 +1,2 @@
+source "https://rubygems.org"
+gemspec
20 LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2012 Pablo Fernandez
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,45 @@
+# intro.js-rails
+**Intro.js for rails asset pipeline**
+
+[Intro.js][0] is a better way for new feature introduction and step-by-step users guide for your website and project.
+
+## Usage
+
+### Install introjs-rails gem
+
+Add `introjs-rails` to your Gemfile and run `bundle install`:
+
+ gem "introjs-rails"
+
+### Include introjs-rails javascript assets
+
+Add the following to your `app/assets/javascripts/application.js`:
+
+ //= require introjs
+
+### Include introjs-rails stylesheet assets
+
+Add to your `app/assets/stylesheets/application.css`:
+
+ *= require introjs
+
+## Version
+
+`introjs-rails` tracks [Intro.js][0]'s versions.
+
+## Contributions
+
+If you want to contribute, please:
+
+ * Fork the project.
+ * Make your feature addition or bug fix.
+ * Send me a pull request on Github.
+
+## Copyright
+
+### MIT Licensed
+
+Copyright (c) 2013 Pablo Fernandez. See [LICENSE][1] for details.
+
+[0]: https://github.com/usablica/intro.js
+[1]: https://github.com/heelhook/intro.js-rails/blob/master/LICENSE
@@ -0,0 +1,28 @@
+#!/usr/bin/env rake
+
+require "bundler/gem_tasks"
+require File.expand_path('../lib/introjs-rails/source_file', __FILE__)
+
+$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
+require 'introjs-rails/version'
+
+task default: :update
+
+desc "Update library"
+task :update do
+ files = SourceFile.new
+ files.fetch
+end
+
+task gem: :build
+task :build do
+ system "gem build introjs-rails.gemspec"
+end
+
+task release: :build do
+ version = Introjs::Rails::VERSION
+ system "git tag -a v#{version} -m 'Tagging #{version}'"
+ system "git push --tags"
+ system "gem push introjs-#{version}.gem"
+ system "rm introjs-#{version}.gem"
+end

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1,20 @@
+require File.expand_path("../lib/introjs-rails/version", __FILE__)
+
+Gem::Specification.new do |s|
+ s.name = "introjs-rails"
+ s.version = Introjs::Rails::VERSION
+ s.authors = ["Pablo Fernandez"]
+ s.email = ["heelhook@littleq.net"]
+ s.homepage = "https://github.com/heelhook/introjs-rails"
+ s.summary = %q{Integrate the excellent Intro.js javascript library with Rails asset pipeline}
+ s.description = %q{A better way for new feature introduction and step-by-step users guide for your website and project.}
+
+ s.files = `git ls-files`.split("\n")
+ s.require_paths = ["lib"]
+
+ s.add_dependency "thor", "~> 0.14"
+ s.add_runtime_dependency "sass-rails", ">= 3.2"
+ s.add_development_dependency "bundler", "~> 1.0"
+ s.add_development_dependency "rails", "~> 3.0"
+ s.add_development_dependency "httpclient", "~> 2.2"
+end
No changes.
@@ -0,0 +1,6 @@
+module Introjs
+ module Rails
+ class Engine < ::Rails::Engine
+ end
+ end
+end
@@ -0,0 +1,33 @@
+require "thor"
+require "json"
+require "httpclient"
+
+class SourceFile < Thor
+ include Thor::Actions
+
+ desc "fetch source files", "fetch source files from GitHub"
+ def fetch
+ filtered_tags = fetch_tags
+ tag = select("Which tag do you want to fetch?", filtered_tags)
+ self.destination_root = "app/assets"
+ remote = "https://github.com/usablica/intro.js"
+ get "#{remote}/raw/#{tag}/minified/intro.min.js", "javascripts/introjs.js"
+ get "#{remote}/raw/#{tag}/minified/introjs.min.css", "stylesheets/introjs.css"
+ end
+
+ private
+
+ def fetch_tags
+ http = HTTPClient.new
+ response = JSON.parse(http.get("https://api.github.com/repos/usablica/intro.js/tags").body)
+ response.map{|tag| tag["name"]}.sort
+ end
+
+ def select msg, elements
+ elements.each_with_index do |element, index|
+ say(block_given? ? yield(element, index + 1) : ("#{index + 1}. #{element.to_s}"))
+ end
+ result = ask(msg).to_i
+ elements[result - 1]
+ end
+end
@@ -0,0 +1,5 @@
+module Introjs
+ module Rails
+ VERSION = "0.1.0"
+ end
+end

0 comments on commit ec2efbf

Please sign in to comment.